Stop inputs while animating (mobile)
Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller, robinmiller
Stop inputs while animating (mobile)
How do you stop Livecode from accepting input (such as mouseDown or dragging) while something is animating?
-
- Livecode Opensource Backer
- Posts: 9454
- Joined: Fri Feb 19, 2010 10:17 am
- Location: Bulgaria
Re: Stop inputs while animating (mobile)
This should be a general question not just confined to
mobile platforms.
mobile platforms.
Re: Stop inputs while animating (mobile)
Hi ..Miami !
https://livecode.fandom.com/wiki/Lock_screen
I'm using this, meanwhile LC processes a loop based on some input :
* I would beleive it stops user from changing an input value meanwhile the stack is processing the loop - but I'm no expert.
I've just reused this code from some other script.
..dont know if it can "freeze" a mouse behavior
only cats do indeed
Terii
https://livecode.fandom.com/wiki/Lock_screen
I'm using this, meanwhile LC processes a loop based on some input :
* I would beleive it stops user from changing an input value meanwhile the stack is processing the loop - but I'm no expert.
I've just reused this code from some other script.
..dont know if it can "freeze" a mouse behavior
only cats do indeed
Terii
-
- Livecode Opensource Backer
- Posts: 9454
- Joined: Fri Feb 19, 2010 10:17 am
- Location: Bulgaria
Re: Stop inputs while animating (mobile)
Um, but using lockscreen will mean that the animation is hidden . . .
Re: Stop inputs while animating (mobile)
Lockscreen is dead in the water. Skips the animation, unfortunately.
Re: Stop inputs while animating (mobile)
I ususally put an opaque graphic on top of my interface and an top of THAT I can animate,
let the user select something or anything where user interaction is not wanted.
Know what I mean?
The graphic just "eats" all mouse-events.
let the user select something or anything where user interaction is not wanted.
Know what I mean?
The graphic just "eats" all mouse-events.
Re: Stop inputs while animating (mobile)
Thanks- Klaus you did inspire me to come up with the following solution. The problem is that when a grc is "not opaque" (i.e., transparent), it loses its ability to "eat" the mouseUp commands. So, keep it opaque and set its transparency to 100%. Put the grc over the animation and ... voila:
Code: Select all
on mouseUp
enable grc "overlay" of cd "display"
animateObject
disable grc "overlay" of cd "display"
end mouseUp
Re: Stop inputs while animating (mobile)
...or that way!
Re: Stop inputs while animating (mobile)
Haha -yes
I would just add that you will need to add some delay to make sure the input is blocked on both ends. I ended up using this and it works 100% time.
I would just add that you will need to add some delay to make sure the input is blocked on both ends. I ended up using this and it works 100% time.
Code: Select all
on mouseUp
enable grc "overlay" of cd "display"
wait .2 seconds
animateObject
wait .2 seconds
disable grc "overlay" of cd "display"
end mouseUp
Re: Stop inputs while animating (mobile)
just like the screen crashes. You can also block the flow of messages.
and on mac and win you can use ignoreMouseEvents property
Code: Select all
lock messages
unlock messages