Rotate objects

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

Moderators: Klaus, FourthWorld, heatherlaine, kevinmiller, robinmiller

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

Rotate objects

Post by tal » Wed Mar 24, 2010 4:58 pm

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: 7719
Joined: Sat Apr 08, 2006 7:05 am
Location: Los Angeles
Contact:

Re: Rotate objects

Post by FourthWorld » Wed Mar 24, 2010 5:13 pm

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
Community volunteer LiveCode Community Liaison

LiveCode development, training, and consulting services: Fourth World Systems: http://FourthWorld.com
LiveCode User Group on Facebook : http://FaceBook.com/groups/LiveCodeUsers/

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

Re: Rotate objects

Post by tal » Wed Mar 31, 2010 9:27 am

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 » Tue Aug 28, 2012 11:31 am

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: 11823
Joined: Sat Apr 08, 2006 8:41 am
Location: Germany
Contact:

Re: Rotate objects

Post by Klaus » Tue Aug 28, 2012 12:29 pm

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 » Tue Aug 28, 2012 12:54 pm

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

Surbhit

Klaus
Posts: 11823
Joined: Sat Apr 08, 2006 8:41 am
Location: Germany
Contact:

Re: Rotate objects

Post by Klaus » Tue Aug 28, 2012 1:12 pm

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 » Thu Aug 30, 2012 1:55 pm

Thanks a lot Klaus
That worked well.

Surbhit

Post Reply

Return to “Talking LiveCode”