See also
image
(Image), image(),
crop() (Bitmap)
Usage
-- Lingo syntax
memberObjRef.crop()
// JavaScript syntax
memberObjRef.crop();
Description
Bitmap command; allows a bitmap cast member to be cropped to a specific size.
You can use
crop
grab a snapshot and then crop it to size for display.
The registration point is kept in the same location so the bitmap does not move in relation to the
original position.
Parameters
Required. Specifes the rectangle to which a cast member is cropped.
rectToCropTo
Example
This statement sets an existing bitmap member to a snapshot of the Stage, then crops the
resulting image to a rectangle equal to sprite 10:
-- Lingo syntax
stageImage = (_movie.stage).image
spriteImage = stageImage.crop(sprite(10).rect)
member("sprite snapshot").image = spriteImage
// JavaScript syntax
var stageImage = (_movie.stage).image;
var spriteImage = stageImage.crop(sprite(10).rect);
member("sprite snapshot").image = spriteImage;
See also
picture (Member)
cross
Usage
vector1.cross(vector2)
Description
3D vector method; returns a vector which is perpendicular to both
Example
In this example, pos1 is a vector on the x axis and pos2 is a vector on the y axis. The value
returned by
pos1.cross(pos2)
perpendicular to both pos1 and pos2.
rect (Image)
to trim existing cast members, or in conjunction with the picture of the Stage to
is
vector( 0.0000, 0.0000, 1.00000e4 )
and
vector1
vector2
, which is
cross
.
277
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