1
0
mirror of https://github.com/Anuken/Mindustry.git synced 2024-11-11 03:31:19 +03:00

Fixed minor bug with camera panning out of bounds

This commit is contained in:
Anuken 2017-06-29 15:06:24 -04:00
parent bca8271c07
commit ec0aa2d2f3
3 changed files with 10 additions and 3 deletions

View File

@ -13,6 +13,7 @@ import io.anuke.mindustry.input.GestureHandler;
import io.anuke.mindustry.input.Input;
import io.anuke.mindustry.world.Generator;
import io.anuke.mindustry.world.blocks.ProductionBlocks;
import io.anuke.ucore.UCore;
import io.anuke.ucore.core.*;
import io.anuke.ucore.entities.Entities;
import io.anuke.ucore.graphics.Atlas;
@ -23,7 +24,6 @@ import io.anuke.ucore.util.Timers;
public class Control extends RendererModule{
public int rangex = 10, rangey = 10;
public float targetzoom = 1f;
private float targetx, targety;
//GifRecorder recorder = new GifRecorder(batch);
public Control(){
@ -148,8 +148,15 @@ public class Control extends RendererModule{
}
updateShake();
float prevx = camera.position.x, prevy = camera.position.y;
clampCamera(-tilesize / 2f, -tilesize / 2f, pixsize - tilesize / 2f, pixsize - tilesize / 2f);
if(android){
UCore.log(camera.position.x-prevx, camera.position.y-prevy);
player.x += camera.position.x-prevx;
player.y += camera.position.y-prevy;
}
float lastx = camera.position.x, lasty = camera.position.y;
if(android){

View File

@ -104,6 +104,8 @@ public class AndroidInput extends InputAdapter{
Tile sel = selected();
if(sel == null) return;
if(warmup > warmupDelay && sel.block() != ProductionBlocks.core && sel.breakable()){
breaktime += Mathf.delta();

View File

@ -45,8 +45,6 @@ public class GestureHandler extends GestureAdapter{
return false;
}
@Override
public boolean pinch (Vector2 initialPointer1, Vector2 initialPointer2, Vector2 pointer1, Vector2 pointer2) {
if(recipe == null)