From accbb778f515bb47ea3eb718f639d7c8008accbb Mon Sep 17 00:00:00 2001 From: ilotterytea Date: Sun, 2 Jun 2024 00:32:26 +0500 Subject: feat/upd: player icons + icon for amount of purchased items --- assets/sprites/gui/player_icons.atlas | 9 +++++++++ assets/sprites/gui/player_icons.png | Bin 0 -> 10082 bytes core/src/kz/ilotterytea/maxon/screens/GameScreen.java | 5 +++-- core/src/kz/ilotterytea/maxon/ui/SavegameWidget.java | 4 ++-- core/src/kz/ilotterytea/maxon/utils/AssetLoading.java | 2 ++ 5 files changed, 16 insertions(+), 4 deletions(-) create mode 100644 assets/sprites/gui/player_icons.atlas create mode 100644 assets/sprites/gui/player_icons.png diff --git a/assets/sprites/gui/player_icons.atlas b/assets/sprites/gui/player_icons.atlas new file mode 100644 index 0000000..890ca25 --- /dev/null +++ b/assets/sprites/gui/player_icons.atlas @@ -0,0 +1,9 @@ +player_icons.png +size:256,64 +repeat:none +multiplier +bounds:0,0,64,64 +pets +bounds:64,0,64,64 +points +bounds:128,0,64,64 diff --git a/assets/sprites/gui/player_icons.png b/assets/sprites/gui/player_icons.png new file mode 100644 index 0000000..8b23506 Binary files /dev/null and b/assets/sprites/gui/player_icons.png differ diff --git a/core/src/kz/ilotterytea/maxon/screens/GameScreen.java b/core/src/kz/ilotterytea/maxon/screens/GameScreen.java index 126bde7..649cd1e 100644 --- a/core/src/kz/ilotterytea/maxon/screens/GameScreen.java +++ b/core/src/kz/ilotterytea/maxon/screens/GameScreen.java @@ -57,7 +57,7 @@ public class GameScreen implements Screen, InputProcessor { Stage stage; private Skin skin, uiSkin; - TextureAtlas mainAtlas; + TextureAtlas mainAtlas, playerIconAtlas; Label pointsLabel, multiplierLabel; AnimatedImage cat; @@ -553,10 +553,11 @@ public class GameScreen implements Screen, InputProcessor { this.stage = new Stage(new ScreenViewport()); this.skin = this.game.assetManager.get("MainSpritesheet.skin", Skin.class); this.mainAtlas = this.game.assetManager.get("MainSpritesheet.atlas", TextureAtlas.class); + this.playerIconAtlas = this.game.assetManager.get("sprites/gui/player_icons.atlas", TextureAtlas.class); this.uiSkin = this.game.assetManager.get("sprites/gui/ui.skin", Skin.class); - this.shopUI = new ShopUI(savegame, this.stage, this.uiSkin, this.mainAtlas); + this.shopUI = new ShopUI(savegame, this.stage, this.uiSkin, this.playerIconAtlas); shopUI.createShopTitleUI(); shopUI.createShopControlUI(); diff --git a/core/src/kz/ilotterytea/maxon/ui/SavegameWidget.java b/core/src/kz/ilotterytea/maxon/ui/SavegameWidget.java index 7069911..04e7059 100644 --- a/core/src/kz/ilotterytea/maxon/ui/SavegameWidget.java +++ b/core/src/kz/ilotterytea/maxon/ui/SavegameWidget.java @@ -28,7 +28,7 @@ public class SavegameWidget extends Table implements Disposable { super(); this.game = game; this.stage = stage; - this.atlas = game.assetManager.get("MainSpritesheet.atlas", TextureAtlas.class); + this.atlas = game.assetManager.get("sprites/gui/player_icons.atlas", TextureAtlas.class); this.skin = skin; this.savegame = savegame; @@ -128,7 +128,7 @@ public class SavegameWidget extends Table implements Disposable { // Unit long amount = savegame.inv.size(); - Image unitIcon = new Image(atlas.findRegion("points")); + Image unitIcon = new Image(atlas.findRegion("pets")); data.add(unitIcon).size(32f, 32f).padRight(8f); Label unit = new Label(NumberFormatter.format(amount), skin); diff --git a/core/src/kz/ilotterytea/maxon/utils/AssetLoading.java b/core/src/kz/ilotterytea/maxon/utils/AssetLoading.java index 37bca8b..e1d89b4 100644 --- a/core/src/kz/ilotterytea/maxon/utils/AssetLoading.java +++ b/core/src/kz/ilotterytea/maxon/utils/AssetLoading.java @@ -37,6 +37,8 @@ public class AssetLoading { am.load("sprites/gui/ui.atlas", TextureAtlas.class); am.load("sprites/gui/ui.skin", Skin.class, new SkinLoader.SkinParameter("sprites/gui/ui.atlas")); + am.load("sprites/gui/player_icons.atlas", TextureAtlas.class); + // Models: am.load("models/scenes/living_room.glb", SceneAsset.class); -- cgit v1.2.3