Logic zoom fix
This commit is contained in:
@@ -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;
|
||||
|
||||
@@ -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();
|
||||
|
||||
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user