Skip to content

Commit

Permalink
Merge pull request #520 from FunkinCrew/ui+camera-fixes
Browse files Browse the repository at this point in the history
UI+Camera fixes
  • Loading branch information
EliteMasterEric authored Apr 29, 2024
2 parents 24a58b3 + 333b177 commit 347b1b5
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 6 deletions.
2 changes: 1 addition & 1 deletion assets
4 changes: 2 additions & 2 deletions source/funkin/play/components/PopUpStuff.hx
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ class PopUpStuff extends FlxTypedGroup<FlxSprite>

if (PlayState.instance.currentStageId.startsWith('school'))
{
rating.setGraphicSize(Std.int(rating.width * Constants.PIXEL_ART_SCALE * 0.65));
rating.setGraphicSize(Std.int(rating.width * Constants.PIXEL_ART_SCALE * 0.7));
rating.antialiasing = false;
}
else
Expand Down Expand Up @@ -133,7 +133,7 @@ class PopUpStuff extends FlxTypedGroup<FlxSprite>

if (PlayState.instance.currentStageId.startsWith('school'))
{
numScore.setGraphicSize(Std.int(numScore.width * Constants.PIXEL_ART_SCALE));
numScore.setGraphicSize(Std.int(numScore.width * Constants.PIXEL_ART_SCALE * 0.7));
numScore.antialiasing = false;
}
else
Expand Down
2 changes: 1 addition & 1 deletion source/funkin/play/event/FocusCameraSongEvent.hx
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,7 @@ class FocusCameraSongEvent extends SongEvent
switch (ease)
{
case 'CLASSIC': // Old-school. No ease. Just set follow point.
PlayState.instance.resetCamera();
PlayState.instance.resetCamera(false, true);
PlayState.instance.cameraFollowPoint.setPosition(targetX, targetY);
case 'INSTANT': // Instant ease. Duration is automatically 0.
PlayState.instance.tweenCameraToPosition(targetX, targetY, 0);
Expand Down
8 changes: 6 additions & 2 deletions source/funkin/ui/options/FunkinSoundTray.hx
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ class FunkinSoundTray extends FlxSoundTray
{
var graphicScale:Float = 0.30;
var lerpYPos:Float = 0;
var alphaTarget:Float = 0;

var volumeMaxSound:String;

Expand All @@ -40,7 +41,7 @@ class FunkinSoundTray extends FlxSoundTray

// makes an alpha'd version of all the bars (bar_10.png)
var backingBar:Bitmap = new Bitmap(Assets.getBitmapData(Paths.image("soundtray/bars_10")));
backingBar.x = 10;
backingBar.x = 9;
backingBar.y = 5;
backingBar.scaleX = graphicScale;
backingBar.scaleY = graphicScale;
Expand All @@ -56,7 +57,7 @@ class FunkinSoundTray extends FlxSoundTray
for (i in 1...11)
{
var bar:Bitmap = new Bitmap(Assets.getBitmapData(Paths.image("soundtray/bars_" + i)));
bar.x = 10;
bar.x = 9;
bar.y = 5;
bar.scaleX = graphicScale;
bar.scaleY = graphicScale;
Expand All @@ -77,15 +78,18 @@ class FunkinSoundTray extends FlxSoundTray
override public function update(MS:Float):Void
{
y = MathUtil.coolLerp(y, lerpYPos, 0.1);
alpha = MathUtil.coolLerp(alpha, alphaTarget, 0.25);

// Animate sound tray thing
if (_timer > 0)
{
_timer -= (MS / 1000);
alphaTarget = 1;
}
else if (y > -height)
{
lerpYPos = -height - 10;
alphaTarget = 0;

if (y <= -height)
{
Expand Down

0 comments on commit 347b1b5

Please sign in to comment.