User Guide
68 Chapter 3: Sprites
3 Select alignment buttons to modify the selected objects:
■ For Align, select Align Left Edge, Align Horizontal Center, Align Right Edge, Align
Horizontal Registration Point, Align Top Edge, Align Vertical Center, Align Bottom Edge,
or Align Vertical Registration Point.
■ For Distribute, select Distribute Left Edge, Distribute Horizontal Center, Distribute Right
Edge, Distribute Horizontal Registration Point, Distribute Width, Distribute Horizontally
Across Stage, Distribute Top Edge, Distribute Vertical Center, Distribute Bottom Edge,
Distribute Vertical Registration Point, Distribute Height, or Distribute Vertically
Across Stage.
Positioning sprites with Lingo or JavaScript syntax
Script lets you control a sprite’s position by setting the sprite’s coordinates on the Stage. You
can also test a sprite’s coordinates to determine a sprite’s current position and whether two
sprites overlap.
To check the location of a sprite’s registration point or bounding rectangle on the Stage:
• Test t h e bottom, left, loc, locH, locV, right, or top sprite property.
The
bottom, left, right, and top sprite properties determine the location of the sprite’s
individual edges. For more information about these properties, see the Scripting Reference
topics in the Director Help Panel.
To place a sprite at a specific location:
• Set one of the following properties (for more information about these properties, see the
Scripting Reference topics in the Director Help Panel):
The loc sprite property sets the horizontal and vertical distance from the upper left corner of
the Stage to the sprite’s registration point. The value is given as a point.
The locV sprite property sets the number of pixels from the top of the Stage to a sprite’s
registration point.
The locH sprite property sets the number of pixels from the left of the Stage to a sprite’s
registration point.
The rect sprite property sets the location of the sprite’s bounding rectangle on the Stage.
The quad sprite property sets the location of the sprite’s bounding rectangle on the Stage. You
can specify any four points; the points don’t have to form a rectangle. The
quad sprite property
can set the sprite’s coordinates as precise floating-point numbers.