Page 1 of 1

How to determine the angle of image?

Posted: Sat Jul 13, 2013 3:43 am
by HisWorkmanship
I have been working on a game for about 2 weeks now. I am trying to replicate a spinning wheel that randomly lands on a number. I have it working in essence but I have found no way to determine the angle of the wheel after it stops spinning. I have tried the script command "get the angle of image "Spinning_Wheel.png" in the message window, only to get a Boolean answer of true. Thank you in advance for you help!

PS I have not been able to be successful in using the "set the angle" command on a graphic it has only worked on images. Am I doing something wrong?

Mike

Re: How to determine the angle of image?

Posted: Sat Jul 13, 2013 4:36 am
by dunbarx
Hi.

If I set the angle of an image, It rotates, and I can then get the angle of that image. Not an issue.

So you should be able to spin your selector with some winding down routine, and then read when it stops. I suppose you could always get some random value, spin to that value, and then you would already know where you will end up. Still fair, even thought you knew beforehand, because the value was random. But inelegant.

But in 6.1 Community I cannot set the angle of a graphic either. I am pretty sure I have done so in 5.5, but do not have that machine with me now.

Anyone?

Craig Newman

Re: How to determine the angle of image?

Posted: Sat Jul 13, 2013 4:42 am
by HisWorkmanship
I answered my own question. It just goes to show you that you sometimes you need to dig a little more. I just had to use the put command instead of the get command. thank you for the trouble. btw I am loving it... programming with Livecode Thank You!

Re: How to determine the angle of image?

Posted: Sat Jul 13, 2013 5:07 am
by Simon
Difference between "put" and "get"?
"Get" err.. puts the result into the "it" variable:

Code: Select all

get 2 * myRadius * pi
answer it
--or
put 2 * myRadius * pi into tArea
answer tArea 
Watch out though, "it" changes a lot and fast.

Glad you're having Fun!
Simon

Re: How to determine the angle of image?

Posted: Sat Jul 13, 2013 2:22 pm
by dunbarx
Simon makes a point. It would be front page news if the "put" and "get" commands did not work identically. Not that they do exactly the same thing, but rather that they operate similarly;

put "something" into it

should be identical to:

get "something"

If you have an instance where this really does not hold, please forward it. I think not, though.

Craig