This commit is contained in:
MtH 2021-04-08 23:29:31 +02:00
parent ab6cd0e34e
commit 662711b787

View file

@ -36,6 +36,7 @@ class FreeplayState extends MusicBeatState
private var iconArray:Array<HealthIcon> = [];
var bg:FlxSprite;
var scoreBG:FlxSprite;
override function create()
{
@ -118,7 +119,8 @@ class FreeplayState extends MusicBeatState
scoreText.setFormat(Paths.font("vcr.ttf"), 32, FlxColor.WHITE, RIGHT);
// scoreText.alignment = RIGHT;
var scoreBG:FlxSprite = new FlxSprite(scoreText.x - 6, 0).makeGraphic(Std.int(FlxG.width * 0.3), 66, 0xFF000000);
scoreBG = new FlxSprite(scoreText.x - 6, 0).makeGraphic(1, 66, 0xFF000000);
scoreBG.antialiasing = false;
scoreBG.alpha = 0.6;
add(scoreBG);
@ -201,6 +203,8 @@ class FreeplayState extends MusicBeatState
scoreText.text = "PERSONAL BEST:" + lerpScore;
positionHighscore();
var upP = controls.UI_UP_P;
var downP = controls.UI_DOWN_P;
var accepted = controls.ACCEPT;
@ -254,8 +258,7 @@ class FreeplayState extends MusicBeatState
PlayState.storyDifficulty = curDifficulty;
diffText.text = "< " + CoolUtil.difficultyString() + " >";
diffText.x = FlxG.width * 0.85;
diffText.x -= (diffText.width / 2);
positionHighscore();
}
function changeSelection(change:Int = 0)
@ -305,6 +308,16 @@ class FreeplayState extends MusicBeatState
}
}
}
function positionHighscore()
{
scoreText.x = FlxG.width - scoreText.width - 6;
scoreBG.scale.x = FlxG.width - scoreText.x + 6;
scoreBG.x = FlxG.width - scoreBG.scale.x / 2;
diffText.x = Std.int(scoreBG.x + scoreBG.width / 2);
diffText.x -= (diffText.width / 2);
}
}
class SongMetadata