Rotate objects

Anything beyond the basics in using the LiveCode language. Share your handlers, functions and magic here.

Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller, robinmiller

Post Reply
tal
Posts: 84
Joined: Thu Jul 02, 2009 3:27 pm

Rotate objects

Post by tal »

Hi,

I want to rotate a group, so I tried to rotate the controls of the group with a repeat loop but the command

Code: Select all

  revRotatePoly the long id of control i of grp d",45
But it is written that rotatepoly only rotates lines, curves, or polygones. SO if I have a rectangle I cant rotate it.
Is there not another command which can rotate anything?

Thanks
FourthWorld
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 10103
Joined: Sat Apr 08, 2006 7:05 am
Contact:

Re: Rotate objects

Post by FourthWorld »

A rectangle is a four-sided polygon. Just make change the style of the graphic from rectangle to polygon and then you can use the revRotatePoly command.
Richard Gaskin
LiveCode development, training, and consulting services: Fourth World Systems
LiveCode Group on Facebook
LiveCode Group on LinkedIn
tal
Posts: 84
Joined: Thu Jul 02, 2009 3:27 pm

Re: Rotate objects

Post by tal »

Thanks, but there is not a library or a function which could allow to rotate anything?
Maybe someone has already improved the rotate function?

Tal
Surbhit29
Posts: 80
Joined: Thu Aug 16, 2012 1:25 pm

Re: Rotate objects

Post by Surbhit29 »

HI Tal,
I am new to Livecode programming, can you please tell how were you able to rotate a group. I am working on it but cannot find the right command.
I tried using revRotatePoly

Code: Select all

revRotatePly the long id of group "group 22", 45
But it didn't work.
Klaus
Posts: 14325
Joined: Sat Apr 08, 2006 8:41 am
Contact:

Re: Rotate objects

Post by Klaus »

Hi,

you cannot rotate a group, and of course not with the "rotatePOLY" command, where POLY stands for "polygon" (graphic). 8)
The dictiorany leaves no coubt about this!

You can rotate "polygons" by setting their startangle and rotate images by setting their "angle" property, that's all!


Best

Klaus
Surbhit29
Posts: 80
Joined: Thu Aug 16, 2012 1:25 pm

Re: Rotate objects

Post by Surbhit29 »

Hi Klaus,
Thanks for the reply.
Is it possible to move different types of objects all at once?

Surbhit
Klaus
Posts: 14325
Joined: Sat Apr 08, 2006 8:41 am
Contact:

Re: Rotate objects

Post by Klaus »

Yes! Check "lockmoves" in the dictionary.

Basically you DELAY all "move" command with this property until you UNLOCK them again like this:
...
lock moves
move button 1 to 300,200 in 2 seconds
move field 2 to 0,0 in 2 seconds
## Nothing is moving yet!

unlock moves
## Now the objects are moving together...
...

Best

Klaus
Surbhit29
Posts: 80
Joined: Thu Aug 16, 2012 1:25 pm

Re: Rotate objects

Post by Surbhit29 »

Thanks a lot Klaus
That worked well.

Surbhit
Post Reply