location

Typeproperty
DictionaryLCS
LibraryLiveCode Script
Syntax
set the location of <object> to <point>
Synonymsloc
Associationsstack, card, field, button, graphic, scrollbar, player, image, group
Summary

Specifies where an object is.

Introduced1.0
OSmac, windows, linux, ios, android
Platformsdesktop, server, mobile
Example
if the location of button 1 is within the rect of field 1 then selectIt
set the location of this stack to the mouseLoc
Values
NameTypeDescription
Value

The location of an object is any expression that evaluates to a point --two integers separated by a comma. The first item of the location is the distance in pixels from the left edge of the screen (for stacks) or card (for other objects) to the center of the object. The second item is the distance in pixels from the top edge of the screen (for stacks) or card (for other objects) to the center of the object.

For cards, the location property is read-only and cannot be set.

RelatedProperty: pixels, height, windowManagerPlace, topRight, width, properties
Message: moveStack
Keyword: card, item, rectangle, point, control
Glossary: object, property, relative coordinates, absolute coordinates, evaluate, read-only, expression
Function: screenLoc, stacks
Command: revChangeWindowSize, group, move
Object: stack, card
Description

Use the location property to move an object without resizing it, or to find out where an object is.

The location of a stack is in absolute coordinates|absolute (screen) coordinates. The first item of a card's location property is equal to the width of stack div 2; the second item is equal to the height of stack div 2. The location of a group or control is in relative coordinates| relative (window) coordinates.

In window coordinates, the point 0,0 is at the top left of the stack window. In screen coordinates, the point 0,0 is at the top left of the screen.

Changing the location of an object moves it to the new position without resizing it. To change an object's size, set its height, width, or rectangle properties.

Tagsui