Skip to content

Commit

Permalink
snapCamera arg
Browse files Browse the repository at this point in the history
adds new arg to resetCamera func
  • Loading branch information
PurSnake authored Jun 9, 2024
1 parent eb979a8 commit 3202391
Showing 1 changed file with 3 additions and 6 deletions.
9 changes: 3 additions & 6 deletions source/funkin/play/PlayState.hx
Original file line number Diff line number Diff line change
Expand Up @@ -3172,24 +3172,21 @@ class PlayState extends MusicBeatSubState
/**
* Resets the camera's zoom level and focus point.
*/
public function resetCamera(?resetZoom:Bool = true, ?cancelTweens:Bool = true):Void
public function resetCamera(?resetZoom:Bool = true, ?cancelTweens:Bool = true, ?snapCamera:Bool = true):Void
{
// Cancel camera tweens if any are active.
if (cancelTweens)
{
cancelAllCameraTweens();
}

FlxG.camera.follow(cameraFollowPoint, LOCKON, Constants.DEFAULT_CAMERA_FOLLOW_RATE);
FlxG.camera.targetOffset.set();

if (resetZoom)
{
resetCameraZoom();
}

// Snap the camera to the follow point immediately.
FlxG.camera.focusOn(cameraFollowPoint.getPosition());
if (snapCamera)
FlxG.camera.focusOn(cameraFollowPoint.getPosition());
}

/**
Expand Down

0 comments on commit 3202391

Please sign in to comment.