Logic zoom fix

This commit is contained in:
Anuken
2022-02-12 14:36:48 -05:00
parent ee4b8c77e4
commit bad2e017d0
3 changed files with 11 additions and 2 deletions

View File

@@ -158,7 +158,13 @@ public class Renderer implements ApplicationListener{
public void update(){
Color.white.set(1f, 1f, 1f, 1f);
float dest = Mathf.clamp(Mathf.round(targetscale, 0.5f), minScale(), maxScale());
float baseTarget = targetscale;
if(control.input.logicCutscene){
baseTarget = Mathf.lerp(minZoom, maxZoom, control.input.logicCutsceneZoom);
}
float dest = Mathf.clamp(Mathf.round(baseTarget, 0.5f), minScale(), maxScale());
camerascale = Mathf.lerpDelta(camerascale, dest, 0.1f);
if(Mathf.equal(camerascale, dest, 0.001f)) camerascale = dest;
laserOpacity = settings.getInt("lasersopacity") / 100f;

View File

@@ -57,6 +57,7 @@ public abstract class InputHandler implements InputProcessor, GestureListener{
public boolean logicCutscene;
public Vec2 logicCamPan = new Vec2();
public float logicCamSpeed = 0.1f;
public float logicCutsceneZoom = -1f;
/** If any of these functions return true, input is locked. */
public Seq<Boolp> inputLocks = Seq.with(() -> renderer.isCutscene(), () -> logicCutscene);
@@ -583,6 +584,8 @@ public abstract class InputHandler implements InputProcessor, GestureListener{
public void update(){
if(logicCutscene && !renderer.isCutscene()){
Core.camera.position.lerpDelta(logicCamPan, logicCamSpeed);
}else{
logicCutsceneZoom = -1f;
}
playerPlanTree.clear();

View File

@@ -1145,7 +1145,7 @@ public class LExecutor{
}
case zoom -> {
control.input.logicCutscene = true;
renderer.setScale(Mathf.lerp(renderer.minZoom, renderer.maxZoom, Mathf.clamp(exec.numf(p1))));
control.input.logicCutsceneZoom = Mathf.clamp(exec.numf(p1));
}
case stop -> {
control.input.logicCutscene = false;