Back to project page feup-lpoo-android-tower-defense.
The source code is released under:
MIT License
If you think the Android project feup-lpoo-android-tower-defense listed in this page is inappropriate, such as containing malicious code/tools or violating the copyright, please email info at java2s dot com, thanks.
package pt.up.fe.lpoo.framework.implementation; //from w w w . j av a 2 s . c o m import java.util.List; import pt.up.fe.lpoo.framework.Input; import android.content.Context; import android.os.Build.VERSION; import android.view.View; /** * Information about the implementation of the framework can be found at * http://www.kilobolt.com/day-6-the-android-game-framework-part-ii.html */ public class AndroidInput implements Input { TouchHandler touchHandler; public AndroidInput(Context context, View view, float scaleX, float scaleY) { if(VERSION.SDK_INT < 5) touchHandler = new SingleTouchHandler(view, scaleX, scaleY); else touchHandler = new MultiTouchHandler(view, scaleX, scaleY); } @Override public boolean isTouchDown(int pointer) { return touchHandler.isTouchDown(pointer); } @Override public int getTouchX(int pointer) { return touchHandler.getTouchX(pointer); } @Override public int getTouchY(int pointer) { return touchHandler.getTouchY(pointer); } @Override public List<TouchEvent> getTouchEvents() { return touchHandler.getTouchEvents(); } }