
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 the
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.
Summary of Contents for DIRECTOR MX 2004-USING DIRECTOR
Page 1: ...DIRECTOR MX 2004 Using Director...
Page 16: ...16 Chapter 1 Introduction...
Page 82: ...82 Chapter 3 Sprites...
Page 98: ...98 Chapter 4 Animation...
Page 134: ...134 Chapter 5 Bitmaps...
Page 242: ...242 Chapter 10 Sound and Synchronization...
Page 274: ...274 Chapter 11 Using Digital Video...
Page 290: ...290 Chapter 12 Behaviors...
Page 302: ...302 Chapter 13 Navigation and User Interaction...
Page 334: ...334 Chapter 15 The 3D Cast Member 3D Text and 3D Behaviors...
Page 392: ...392 Chapter 16 Working with Models and Model Resources...
Page 418: ...418 Chapter 18 Movies in a Window...
Page 446: ...446 Chapter 22 Managing and Testing Director Projects...