From 9571eb70e0edec7700e00f32ebf4e7c9c06ffa06 Mon Sep 17 00:00:00 2001 From: Cameron Taylor Date: Fri, 4 Aug 2023 16:19:48 -0400 Subject: [PATCH] scaling of capsules --- source/funkin/FreeplayState.hx | 2 +- source/funkin/freeplayStuff/SongMenuItem.hx | 10 +++++++++- 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/source/funkin/FreeplayState.hx b/source/funkin/FreeplayState.hx index c7ae49893..012b6290a 100644 --- a/source/funkin/FreeplayState.hx +++ b/source/funkin/FreeplayState.hx @@ -974,7 +974,7 @@ class FreeplayState extends MusicBeatSubState capsule.selected = false; - capsule.targetPos.y = ((index - curSelected) * 150) + 160; + capsule.targetPos.y = ((index - curSelected) * ((capsule.height * capsule.realScaled) + 10)) + 160; capsule.targetPos.x = 270 + (60 * (Math.sin(index - curSelected))); // capsule.targetPos.x = 320 + (40 * (index - curSelected)); diff --git a/source/funkin/freeplayStuff/SongMenuItem.hx b/source/funkin/freeplayStuff/SongMenuItem.hx index 37198f6d7..cccd84c98 100644 --- a/source/funkin/freeplayStuff/SongMenuItem.hx +++ b/source/funkin/freeplayStuff/SongMenuItem.hx @@ -38,7 +38,7 @@ class SongMenuItem extends FlxSpriteGroup // capsule.animation add(capsule); - songText = new FlxText(120, 40, 0, songTitle, 40); + songText = new FlxText(capsule.width * 0.1, 40, 0, songTitle, Std.int(40 * realScaled)); songText.font = "5by7"; songText.color = 0xFF43C1EA; add(songText); @@ -63,6 +63,8 @@ class SongMenuItem extends FlxSpriteGroup var xPosLerpLol:Array = [0.9, 0.4, 0.16, 0.16, 0.22, 0.22, 0.245]; // NUMBERS ARE JANK CUZ THE SCALING OR WHATEVER var xPosOutLerpLol:Array = [0.245, 0.75, 0.98, 0.98, 1.2]; // NUMBERS ARE JANK CUZ THE SCALING OR WHATEVER + public final realScaled:Float = 0.8; + override function update(elapsed:Float) { if (doJumpIn) @@ -77,6 +79,9 @@ class SongMenuItem extends FlxSpriteGroup scale.y = 1 / xFrames[frameInTypeBeat]; x = FlxG.width * xPosLerpLol[Std.int(Math.min(frameInTypeBeat, xPosLerpLol.length - 1))]; + scale.x *= realScaled; + scale.y *= realScaled; + frameInTypeBeat += 1; } } @@ -93,6 +98,9 @@ class SongMenuItem extends FlxSpriteGroup scale.y = 1 / xFrames[frameOutTypeBeat]; x = FlxG.width * xPosOutLerpLol[Std.int(Math.min(frameOutTypeBeat, xPosOutLerpLol.length - 1))]; + scale.x *= realScaled; + scale.y *= realScaled; + frameOutTypeBeat += 1; } }