From d35fe9726bbdae75e22a51957c90ef333bed8caa Mon Sep 17 00:00:00 2001 From: AbnormalPoof Date: Tue, 25 Nov 2025 23:36:08 -0600 Subject: [PATCH] Update assets and add `getAtlasSettings()` for texture atlas characters Co-authored-by: VirtuGuy --- assets | 2 +- .../play/character/AnimateAtlasCharacter.hx | 15 ++++++++++++--- .../play/character/MultiAnimateAtlasCharacter.hx | 15 ++++++++++++--- 3 files changed, 25 insertions(+), 7 deletions(-) diff --git a/assets b/assets index 1441941c6..488058ab5 160000 --- a/assets +++ b/assets @@ -1 +1 @@ -Subproject commit 1441941c622f35542f9b515c1715538f4bee4163 +Subproject commit 488058ab55657487eac14a19b64a6612622aee65 diff --git a/source/funkin/play/character/AnimateAtlasCharacter.hx b/source/funkin/play/character/AnimateAtlasCharacter.hx index db862ae99..9a414decf 100644 --- a/source/funkin/play/character/AnimateAtlasCharacter.hx +++ b/source/funkin/play/character/AnimateAtlasCharacter.hx @@ -47,13 +47,13 @@ class AnimateAtlasCharacter extends BaseCharacter originalSizes.set(this.width, this.height); } - function loadAtlas() + function loadAtlas():Void { trace('[ATLASCHAR] Loading sprite atlas for ${characterId}.'); var assetLibrary:String = Paths.getLibrary(_data.assetPath); var assetPath:String = Paths.stripLibrary(_data.assetPath); - loadTextureAtlas(assetPath, assetLibrary, cast _data.atlasSettings); + loadTextureAtlas(assetPath, assetLibrary, getAtlasSettings()); if (_data.isPixel) { @@ -69,7 +69,7 @@ class AnimateAtlasCharacter extends BaseCharacter this.setScale(_data.scale); } - function loadAnimations() + function loadAnimations():Void { trace('[ATLASCHAR] Loading ${_data.animations.length} animations for ${characterId}'); @@ -100,4 +100,13 @@ class AnimateAtlasCharacter extends BaseCharacter { return originalSizes.y; } + + /** + * Get the configuration for the texture atlas. + * @return The configuration for the texture atlas. + */ + public function getAtlasSettings():AtlasSpriteSettings + { + return cast _data.atlasSettings; + } } diff --git a/source/funkin/play/character/MultiAnimateAtlasCharacter.hx b/source/funkin/play/character/MultiAnimateAtlasCharacter.hx index e9a78f001..bef4836c5 100644 --- a/source/funkin/play/character/MultiAnimateAtlasCharacter.hx +++ b/source/funkin/play/character/MultiAnimateAtlasCharacter.hx @@ -49,7 +49,7 @@ class MultiAnimateAtlasCharacter extends BaseCharacter originalSizes.set(this.width, this.height); } - function loadAtlases() + function loadAtlases():Void { trace('[MULTIATLASCHAR] Loading sprite atlases for ${characterId}.'); @@ -65,7 +65,7 @@ class MultiAnimateAtlasCharacter extends BaseCharacter var baseAssetLibrary:String = Paths.getLibrary(_data.assetPath); var baseAssetPath:String = Paths.stripLibrary(_data.assetPath); - loadTextureAtlas(baseAssetPath, baseAssetLibrary, cast _data.atlasSettings); + loadTextureAtlas(baseAssetPath, baseAssetLibrary, getAtlasSettings()); for (asset in assetList) { @@ -95,7 +95,7 @@ class MultiAnimateAtlasCharacter extends BaseCharacter this.setScale(_data.scale); } - function loadAnimations() + function loadAnimations():Void { trace('[MULTIATLASCHAR] Loading ${_data.animations.length} animations for ${characterId}'); @@ -126,4 +126,13 @@ class MultiAnimateAtlasCharacter extends BaseCharacter { return originalSizes.y; } + + /** + * Get the configuration for the texture atlas. + * @return The configuration for the texture atlas. + */ + public function getAtlasSettings():AtlasSpriteSettings + { + return cast _data.atlasSettings; + } }