translation 1059
translation
Usage
-- Lingo syntax
memberOrSpriteObjRef
.translation
// JavaScript syntax
memberOrSpriteObjRef
.translation;
Description
QuickTime cast member and sprite property; controls the offset of a QuickTime sprite’s image
within the sprite’s bounding box.
This offset is expressed in relation to the sprite’s default location as set by its
center
property. When
center
is set to
TRUE
, the sprite is offset relative to the center of the bounding
rectangle; when
center
is set to
FALSE
, the sprite is offset relative to the upper left corner of the
bounding rectangle.
The offset, specified in pixels as positive or negative integers, is set as a Director list: [
xTrans
,
yTrans
]. The
xTrans
parameter specifies the horizontal offset from the sprite’s default location;
the
yTrans
parameter specifies the vertical offset. The default setting is [0,0].
When the sprite’s
crop
property is set to
TRUE
, the
translation
property can be used to mask
portions of the QuickTime movie by moving them outside the bounding rectangle. When the
crop
property is set to
FALSE
, the
translation
property is ignored, and the sprite is always
positioned at the upper left corner of the sprite’s rectangle.
This property can be tested and set.
Example
The following frame script assumes that the center property of the cast member of a 320-pixel-
wide QuickTime sprite in channel 5 is set to
FALSE
, and its crop property is set to
TRUE
. It keeps
the playhead in the current frame until the movie's horizontal translation point has moved to the
right edge of the sprite, in 10-pixel increments. This has a wipe right effect, moving the sprite out
of view to the right. When the sprite is out of view, the playhead continues to the next frame.
-- Lingo syntax
on exitFrame
horizontalPosition = sprite(5).translation[1]
if horizontalPosition < 320 then
sprite(5).translation = sprite(5).trans [10, 0]
_movie.go(_movie.frame)
end if
end
// JavaScript syntax
function exitFrame() {
var horizontalPosition = sprite(5).translation[1];
if (horizontalPosition < 320 ) {
sprite(5).translation = sprite(5).trans list(10, 0);
_movie.go(_movie.frame);
}
}
Summary of Contents for DIRECTOR MX 2004-DIRECTOR SCRIPTING
Page 1: ...DIRECTOR MX 2004 Director Scripting Reference...
Page 48: ...48 Chapter 2 Director Scripting Essentials...
Page 100: ...100 Chapter 4 Debugging Scripts in Director...
Page 118: ...118 Chapter 5 Director Core Objects...
Page 594: ...594 Chapter 12 Methods...
Page 684: ...684 Chapter 14 Properties See also DVD...
Page 702: ...702 Chapter 14 Properties See also face vertices vertices flat...
Page 856: ...856 Chapter 14 Properties JavaScript syntax sprite 15 member member 3 4...
Page 1102: ...1102 Chapter 14 Properties...