Page 1 of 1
Naming the speed of visual effects with variables
Posted: Mon Jul 25, 2016 11:00 am
by Fermin
Hi. Please,
Is there a way to invoke the speed of visual effects ("very fast", "fast", "slow", "very slow") with a variable?
Code: Select all
put "zoom out" into nameVF
put "very slow" into velVF
--
unlock screen with visual effect nameVF very slow -- Works fine
unlock screen with visual effect nameVF velVF -- It does not work
Thank you very much
Re: Naming the speed of visual effects with variables
Posted: Mon Jul 25, 2016 1:08 pm
by jmburnod
Hi Fermin,
It seems "do" way works
Code: Select all
put "zoom out" into nameVF
put "very slow" into velVF
do "unlock screen with visual effect" && nameVF && velVF
Best regards
Jean-Marc
Re: Naming the speed of visual effects with variables
Posted: Mon Jul 25, 2016 1:24 pm
by SparkOut
You don't need to "do" it if you resolve the name and speed to one argument for the effect:
Code: Select all
unlock screen with visual effect (nameVF && velVF)
Re: Naming the speed of visual effects with variables
Posted: Mon Jul 25, 2016 7:18 pm
by Fermin
It works very well. Thank you very much.
It would be great if instead of those words (slow, very slow, etc) could use a numeric value but I guess LiveCode not allow that.
Anyway, I say thank you both.
Re: Naming the speed of visual effects with variables
Posted: Mon Jul 25, 2016 7:50 pm
by Klaus
Hi Fermin,
Fermin wrote:It works very well. Thank you very much.
It would be great if instead of those words (slow, very slow, etc) could use a numeric value but I guess LiveCode not allow that.
Anyway, I say thank you both.
LC DOES in fact allow this, check "the effectrate" in the dictionary.
This manages the exact time in millisecs that a "very slow" effect will take!
Yes, the "very slow" effect, which is a bit mentally challenging
Code: Select all
...
lock screen
## We want a duration for our visual effect of 300 millisecs
set the effectrate to 300
## Or whatever should happen with a visual effect
show img "an image"
unlock screen with visual dissolve very slow
...
Best
Klaus
Re: Naming the speed of visual effects with variables
Posted: Mon Jul 25, 2016 9:26 pm
by Fermin
Great, Klaus, is exactly what I need. I had not noticed that in the manual. Thank you very much.