Page 1 of 2
How to rotate an object 360 degree?
Posted: Tue Feb 19, 2013 7:53 pm
by ahmedinvent24BUSGdU9
Hi, All
Please help!
How to rotate an object 360 degree with wheel effects?!
Thanks,
AhmedF.
Re: How to rotate an object 360 degree?
Posted: Tue Feb 19, 2013 9:37 pm
by Simon
Look up "angle" in the dictionary.
With a repeat loop you can make it go round and round.
Simon
Re: How to rotate an object 360 degree?
Posted: Wed Feb 20, 2013 12:27 pm
by ahmedinvent24BUSGdU9
Thank you Simon for your help, but sorry that doesn't work

Re: How to rotate an object 360 degree?
Posted: Wed Feb 20, 2013 12:30 pm
by Klaus
Hi Ahmed,
maybe you should explain first what you mean with "a wheel effect"

Nevertheless I have the feeling that this will not be possible with the build-in means of Livecode.
Best
Klaus
Re: How to rotate an object 360 degree?
Posted: Wed Feb 20, 2013 1:02 pm
by ahmedinvent24BUSGdU9
Hi, Klaus
I mean to rotate, for example the fan rotating.
Re: How to rotate an object 360 degree?
Posted: Wed Feb 20, 2013 1:06 pm
by Klaus
Hi Ahmed,
yes, sure
And to "rotate" an image you set its "angle" property!
What are we missing?
Best
Klaus
Re: How to rotate an object 360 degree?
Posted: Wed Feb 20, 2013 1:15 pm
by ahmedinvent24BUSGdU9
Hi,Klaus
Ok but how to repeat?!
Thanks,
AhmedF.
Re: How to rotate an object 360 degree?
Posted: Wed Feb 20, 2013 1:41 pm
by Klaus
Hi Ahmed,
well, maybe a "repeat" loop?
On the other hand I am sure you could simply FAKE that look like this:
Create a couple of separate images which represent the current "rotation" and then use a button's icon
to show these X images continuously instead of a FULL rotation of an image.
I will try to create a little example stack a bit later...
Best
Klaus
Re: How to rotate an object 360 degree?
Posted: Wed Feb 20, 2013 1:45 pm
by ahmedinvent24BUSGdU9
Hi Klaus,
Thank you For your help
I am waiting to see the sample stack
Thanks,
AhmedF.
Re: How to rotate an object 360 degree?
Posted: Wed Feb 20, 2013 2:07 pm
by Klaus
Hi Ahmed,
OK, finished, check the card script, I think this is what you are looking for!
Best
Klaus
Re: How to rotate an object 360 degree?
Posted: Wed Feb 20, 2013 2:40 pm
by ahmedinvent24BUSGdU9
WOW! Thats great and simple!
Thank You Klaus for your great effort
Best Regards,
AhmedF.
Re: How to rotate an object 360 degree?
Posted: Wed Feb 20, 2013 3:49 pm
by Klaus
Hi Ahmed,
glad you like it!
As you see, we are simply selling an illusion (of a rotating wheel) here
The technique of using "send X in ..." is very efficient, since it does not BLOCK like an repeat loop.
Try to get accustomed to this, very important for smooth animations!!
Best
Klaus
Re: How to rotate an object 360 degree?
Posted: Fri Mar 22, 2013 4:29 pm
by ahmedinvent24BUSGdU9
Thanks, Klaus
Really that is great way to make cool animation !
I use it in all apps i programmed to give it an animation!
Thanks again
Best Regards
Ahmed F.
Re: How to rotate an object 360 degree?
Posted: Sat Aug 10, 2013 2:54 am
by William Jamieson
Wow that really is a good way to allow constant animation while not holding up the script at all since in the wait time, the rest of the script will be processing. I am defintely going to use this!
Re: How to rotate an object 360 degree?
Posted: Wed Aug 28, 2013 5:29 pm
by tomBTG
Hi Klaus.
Would you entertain a few follow-up questions about your stack?
1) Being a newbie, I would have written a similar stack using handlers. You used "command". What's the difference? (The LC dictionary doesn't help much on this point.)
2) What is the result you are getting back from the "send" message in lin 19 and 20? I tried to view it as a variable and did not see it. You stored it in tAnimationMessage and used it to cancel the operation. Is it a message ID?
3) You end the animation_stop with "enable btn "animate" of cd 1". What is the reason for that? (Did the animation process disable the button?)
Thanks Klaus!
Tom