Lingo Dictionary > O-R > quad |  |

quad

Syntax

    sprite(whichSpriteNumber).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. The points 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 puppet of the sprite with `puppetSprite` `whichSpriteNumber``, 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:

    put sprite(1).quad
    -- [point(153.0000, 127.0000), point(231.0000, 127.0000),  \point(231.0000, 242.0000), point(153.0000, 242.0000)]

Example

When modifying this sprite property, be aware that 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:

    -- Get the current property contents
    currQuadList = sprite(5).quad
    -- Add 50 pixels to the horizontal and vertical positions of the first point in the list
    currQuadList[1] = currQuadList[1] + point(50, 50)
    -- Reset the actual property to the newly computed position
    sprite(5).quad = currQuadList

See also

`rotation`, `skew`