// In this program, a filter is applied to text use bevy::prelude::*; use seldom_pixel::prelude::*; fn main() { App::new() .add_plugins(( DefaultPlugins.set(WindowPlugin { primary_window: Some(Window { resolution: Vec2::splat(512.).into(), ..default() }), ..default() }), PxPlugin::::new(UVec2::splat(64), "palette/palette_1.png".into()), )) .insert_resource(ClearColor(Color::BLACK)) .add_systems(Startup, init) .run(); } fn init( mut commands: Commands, mut filters: PxAssets, mut typefaces: PxAssets, ) { commands.spawn(Camera2dBundle::default()); // Spawn text commands.spawn(( PxTextBundle:: { text: "THE MITOCHONDRIA IS THE POWERHOUSE OF THE CELL".into(), typeface: typefaces.load( "typeface/typeface.png", "ABCDEFGHIJKLMNOPQRSTUVWXYZ", // Equivalent to, for example, `vec![PxSeparatorConfig { character: ' ', width: 4 }]` [(' ', 4)], ), rect: IRect::new(0, 0, 64, 64).into(), ..default() }, filters.load("filter/dim.png"), )); } #[px_layer] struct Layer;