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
MoveCirclur parameter help
Moderators: heatherlaine, kevinmiller, robinmiller, malte
-
- VIP Livecode Opensource Backer
- Posts: 1236
- Joined: Sat Apr 08, 2006 1:10 pm
- Location: Zurich
- Contact:
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:
(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)
Code: Select all
on mouseUp
set the moveCircular["isAngle"] of me to 0
moveCircular
end mouseUp
Various teststacks and stuff:
http://bjoernke.com
Chat with other RunRev developers:
chat.freenode.net:6666 #livecode
http://bjoernke.com
Chat with other RunRev developers:
chat.freenode.net:6666 #livecode
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
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
-
- VIP Livecode Opensource Backer
- Posts: 1236
- Joined: Sat Apr 08, 2006 1:10 pm
- Location: Zurich
- Contact:
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.
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
http://bjoernke.com
Chat with other RunRev developers:
chat.freenode.net:6666 #livecode
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
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