User Guide
502
preMultiply
Syntax
transform1.preMultiply(transform2)
Description
3D transform command; alters transform1 by pre-applying the positional, rotational, and
scaling effects of transform2.
If
transform2 describes a rotation of 90° about the X axis and transform1 describes a
translation of 100 units in the Y axis, transform1.multiply\
(transform2) will alter this transform so that it describes a translation followed by a rotation.
The statement
transform1.preMultiply(transform2) will alter this transform so that it
describes a rotation followed by a translation. The effect is that the order of operations is reversed.
Example
This statement performs a calculation that applies the transform of the model Mars to the
transform of the model Pluto:
member("scene").model("Pluto").transform.preMultiply\
(member("scene").model("Mars").transform)
on prepareFrame
Syntax
on prepareFrame
statement(s)
end
Description
System message and event handler; contains statements that run immediately before the current
frame is drawn.
Unlike
beginSprite and endSprite events, a prepareFrame event is generated each time the
playhead enters a frame.
The
on prepareFrame handler is a useful place to change sprite properties before the sprite
is drawn.
If used in a behavior, the
on prepareFrame handler receives the reference me.
The
go, play, and updateStage commands are disabled in an on prepareFrame handler.
Example
This handler sets the locH property of the sprite that the behavior is attached to:
on prepareFrame me
sprite(me.spriteNum).locH = the mouseH
end
See also
on enterFrame