location 'math'

Ken Norris (dialup) pixelbird at interisland.net
Tue Aug 20 14:50:17 EDT 2002


on 8/20/02 12:24 PM, Tony Moller at tony.moller at drcs.com wrote:

> I understand the concept, and that locations are referenced as the center of
> a stack object. What I need to know is the actual syntax. When you get the
> location of something, its returned as "200,300". How do you subtract 150
> from the 300 part of that returned value?
> 
> Specific example: I want to set the palette's location on the left side of
> the main stack, aligned at the top. I need to set the palette's location as
> (-150,-120) relative to the main stack. So, I get the location of the main
> stack; say its currently at "400,600". Now what's the actual syntax of the
> set location command for the palette?
----------
How about something like:

get the loc of stack <main stack name>
subtract 150 from item 1 of it
subtract 120 from item 2 of it
set the loc of palette <palette name> to it

HTH, 
Ken N.




More information about the use-livecode mailing list