summaryrefslogtreecommitdiff
path: root/core/src
diff options
context:
space:
mode:
Diffstat (limited to 'core/src')
-rw-r--r--core/src/com/ilotterytea/maxoning/player/utils/PetUtils.kt42
1 files changed, 42 insertions, 0 deletions
diff --git a/core/src/com/ilotterytea/maxoning/player/utils/PetUtils.kt b/core/src/com/ilotterytea/maxoning/player/utils/PetUtils.kt
new file mode 100644
index 0000000..1ad9106
--- /dev/null
+++ b/core/src/com/ilotterytea/maxoning/player/utils/PetUtils.kt
@@ -0,0 +1,42 @@
+package com.ilotterytea.maxoning.player.utils
+
+import com.badlogic.gdx.assets.AssetManager
+import com.badlogic.gdx.graphics.Texture
+import com.ilotterytea.maxoning.anim.SpriteUtils
+import com.ilotterytea.maxoning.ui.AnimatedImage
+
+/**
+ * Utilities for some operations with pets.
+ */
+class PetUtils {
+ companion object {
+ @JvmStatic
+ /**
+ * Get animated image of pet by its ID.
+ * */
+ fun animatedImageById(assetManager: AssetManager, id: Int) : AnimatedImage {
+ val img: AnimatedImage
+
+ when (id) {
+ // Maxon:
+ 0 -> img = AnimatedImage(SpriteUtils.splitToTextureRegions(
+ assetManager.get(
+ "sprites/sheet/loadingCircle.png",
+ Texture::class.java
+ ),
+ 112, 112, 10, 5
+ ))
+ // Maxon:
+ else -> img = AnimatedImage(SpriteUtils.splitToTextureRegions(
+ assetManager.get(
+ "sprites/sheet/loadingCircle.png",
+ Texture::class.java
+ ),
+ 112, 112, 10, 5
+ ))
+ }
+
+ return img
+ }
+ }
+} \ No newline at end of file