Just track them with those to variables you can access at any time.
Coder, video game industry veteran (since the '80s, ❤'s assembler), arrested - never convicted hacker (in the '90s), dad of five, he/him (if that even matters!). https://deluxepixel.com
The use case is that I am allowing an animation to be fast forwarded if the screen is pressed. This works, but if the player is already pressing the screen when I add the event listeners, they have to release then tap again for the fast forward to trigger. I'd like to check if any touches are active before I add the event listeners, so I can start the fast forward "on the fly".
Of course I could always be listening to the touches, but wondered if Gideros keeps the touches somewhere without my adding the event listener?
The use case is that I am allowing an animation to be fast forwarded if the screen is pressed. This works, but if the player is already pressing the screen when I add the event listeners, they have to release then tap again for the fast forward to trigger. I'd like to check if any touches are active before I add the event listeners, so I can start the fast forward "on the fly".
Of course I could always be listening to the touches, but wondered if Gideros keeps the touches somewhere without my adding the event listener?
(I'm not sure if it helps, probably I didn't understand your question correctly) http://docs.giderosmobile.com/reference/gideros/Sprite/Event.TOUCHES_BEGIN touch.id: (number) the id of current touch. This number is 1 if this is a first touch, 2 if it is a second, etc. allTouches: (table) lua table containing previously described touch table with x, y, rx, ry and id properties for all touches that are currently on device.
> Newcomers roadmap: from where to start learning Gideros "What one programmer can do in one month, two programmers can do in two months." - Fred Brooks “The more you do coding stuff, the better you get at it.” - Aristotle (322 BC)
> Newcomers roadmap: from where to start learning Gideros "What one programmer can do in one month, two programmers can do in two months." - Fred Brooks “The more you do coding stuff, the better you get at it.” - Aristotle (322 BC)
Add the events to the stage at the beginning of your code - have them always active.
Coder, video game industry veteran (since the '80s, ❤'s assembler), arrested - never convicted hacker (in the '90s), dad of five, he/him (if that even matters!). https://deluxepixel.com
you have to write your own touch managment like @SinisterSoft says, it's not hard. it's a design choice of gideros, similar to other game-oriented event-based apis.
As @SinisterSoft said, just have the event listener present from the start. You could have a flag called animPlaying maybe and then check that and if true fast forward the animation.
btw i think it would be a more expected/natural behaviour that you need to touch the screen after the anim starts to fastforward, as otherwise the user can easily ffd accidentally by having already touched the screen when the anim starts.
Comments
https://play.google.com/store/apps/developer?id=razorback456
мій блог по гідерос https://simartinfo.blogspot.com
Слава Україні!
https://deluxepixel.com
Of course I could always be listening to the touches, but wondered if Gideros keeps the touches somewhere without my adding the event listener?
http://docs.giderosmobile.com/reference/gideros/Sprite/Event.TOUCHES_BEGIN
touch.id: (number) the id of current touch. This number is 1 if this is a first touch, 2 if it is a second, etc.
allTouches: (table) lua table containing previously described touch table with x, y, rx, ry and id properties for all touches that are currently on device.
Likes: oleg
"What one programmer can do in one month, two programmers can do in two months." - Fred Brooks
“The more you do coding stuff, the better you get at it.” - Aristotle (322 BC)
duplicate comment"What one programmer can do in one month, two programmers can do in two months." - Fred Brooks
“The more you do coding stuff, the better you get at it.” - Aristotle (322 BC)
https://deluxepixel.com
Fragmenter - animated loop machine and IKONOMIKON - the memory game
Fragmenter - animated loop machine and IKONOMIKON - the memory game
Likes: antix