v0.4.3: implemented a new 'Power Saver' mode

As a bonus, this allows shattered to run on small screen devices, by forcing power saver, which downsamples in this specific case allowing for the minimum 2x game scale.
This commit is contained in:
Evan Debenham
2016-09-30 04:30:24 -04:00
parent 8591a0b3dc
commit debbb57066
9 changed files with 138 additions and 27 deletions

View File

@@ -24,6 +24,7 @@ package com.watabou.input;
import java.util.ArrayList;
import java.util.HashMap;
import com.watabou.noosa.Game;
import com.watabou.utils.PointF;
import com.watabou.utils.Signal;
@@ -96,6 +97,9 @@ public class Touchscreen {
float x = e.getX( index );
float y = e.getY( index );
x /= (Game.dispWidth / (float)Game.width);
y /= (Game.dispHeight / (float)Game.height);
start = new PointF( x, y );
current = new PointF( x, y );
@@ -104,7 +108,13 @@ public class Touchscreen {
}
public void update( MotionEvent e, int index ) {
current.set( e.getX( index ), e.getY( index ) );
float x = e.getX( index );
float y = e.getY( index );
x /= (Game.dispWidth / (float)Game.width);
y /= (Game.dispHeight / (float)Game.height);
current.set( x, y );
}
public Touch up() {