mirror of
https://github.com/FunkinCrew/Funkin.git
synced 2024-11-22 15:48:08 -05:00
check clip width when text changes
This commit is contained in:
parent
cd85bcf222
commit
84d4d044d6
2 changed files with 17 additions and 5 deletions
|
@ -58,12 +58,24 @@ class CapsuleText extends FlxSpriteGroup
|
|||
function set_clipWidth(value:Int):Int
|
||||
{
|
||||
resetText();
|
||||
if (whiteText.width > value)
|
||||
checkClipWidth(value);
|
||||
return clipWidth = value;
|
||||
}
|
||||
|
||||
/**
|
||||
* Checks if the text if it's too long, and clips if it is
|
||||
* @param wid
|
||||
*/
|
||||
function checkClipWidth(?wid:Int):Void
|
||||
{
|
||||
if (wid == null) wid = clipWidth;
|
||||
|
||||
if (whiteText.width > wid)
|
||||
{
|
||||
tooLong = true;
|
||||
|
||||
blurredText.clipRect = new FlxRect(0, 0, value, blurredText.height);
|
||||
whiteText.clipRect = new FlxRect(0, 0, value, whiteText.height);
|
||||
blurredText.clipRect = new FlxRect(0, 0, wid, blurredText.height);
|
||||
whiteText.clipRect = new FlxRect(0, 0, wid, whiteText.height);
|
||||
}
|
||||
else
|
||||
{
|
||||
|
@ -72,7 +84,6 @@ class CapsuleText extends FlxSpriteGroup
|
|||
blurredText.clipRect = null;
|
||||
whiteText.clipRect = null;
|
||||
}
|
||||
return clipWidth = value;
|
||||
}
|
||||
|
||||
function set_text(value:String):String
|
||||
|
@ -86,6 +97,7 @@ class CapsuleText extends FlxSpriteGroup
|
|||
|
||||
blurredText.text = value;
|
||||
whiteText.text = value;
|
||||
checkClipWidth();
|
||||
whiteText.textField.filters = [
|
||||
new openfl.filters.GlowFilter(0x00ccff, 1, 5, 5, 210, BitmapFilterQuality.MEDIUM),
|
||||
// new openfl.filters.BlurFilter(5, 5, BitmapFilterQuality.LOW)
|
||||
|
|
|
@ -326,7 +326,7 @@ class SongMenuItem extends FlxSpriteGroup
|
|||
|
||||
var evilTrail:FlxTrail;
|
||||
|
||||
public function fadeAnim()
|
||||
public function fadeAnim():Void
|
||||
{
|
||||
impactThing = new FunkinSprite(0, 0);
|
||||
impactThing.frames = capsule.frames;
|
||||
|
|
Loading…
Reference in a new issue