From 6f2cf244f8d92068963207205125f2167768ff53 Mon Sep 17 00:00:00 2001 From: Tom Barrett Date: Sat, 10 Apr 2021 12:28:16 +0200 Subject: setup for new tileset --- src/main.rs | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) (limited to 'src/main.rs') 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, ), -- cgit v1.2.3