From 45e3871e0b6f8722f181a681dbc954444e653c1c Mon Sep 17 00:00:00 2001 From: ilotterytea Date: Thu, 8 Dec 2022 01:49:59 +0600 Subject: Pet utils. --- .../ilotterytea/maxoning/player/utils/PetUtils.kt | 42 ++++++++++++++++++++++ 1 file changed, 42 insertions(+) create mode 100644 core/src/com/ilotterytea/maxoning/player/utils/PetUtils.kt (limited to 'core/src/com/ilotterytea/maxoning/player') 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 -- cgit v1.2.3