optimize updating text

This commit is contained in:
lunarcleint
2023-10-08 14:31:15 -07:00
parent 0ab560d2b0
commit 744b62bf5e
2 changed files with 3 additions and 2 deletions
+1 -1
View File
@@ -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);
+2 -1
View File
@@ -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)
{