-
Notifications
You must be signed in to change notification settings - Fork 2.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Target Zoom for Cameras in PlayState #15775
base: main
Are you sure you want to change the base?
Target Zoom for Cameras in PlayState #15775
Conversation
im thinking of doing smth like this public var lerpZoom:Bool = true;
public var zoomDecay:Float = 1;
override function update(elapsed:Float) {
super.update(elapsed);
zoom = FlxMath.lerp(targetZoom, zoom, Math.exp(-elapsed * 3.125 * zoomDecay * (FlxG.state is PlayState ? PlayState.instance.playbackRate : 1)));
} in |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
cmd saying:
return camGame.targetZoom = defaultCamZoom = value;
_________________________________ ^^^^^^^^^^^^__________
| This field cannot be accessed because it is not a real variable
public var defaultCamZoom(get, set):Float;
^^^^^^^^^^^^^^^^^^^^^^^^^^^
| Add @:isVar here to enable it
add "@:isVar" over "public var defaultCamZoom(get, set):Float;" |
Called from states.PlayState::set_camZoomingDecay states/PlayState.hx line 165 |
@2JENO yo, didnt see this comment. Sorry for the late response. I'll get into this when I'm return home 👻 |
cameras in playstate now uses
PsychCamera
which now has thetargetZoom
field that can be used to manipulate default camera zooms for the hud camera and game camera (defaultCamZoom still works for camGame) but this is mostly done to add the "defaultCamZoom" logic to other cameras.