diff --git a/source/funkin/group/FunkinGroup.hx b/source/funkin/group/FunkinGroup.hx index 014bf0da3..664079122 100644 --- a/source/funkin/group/FunkinGroup.hx +++ b/source/funkin/group/FunkinGroup.hx @@ -20,7 +20,7 @@ class FunkinGroup extends FlxSprite /** * The children of this FunkinGroup. */ - public var children:Null>; + public var children:Array; /** * The size of this FunkinGroup. Read only. diff --git a/source/funkin/play/PauseSubState.hx b/source/funkin/play/PauseSubState.hx index 8f4e4512b..84c0b4e37 100644 --- a/source/funkin/play/PauseSubState.hx +++ b/source/funkin/play/PauseSubState.hx @@ -906,7 +906,7 @@ class PauseSubState extends MusicBeatSubState var text:AtlasText = new AtlasText(0, yPos, entry.text, AtlasFont.BOLD); text.scrollFactor.set(0, 0); text.alpha = 0; - for (letter in text) + for (letter in text.children) { letter.width *= 2; letter.height *= 2; diff --git a/source/funkin/ui/AtlasText.hx b/source/funkin/ui/AtlasText.hx index f6cc326af..de30c859a 100644 --- a/source/funkin/ui/AtlasText.hx +++ b/source/funkin/ui/AtlasText.hx @@ -2,7 +2,7 @@ package funkin.ui; import flixel.FlxSprite; import flixel.graphics.frames.FlxAtlasFrames; -import flixel.group.FlxSpriteGroup.FlxTypedSpriteGroup; +import funkin.group.FunkinGroup; import flixel.util.FlxStringUtil; /** @@ -10,7 +10,7 @@ import flixel.util.FlxStringUtil; * It supports animations on the letters, and is less buggy than Alphabet. */ @:nullSafety -class AtlasText extends FlxTypedSpriteGroup +class AtlasText extends FunkinGroup { static var fonts:Map = new Map(); static var casesAllowed:Map = new Map(); @@ -60,7 +60,7 @@ class AtlasText extends FlxTypedSpriteGroup value = caseValue; - group.kill(); + this.kill(); if (value == "") return this.text; @@ -101,16 +101,16 @@ class AtlasText extends FlxTypedSpriteGroup */ function appendTextCased(str:String):Void { - var charCount:Int = group.countLiving(); + var charCount:Int = countLiving(); var xPos:Float = 0; var yPos:Float = 0; // `countLiving` returns -1 if group is empty if (charCount == -1) charCount = 0; else if (charCount > 0) { - var lastChar:AtlasChar = group.members[charCount - 1]; - xPos = lastChar.x + lastChar.width - x; - yPos = lastChar.y + lastChar.height - maxHeight - y; + var lastChar:AtlasChar = children[charCount - 1]; + xPos = lastChar.localX + lastChar.width - x; + yPos = lastChar.localY + lastChar.height - maxHeight - y; } for (splitStr in str.split("")) @@ -124,16 +124,16 @@ class AtlasText extends FlxTypedSpriteGroup yPos += maxHeight; case char: var charSprite:AtlasChar; - if (group.members.length <= charCount) charSprite = new AtlasChar(atlas, char); + if (children.length <= charCount) charSprite = new AtlasChar(atlas, char); else { - charSprite = group.members[charCount]; + charSprite = children[charCount]; charSprite.revive(); charSprite.char = char; charSprite.alpha = 1; // gets multiplied when added } - charSprite.x = xPos; - charSprite.y = yPos + maxHeight - charSprite.height; + charSprite.localX = xPos; + charSprite.localY = yPos + maxHeight - charSprite.height; add(charSprite); xPos += charSprite.width;