From 744b62bf5e4a29c2a99636549c0ea67a891b320f Mon Sep 17 00:00:00 2001 From: lunarcleint <88809950+lunarcleint@users.noreply.github.com> Date: Sun, 8 Oct 2023 14:31:15 -0700 Subject: [PATCH] optimize updating text --- source/funkin/editors/charter/Charter.hx | 2 +- source/funkin/editors/ui/UIText.hx | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/source/funkin/editors/charter/Charter.hx b/source/funkin/editors/charter/Charter.hx index 9e19bc10..d464b3e3 100644 --- a/source/funkin/editors/charter/Charter.hx +++ b/source/funkin/editors/charter/Charter.hx @@ -373,7 +373,7 @@ class Charter extends UIState { uiGroup.add(scrollBar); songPosInfo = new UIText(FlxG.width - 30 - 400, scrollBar.y + 10, 400, "00:00\nBeat: 0\nStep: 0\nMeasure: 0\nBPM: 0\nTime Signature: 4/4"); - songPosInfo.alignment = RIGHT; + songPosInfo.alignment = RIGHT; songPosInfo.optimized = true; uiGroup.add(songPosInfo); playBackSlider = new UISlider(FlxG.width - 160 - 26 - 20, (23/2) - (12/2), 160, 1, [{start: 0.25, end: 1, size: 0.5}, {start: 1, end: 2, size: 0.5}], true); diff --git a/source/funkin/editors/ui/UIText.hx b/source/funkin/editors/ui/UIText.hx index dc5b5535..83daab60 100644 --- a/source/funkin/editors/ui/UIText.hx +++ b/source/funkin/editors/ui/UIText.hx @@ -4,6 +4,7 @@ import flixel.util.FlxColor; import funkin.backend.FunkinText; class UIText extends FunkinText { + public var optimized:Bool = false; // PUTTING THIS HERE IN CASE IMMA MAKE FUTURE CHANGES public function new(x, y, w, text, size:Int = 15, color:FlxColor = 0xFFFFFFFF, ?outline:Bool = true) { super(x, y, w, text, size, false); @@ -18,7 +19,7 @@ class UIText extends FunkinText { } public override function applyBorderStyle() { - if (borderStyle == OUTLINE_FAST) { + if (borderStyle == OUTLINE_FAST && optimized) { var iterations:Int = Std.int(borderSize * borderQuality); if (iterations <= 0) {