Movment and camera rotation with multitouch

Paste down any little snippets or request a new one.

Movment and camera rotation with multitouch

Postby bazsem » 2016-11-10 21:46

HI all :D , I need some help or advice :roll:
I used onCameraMove() to rotatet camera and few hud buttons for moving foward, right , left and back.So on android, when i touch the hud button , i cant rotate camera. I know that when i touch screen start working onCameraMove().I want to make like ,you toch a button , start moving and you can move camera with another finger. Can i make It whithout onTouchSequenceChange() or it not possible.
bazsem
Fresh Boarder
Fresh Boarder
 
Posts: 7
Joined: 2016-08-04 15:18

Re: Movment and camera rotation with multitouch

Postby broozar » 2016-11-10 23:37

not possible without touch sequence handlers - that's what they are for after all :)
User avatar
broozar
Administrator
Administrator
 
Posts: 4172
Joined: 2007-09-16 10:22
Location: Berlin - Germany

Re: Movment and camera rotation with multitouch

Postby bazsem » 2016-11-10 23:48

So if not possible then can you please explain how i can get deltaX and deltaY(like in onMouseMove ) from nX0 , nY0 from touch sequence handlers
or how i can manipulate camera with nX0 , nY0
bazsem
Fresh Boarder
Fresh Boarder
 
Posts: 7
Joined: 2016-08-04 15:18

Re: Movment and camera rotation with multitouch

Postby broozar » 2016-11-11 00:11

- make 2 ai member variables, like this.nX0last() and this.nX0last()
- in the touch sequence handler, compare nX0 minus this.nX0last(), that's your delta
- at the end of the handler, store the current position in the member variable, like this.nX0last(nX0)

you might need to verify that nTaps0(1,2,...) ~= -1, otherwise you might get "jumps" when you put your fingers on the screen.
User avatar
broozar
Administrator
Administrator
 
Posts: 4172
Joined: 2007-09-16 10:22
Location: Berlin - Germany


Return to Code Snippets

Who is online

Users browsing this forum: No registered users and 2 guests

cron