support du tactile
This commit is contained in:
@@ -7,6 +7,7 @@ import android.content.pm.ActivityInfo;
|
||||
import android.graphics.Point;
|
||||
import android.os.Bundle;
|
||||
import android.view.Display;
|
||||
import android.view.MotionEvent;
|
||||
|
||||
import com.iutlaval.myapplication.Game.GameLogicThread;
|
||||
import com.iutlaval.myapplication.Video.FpsTime;
|
||||
@@ -14,6 +15,8 @@ import com.iutlaval.myapplication.Video.Renderer;
|
||||
|
||||
public class GameActivity extends Activity {
|
||||
|
||||
private static GameLogicThread gameEngine;
|
||||
|
||||
public static int screenWidth=0;
|
||||
public static int screenHeight=0;
|
||||
public static boolean bilinearFiltering = true;
|
||||
@@ -22,6 +25,7 @@ public class GameActivity extends Activity {
|
||||
return false;//TODO implement it
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
protected void onCreate(Bundle savedInstanceState) {
|
||||
super.onCreate(savedInstanceState);
|
||||
@@ -48,10 +52,24 @@ public class GameActivity extends Activity {
|
||||
screenHeight = size.y;
|
||||
}
|
||||
|
||||
GameLogicThread gameEngine = new GameLogicThread(this,renderer);
|
||||
gameEngine = new GameLogicThread(this,renderer);
|
||||
gameEngine.start();
|
||||
|
||||
setContentView(renderer);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean onTouchEvent(MotionEvent event) {
|
||||
if(gameEngine != null)gameEngine.onTouchEvent(event);
|
||||
System.out.println(event.getX());
|
||||
return super.onTouchEvent(event);
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean onGenericMotionEvent(MotionEvent event) {
|
||||
System.out.println(event.getX());
|
||||
return super.onGenericMotionEvent(event);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user