Persistent player spectating on desktop
This commit is contained in:
@@ -779,7 +779,11 @@ public class MobileInput extends InputHandler implements GestureListener{
|
||||
if(!Core.settings.getBool("keyboard") && !locked && !scene.hasKeyboard()){
|
||||
//move camera around
|
||||
float camSpeed = 6f;
|
||||
Core.camera.position.add(Tmp.v1.setZero().add(Core.input.axis(Binding.move_x), Core.input.axis(Binding.move_y)).nor().scl(Time.delta * camSpeed));
|
||||
Vec2 delta = Tmp.v1.setZero().add(Core.input.axis(Binding.move_x), Core.input.axis(Binding.move_y)).nor().scl(Time.delta * camSpeed);
|
||||
Core.camera.position.add(delta);
|
||||
if(!delta.isZero()){
|
||||
spectating = null;
|
||||
}
|
||||
}
|
||||
|
||||
if(Core.settings.getBool("keyboard")){
|
||||
@@ -940,6 +944,7 @@ public class MobileInput extends InputHandler implements GestureListener{
|
||||
//pan player
|
||||
Core.camera.position.x -= deltaX;
|
||||
Core.camera.position.y -= deltaY;
|
||||
spectating = null;
|
||||
}
|
||||
|
||||
camera.position.clamp(-camera.width/4f, -camera.height/4f, world.unitWidth() + camera.width/4f, world.unitHeight() + camera.height/4f);
|
||||
|
||||
Reference in New Issue
Block a user