mirror of
https://github.com/FunkinCrew/Funkin.git
synced 2024-12-11 16:51:21 -05:00
Merge branch 'camera-helpies' into rewrite/master
This commit is contained in:
commit
55c5e01bd5
2 changed files with 43 additions and 26 deletions
|
@ -503,6 +503,12 @@ class PlayState extends MusicBeatSubState
|
|||
*/
|
||||
public var camGame:FlxCamera;
|
||||
|
||||
/**
|
||||
* Simple helper debug variable, to be able to move the camera around for debug purposes
|
||||
* without worrying about the camera tweening back to the follow point.
|
||||
*/
|
||||
public var debugUnbindCameraZoom:Bool = false;
|
||||
|
||||
/**
|
||||
* The camera which contains, and controls visibility of, a video cutscene, dialogue, pause menu and sticker transition.
|
||||
*/
|
||||
|
@ -992,7 +998,7 @@ class PlayState extends MusicBeatSubState
|
|||
{
|
||||
cameraBopMultiplier = FlxMath.lerp(1.0, cameraBopMultiplier, 0.95); // Lerp bop multiplier back to 1.0x
|
||||
var zoomPlusBop = currentCameraZoom * cameraBopMultiplier; // Apply camera bop multiplier.
|
||||
FlxG.camera.zoom = zoomPlusBop; // Actually apply the zoom to the camera.
|
||||
if (!debugUnbindCameraZoom) FlxG.camera.zoom = zoomPlusBop; // Actually apply the zoom to the camera.
|
||||
|
||||
camHUD.zoom = FlxMath.lerp(defaultHUDCameraZoom, camHUD.zoom, 0.95);
|
||||
}
|
||||
|
@ -1458,6 +1464,13 @@ class PlayState extends MusicBeatSubState
|
|||
super.destroy();
|
||||
}
|
||||
|
||||
public override function initConsoleHelpers():Void
|
||||
{
|
||||
FlxG.console.registerFunction("debugUnbindCameraZoom", () -> {
|
||||
debugUnbindCameraZoom = !debugUnbindCameraZoom;
|
||||
});
|
||||
};
|
||||
|
||||
/**
|
||||
* Initializes the game and HUD cameras.
|
||||
*/
|
||||
|
|
|
@ -56,6 +56,8 @@ class MusicBeatSubState extends FlxSubState implements IEventHandler
|
|||
|
||||
Conductor.beatHit.add(this.beatHit);
|
||||
Conductor.stepHit.add(this.stepHit);
|
||||
|
||||
initConsoleHelpers();
|
||||
}
|
||||
|
||||
public override function destroy():Void
|
||||
|
@ -79,6 +81,8 @@ class MusicBeatSubState extends FlxSubState implements IEventHandler
|
|||
dispatchEvent(new UpdateScriptEvent(elapsed));
|
||||
}
|
||||
|
||||
public function initConsoleHelpers():Void {}
|
||||
|
||||
function reloadAssets()
|
||||
{
|
||||
PolymodHandler.forceReloadAssets();
|
||||
|
|
Loading…
Reference in a new issue