EasyManua.ls Logo

MACROMEDIA DIRECTOR MX 2004-DIRECTOR SCRIPTING - Page 940

MACROMEDIA DIRECTOR MX 2004-DIRECTOR SCRIPTING
1130 pages
Print Icon
To Next Page IconTo Next Page
To Next Page IconTo Next Page
To Previous Page IconTo Previous Page
To Previous Page IconTo Previous Page
Loading...
940 Chapter 14: Properties
See also
Member
quad
Usage
-- Lingo syntax
spriteObjRef.quad
// JavaScript syntax
spriteObjRef.quad;
Description
Sprite property; contains a list of four points, which are floating point values that describe the
corner points of a sprite on the Stage. Read/write.
The points of the quad are organized in the following order: upper left, upper right, lower right,
and lower left.
The points themselves can be manipulated to create perspective and other image distortions.
After you manipulate the quad of a sprite, you can reset it to the Score values by turning off the
scripted sprite with
puppetSprite(intSpriteNum, FALSE). When the quad of a sprite is
disabled, you cannot rotate or skew the sprite.
Example
This statement displays a typical list describing a sprite:
-- Lingo syntax
put(sprite(1).quad)
// JavaScript syntax
put(sprite(1).quad);
When modifying the quad sprite property, you must reset the list of points after changing any of
the values. This is because when you set a variable to the value of a property, you are placing a
copy of the list, not the list itself, in the variable. To effect a change, use syntax like this (applies to
Lingo only):
-- Lingo syntax
currQuadList = sprite(5).quad
currQuadList[1] = currQuadList[1] + point(50, 50)
sprite(5).quad = currQuadList
See also
point(), puppetSprite(), Sprite