How to set the pivot point of rotating a graphic Line

LiveCode is the premier environment for creating multi-platform solutions for all major operating systems - Windows, Mac OS X, Linux, the Web, Server environments and Mobile platforms. Brand new to LiveCode? Welcome!

Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller, robinmiller

Post Reply
alex298
Posts: 101
Joined: Mon May 01, 2006 1:17 pm

How to set the pivot point of rotating a graphic Line

Post by alex298 » Thu Apr 17, 2008 2:18 pm

Hi,

I use the following code to rotate a graphic, e.g.

RevRotatePoly the name of graphic "Rod", 45

Graphic "Rod" is actually a Line with Width 300 and Border Size 7. I noticed that the pivot point is at the left side. Is it possible to use some syntax that allow to set or control the pivot point of rotation?

Thanks and best regards
Alex
Nice to meet all of you.

Mark
Livecode Opensource Backer
Livecode Opensource Backer
Posts: 5150
Joined: Thu Feb 23, 2006 9:24 pm
Contact:

Post by Mark » Thu Apr 17, 2008 5:00 pm

Hi Alex,

Not that I know of, but the following might help:

Code: Select all

lock screen
put the loc of grc "Rod" into myOldLoc
RevRotatePoly the name of graphic "Rod", 45 
set the loc of grc "Rod" to myOldLoc
unlock screen
Instead of the loc, you might also use the topleft, bottomright, etc.

Best,

Mark
The biggest LiveCode group on Facebook: https://www.facebook.com/groups/livecode.developers
The book "Programming LiveCode for the Real Beginner"! Get it here! http://tinyurl.com/book-livecode

Garrett
Posts: 386
Joined: Sat Apr 08, 2006 8:15 am
Contact:

Post by Garrett » Thu Apr 17, 2008 6:42 pm

Speaking of graphics/drawing in Rev. I'm only now kind of getting back into programming again and only recently(after years of toying with Rev) used the drawing tools in Rev.

I was so glad to see that antialias was available!!! I've avoided so many projects for so long because not one of the programming languages I have could offer antialias in it's drawing graphics.

Might have reopened a new world for me here, now if I could just remember at least one of the projects I had in mind oh so many years ago.

Great!, thanks Rev, now I'm gonna get a headache trying to remember some ancient project I wanted to do! :p

Seriously though, Thanks Rev for going the extra distance and having antialias support for the drawing graphics. :-)

~Garrett

Post Reply