Parameters
intPaletteIndex
value to use. Valid values range from 0 to 255. All other values are truncated.
Required if using RGB values. An integer that specifies the red color component in the
intRed
current palette. Valid values range from 0 to 255. All other values are truncated.
Required if using RGB values. An integer that specifies the green color component in
intGreen
the current palette. Valid values range from 0 to 255. All other values are truncated.
Required if using RGB values. An integer that specifies the blue color component in the
intBlue
current palette. Valid values range from 0 to 255. All other values are truncated.
Example
These statements display the color of sprite 6 in the Message window, and then set the color of
sprite 6 to a new value:
-- Lingo syntax
put(sprite(6).color) -- paletteIndex(255)
sprite(6).color = color(137)
put(sprite(6).color) -- paletteIndex(137)
// JavaScript syntax
put(sprite(6).color) // paletteIndex(255);
sprite(6).color = color(137);
put(sprite(6).color) // paletteIndex(137);
constrainH()
Usage
-- Lingo syntax
_movie.constrainH(intSpriteNum, intPosn)
// JavaScript syntax
_movie.constrainH(intSpriteNum, intPosn);
Description
Movie method; returns an integer whose value depends on the horizontal coordinates of the left
and right sides of a sprite.
The returned integer can be one of three possible values.
•
If the
intPosn
returned integer equals
•
If the
intPosn
integer changes to the value of the sprite's left coordinate.
•
If the
intPosn
integer changes to the value of the sprite's right coordinate.
This method does not change the sprite's properties.
Both the
constrainH()
Required if using 8-bit palette values. An integer that specifies the 8-bit palette
parameter is between the values of the sprite's left and right coordinates, the
.
intPosn
parameter is less than the value of the sprite's left coordinate, the returned
parameter is greater than the value of the sprite's right coordinate, the returned
and
constrainV()
methods constrain only one axis each.
constrainH()
269
Need help?
Do you have a question about the DIRECTOR MX 2004-DIRECTOR SCRIPTING and is the answer not in the manual?
Questions and answers