I got a problem with my touchlistener and actually dont get it work correctly.
@Override
public boolean onTouchEvent(MotionEvent event) {
touchControll.processTouchEvent(event); //should do everything!
invalidate();
return true;
}
The Methode processTouchevent simply take the event watch where it was and handles it. So if the touch was inside of the Joypad it handles the joypad "actions". But if i want to handle a hitButton event now it dont react.
Example
public void processHitButtonTouch(MotionEvent event){
int touchPosX = (int) event.getX();
int touchPosY = (int) event.getY();
if(event.getAction() == MotionEvent.ACTION_DOWN)
if(touchPosX > Config.BLOCKSIZE*37 && touchPosY > Config.BLOCKSIZE*3 && touchPosY < Config.BLOCKSIZE*7){
this.hitButton.buttonStatus = Pressed.PRESSED;
}
}
on every MotionEvent.ACTION_UP i resett the whole stuff like this:
if(event.getAction() == MotionEvent.ACTION_UP){
joyPad.status = Status.IDLE;
charac.setStatus(Status.IDLE);
this.hitButton.buttonStatus = Pressed.UNPRESSED;
}
I tied if it actually handles more than 1 event with the Loggincat and it does (2 touch 2 times downevent logged!). But it simply dont work like i did it here. What have i done wrong?!
Thanks alot for the help!