How to determine the angle of image?

Got a LiveCode personal license? Are you a beginner, hobbyist or educator that's new to LiveCode? This forum is the place to go for help getting started. Welcome!

Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller

Post Reply
HisWorkmanship
Posts: 2
Joined: Sat Jul 13, 2013 3:28 am

How to determine the angle of image?

Post by HisWorkmanship » Sat Jul 13, 2013 3:43 am

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

dunbarx
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 10331
Joined: Wed May 06, 2009 2:28 pm

Re: How to determine the angle of image?

Post by dunbarx » Sat Jul 13, 2013 4:36 am

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

HisWorkmanship
Posts: 2
Joined: Sat Jul 13, 2013 3:28 am

Re: How to determine the angle of image?

Post by HisWorkmanship » Sat Jul 13, 2013 4:42 am

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!

Simon
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 3901
Joined: Sat Mar 24, 2007 2:54 am

Re: How to determine the angle of image?

Post by Simon » Sat Jul 13, 2013 5:07 am

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
I used to be a newbie but then I learned how to spell teh correctly and now I'm a noob!

dunbarx
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 10331
Joined: Wed May 06, 2009 2:28 pm

Re: How to determine the angle of image?

Post by dunbarx » Sat Jul 13, 2013 2:22 pm

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

Post Reply