2012년 2월 8일 수요일

onTouch() cannot differ views for multitouch

For few days, i was trying to apply multitouch on my application(game). My application uses multiple views and I want that the user can touch each view at the same time.
my code for single touch was...

onTouch(Veiw v, MotionEvent event){
    if(v==button1){
        ....
    } else if(v==button2){
        ......
    }

}

this style worked for single touch perfectly. So I could never doubt this won't differ the view I touched secondly(and more). But this method couldn't.

I'm not very well skilled programmer so not sure about there would be my fault. but for the if anybody has the same problem, just use "onTouchEvent(MotionEvent event)" and classify view by the position.

댓글 없음:

댓글 쓰기

function foo()
{
}