From 5bb8db06b01524bee613776cb9896a85ecbe2862 Mon Sep 17 00:00:00 2001 From: ilotterytea Date: Mon, 10 Jun 2024 00:04:33 +0500 Subject: feat: render pet bros --- core/src/kz/ilotterytea/maxon/pets/Pet.java | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) (limited to 'core/src/kz/ilotterytea/maxon/pets') diff --git a/core/src/kz/ilotterytea/maxon/pets/Pet.java b/core/src/kz/ilotterytea/maxon/pets/Pet.java index 4b4cb00..7c69a0b 100644 --- a/core/src/kz/ilotterytea/maxon/pets/Pet.java +++ b/core/src/kz/ilotterytea/maxon/pets/Pet.java @@ -2,6 +2,7 @@ package kz.ilotterytea.maxon.pets; import com.badlogic.gdx.graphics.Texture; import com.badlogic.gdx.graphics.g2d.TextureRegion; +import com.badlogic.gdx.graphics.g3d.decals.Decal; import com.badlogic.gdx.utils.GdxRuntimeException; import kz.ilotterytea.maxon.MaxonConstants; import kz.ilotterytea.maxon.MaxonGame; @@ -14,15 +15,17 @@ public class Pet { private final String id, name, description; private final double price, multiplier; private final AnimatedImage icon; + private final Decal decal; private static final Logger logger = LoggerFactory.getLogger(Pet.class); - private Pet(String id, String name, String description, double price, double multiplier, AnimatedImage icon) { + private Pet(String id, String name, String description, double price, double multiplier, AnimatedImage icon, Decal decal) { this.id = id; this.name = name; this.description = description; this.price = price; this.multiplier = multiplier; this.icon = icon; + this.decal = decal; } public static Pet create(String id, double price, double multiplier, int iconColumns, int iconRows) { @@ -56,7 +59,9 @@ public class Pet { description = "pet." + id + ".desc"; } - return new Pet(id, name, description, price, multiplier, icon); + Decal decal = Decal.newDecal(0.5f, 0.5f, regions[0], true); + + return new Pet(id, name, description, price, multiplier, icon, decal); } public String getId() { @@ -82,4 +87,8 @@ public class Pet { public AnimatedImage getIcon() { return icon; } + + public Decal getDecal() { + return decal; + } } -- cgit v1.2.3