Skip to content

Commit

Permalink
Add text sprite pack
Browse files Browse the repository at this point in the history
  • Loading branch information
benfrankel committed Dec 10, 2023
1 parent 7eb55ab commit 38e36e0
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 3 deletions.
Binary file added assets/image/entity/text/PyriousPixel-B.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
18 changes: 15 additions & 3 deletions src/simulation/sprite_pack.rs
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,11 @@ pub struct SpritePackAssets {
#[asset(path = "image/entity/none.png")]
pub none: Handle<TextureAtlas>,

// Text
#[asset(texture_atlas(tile_size_x = 8.0, tile_size_y = 12.0, rows = 1, columns = 94))]
#[asset(path = "image/entity/text/PyriousPixel-B.png")]
pub text: Handle<TextureAtlas>,

// 1-bit
#[asset(texture_atlas(tile_size_x = 10.0, tile_size_y = 10.0, rows = 17, columns = 11))]
#[asset(path = "image/entity/1-bit/Clothing.png")]
Expand Down Expand Up @@ -125,6 +130,11 @@ fn load_atlas_list(mut atlas_list: ResMut<AtlasList>) {
path: "none",
tiles: vec![Tile::any_color(0)],
},
// Text
Atlas {
path: "text",
tiles: (0..94).map(Tile::any_color).collect(),
},
// 1-bit
Atlas {
path: "one_bit_clothing",
Expand Down Expand Up @@ -241,6 +251,7 @@ fn load_atlas_list(mut atlas_list: ResMut<AtlasList>) {
pub enum SpritePack {
#[default]
None,
Text,
OneBit,
Rpg,
Ninja,
Expand All @@ -250,9 +261,10 @@ impl SpritePack {
fn atlases(&self) -> Range<usize> {
match self {
Self::None => 0..1,
Self::OneBit => 1..14,
Self::Rpg => 14..20,
Self::Ninja => 20..24,
Self::Text => 1..2,
Self::OneBit => 2..15,
Self::Rpg => 15..21,
Self::Ninja => 21..25,
}
}

Expand Down

0 comments on commit 38e36e0

Please sign in to comment.