location 'math'

Dar Scott dsc at swcp.com
Tue Aug 20 14:09:00 EDT 2002


On Tuesday, August 20, 2002, at 12:14 PM, Tony Moller wrote:

> How do you do math on location coordinates? I would like to set a 
> palette
> stack -x -y from the location of the main stack, but I can't 
> figure out how
> to do the calculation...

The location of a stack it at its center and is relative to the 
upper left corner of the screen (+ numbers going down and right).  
You will need to consider the width and height.

For example...  If you want the palette to be to the left of the 
main stack, set the first item of its location to be that of the 
main stack less half the width of the main stack, less the space 
you want between, less half the width of the palette.

For example... If you want the tops to align, set the second item 
of its location to the that of the main stack less half the height 
of the main stack plus half the height of the palette.

Dar Scott





More information about the use-livecode mailing list