开发者

How to implements touch listerner continuous like keyReapted (Andengine)

I implements IOnSceneTouchListener and override method in class and i implements in scene

  scene.setTouchAreaBindingEnabled(true);

  scene.setOnSceneTouchListener(this);          

public boolean onSceneTouchEvent(Scene pScene, TouchEvent pSceneTouchEvent) {

Log.v("TouchEvent X",""+pSceneTouchEvent.getX());
L开发者_运维技巧og.v("TouchEvent Y",""+pSceneTouchEvent.getY());

return true;
}

and i able to get x any y position for every touch. How i get x and y postion for continuous touch


If by continuous you mean dragging/sliding over the screen, then you need to implement GestureListener. And measure initial .getX(), getY() and final getX(),getY()coordinates, since it allows you two MotionEvents.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜