MoveCirclur parameter help

Create fast, sprite powered games with Animation Engine, co-developed with DerBrill Software!

Moderators: heatherlaine, kevinmiller, robinmiller, malte

Post Reply
stevek
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 2
Joined: Sun Nov 09, 2008 6:06 pm

MoveCirclur parameter help

Post by stevek » Sun Nov 09, 2008 6:11 pm

Hi

I have just started using AE and I am having trouble setting the initial point on the circle for moveCircular.
I assumed this could be done by setting [isAngle] =0 (expecting 12 o'clock position), but in my stack, this seems to position the target object loc at 120deg (4 o'clock position). I guess I must be doing something wrong but not sure what.

Any help would be appreciated

Cheers
Steve

BvG
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 1236
Joined: Sat Apr 08, 2006 1:10 pm
Location: Zurich
Contact:

Post by BvG » Sun Nov 09, 2008 7:06 pm

Most AE stuff has the zero point for angles at the 3 o'clock position, and the following code does just that, so I'm a bit suprised about the 4 o'clock you mentioned:

Code: Select all

on mouseUp
   set the moveCircular["isAngle"] of me to 0
   moveCircular
end mouseUp
(actually the isAngle will be one degree beyond the 3 o'clock position at the end, because movecircular of course adds one to the angle)
Various teststacks and stuff:
http://bjoernke.com

Chat with other RunRev developers:
chat.freenode.net:6666 #livecode

stevek
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 2
Joined: Sun Nov 09, 2008 6:06 pm

Post by stevek » Sun Nov 09, 2008 8:49 pm

Hi
I used the following and it definitely put the btn "test" at 4 o'clock
on mouseUp

set the moveCircular[isAngle] of btn "test" to 0
set the moveCircular[CenterX] of btn "test" to 400
set the moveCircular[CenterY] of btn "test" to 292
set the moveCircular[isRadius] of btn "test" to 125
send moveCircular to btn "test"
end mouseUp

However, you last comment made me check the custom property and I noticed that step was 30 (from a previous script). So it seems that the angle is set to [isAngle] plus one degree PLUS one STEP (rather than 1 degree). Visually it seems that setting step to -1 corrects this 1 degree anomaly.

So, many thanks, solved my problem and may be useful to others

Cheers
Steve

BvG
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 1236
Joined: Sat Apr 08, 2006 1:10 pm
Location: Zurich
Contact:

Post by BvG » Sun Nov 09, 2008 11:48 pm

maybe i should have said "...the isAngle will be <amount in Step> degree beyond the 3 o'clock position..."

Because that's how the AE move stuff works. You send the message, and it calculates the point it should move to, based on what the cprops do contain.
Various teststacks and stuff:
http://bjoernke.com

Chat with other RunRev developers:
chat.freenode.net:6666 #livecode

malte
Posts: 1098
Joined: Thu Feb 23, 2006 8:34 pm
Location: Ostenfeld germany
Contact:

Post by malte » Mon Nov 10, 2008 6:38 pm

Sorry I jump in late to this. Still recovering from me being burgled. :)

To set the initial position of your object the pointOnCircle function comes in handy. As BvG already pointed out, the moveCircular command adds the step (it must to move the object at all. What I could do of course is put an initialisation handler into the library in the next itaration.

All the best,

malte

Post Reply

Return to “Animation Engine”