diff options
author | Tom Barrett <tom@tombarrett.xyz> | 2021-04-10 12:28:16 +0200 |
---|---|---|
committer | Tom Barrett <tom@tombarrett.xyz> | 2021-04-10 12:28:16 +0200 |
commit | 6f2cf244f8d92068963207205125f2167768ff53 (patch) | |
tree | d279fdb6859726d4362f0ce33e6a30ca37c30267 /src/main.rs | |
parent | 284ad7d9193bafbe44993bada105a92899650af1 (diff) |
setup for new tileset
Diffstat (limited to 'src/main.rs')
-rw-r--r-- | src/main.rs | 14 |
1 files changed, 12 insertions, 2 deletions
diff --git a/src/main.rs b/src/main.rs index b73c54a..8a59000 100644 --- a/src/main.rs +++ b/src/main.rs @@ -40,11 +40,12 @@ pub fn setup( ) { let background = asset_server.load("background.png"); let tileset = asset_server.load("tileset.png"); + let title = asset_server.load("title.png"); let atlas = TextureAtlas::from_grid( tileset, Vec2::new(constants::TILE_SIZE, constants::TILE_SIZE), - 4, + 5, 5, ); let atlas_handle = texture_atlases.add(atlas); @@ -59,6 +60,15 @@ pub fn setup( }, ..Default::default() }); + commands.spawn_bundle(SpriteBundle { + material: materials.add(title.into()), + transform: Transform { + translation: Vec3::new(240.0, 200.0, 0.0), + scale: Vec3::splat(2.0), + ..Default::default() + }, + ..Default::default() + }); commands.spawn_bundle(SpriteSheetBundle { sprite: TextureAtlasSprite::new(constants::TILESHEET_COSMONAUT1), texture_atlas: atlas_handle.clone(), @@ -93,7 +103,7 @@ pub fn setup( sprite: TextureAtlasSprite::new(constants::TILESHEET_NONE1), transform: Transform { translation: Vec3::new( - ((i as f32) * constants::TILE_SIZE * constants::TILE_SCALE) - 320.0, + ((i as f32) * constants::TILE_SIZE * constants::TILE_SCALE) - 330.0, ((j as f32) * constants::TILE_SIZE * constants::TILE_SCALE) - 160.0, 1.0, ), |