User Guide
originPoint 905
Example
This sprite script uses the originMode property to set up a Flash movie sprite so its origin point
can be set to a specific point. It then sets the horizontal and vertical origin points.
-- Lingo syntax
property spriteNum
on beginSprite me
sprite(spriteNum).originMode = #point
sprite(spriteNum).originH = 100
sprite(spriteNum).originV = 80
end
// JavaScript syntax
function beginSprite() {
sprite(this.spriteNum).originMode = symbol("point");
sprite(this.spriteNum).originH = 100;
sprite(this.spriteNum).originV = 80;
}
See also
originH, originV, originPoint, scaleMode
originPoint
Usage
-- Lingo syntax
memberOrSpriteObjRef.originPoint
// JavaScript syntax
memberOrSpriteObjRef.originPoint;
Description
Cast member and sprite property; controls the origin point around which scaling and rotation
occurs of a Flash movie or vector shape.
The
originPoint property is specified as a Director point value: for example, point(100,200).
Setting a Flash movie or vector shape’s origin point with the
originPoint property is the same as
setting the
originH and originV properties separately. For example, setting the originPoint
property to point(50,75) is the same as setting the originH property to 50 and the originV
property to 75.
Director point values specified for the
originPoint property are restricted to integers,
whereas
originH and originV can be specified with floating-point numbers. When you test
the originPoint property, the point values are truncated to integers. As a rule of thumb, use
the
originH and originV properties for precision; use the originPoint property for speed
and convenience.
You can set the
originPoint property only if the originMode property is set to #point.
This property can be tested and set. The default value is 0.
Note: This property must be set to the default value if the scaleMode property is set to #autoSize, or
the sprite will not display correctly.