use bevy::prelude::*;
use bevy_typst_textures::{TypstJobOptions, TypstTextureServer, TypstTexturesPlugin};
fn main() {
App::new()
.add_plugins((DefaultPlugins, TypstTexturesPlugin::default()))
.add_systems(Startup, start)
.run();
}
fn start(
mut commands: Commands,
mut typst_server: ResMut<TypstTextureServer>,
mut materials: ResMut<Assets<StandardMaterial>>,
mut meshes: ResMut<Assets<Mesh>>,
) {
commands.spawn((
Camera3d { ..default() },
Transform::from_xyz(2., 4., 2.5).looking_at(Vec3::ZERO, Vec3::Y),
));
commands.spawn((
Mesh3d(meshes.add(Cuboid::new(1., 1., 1.))),
MeshMaterial3d(materials.add(StandardMaterial {
base_color_texture: Some(
typst_server.add_job("example.zip", TypstJobOptions::default()),
),
..default()
})),
));
commands.insert_resource(AmbientLight {
brightness: 2000.,
..default()
});
}