optimized text outlines (idk if we gonna keep it)

This commit is contained in:
lunarcleint
2023-10-07 18:18:34 -07:00
parent 559a308558
commit 91390b4d8b
2 changed files with 26 additions and 1 deletions
+1 -1
View File
@@ -39,7 +39,7 @@ class UISlider extends UISprite {
progressbar = new UISprite(centered ? barWidth/2 : 0);
progressbar.makeGraphic(barWidth, 8, 0x00000000, true);
progressbar.drawRoundRect(2, 0, barWidth-4, 8-.1, 8, 2, 0xFF67009B);
progressbar.drawRoundRect(2, 0, barWidth-4, 8, 8, 2, 0xFF67009B);
progressbar.origin.x = 0;
members.push(progressbar);
+25
View File
@@ -16,4 +16,29 @@ class UIText extends FunkinText {
}
this.active = false;
}
public override function applyBorderStyle() {
if (borderStyle == OUTLINE_FAST) {
var iterations:Int = Std.int(borderSize * borderQuality);
if (iterations <= 0)
{
iterations = 1;
}
var delta:Float = borderSize / iterations;
applyFormats(_formatAdjusted, true);
var curDelta:Float = delta;
for (i in 0...iterations)
{
copyTextWithOffset(-curDelta, -curDelta); // upper-left
copyTextWithOffset(curDelta * 2, curDelta * 2); // lower-right
_matrix.translate(-curDelta, -curDelta); // return to center
curDelta += delta;
}
return;
}
super.applyBorderStyle();
}
}