summaryrefslogtreecommitdiff
path: root/core
diff options
context:
space:
mode:
authorilotterytea <iltsu@alright.party>2022-12-08 01:49:59 +0600
committerilotterytea <iltsu@alright.party>2022-12-08 01:49:59 +0600
commit45e3871e0b6f8722f181a681dbc954444e653c1c (patch)
treefaae994f5d63a2bceb2b28490e52c04e73b05611 /core
parent34a8bd8df0a32f4dce1116b4584acf88743e80d7 (diff)
Pet utils.
Diffstat (limited to 'core')
-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