Математика

Физика

Химия

Биология

Техника и    технологии

 

 

scale (3D)

Usage

member(whichCastmember).camera(whichCamera).backdrop[backdropIndex].scale
member(whichCastmember).camera(whichCamera).overlay[overlayIndex].scale

            

Description

3D property; allows you to get or set the scale value used by a specific overlay or backdrop in the referenced camera’s list of overlays or backdrops to display. The width and height of the backdrop or overlay are multiplied by the scale value.The default value for this property is 1.0.

Example

This statement doubles the size of a backdrop:

sprite(25).camera.backdrop[1].scale = 2.0

            

 

 

scale (command)

Usage

member(whichCastmember).node(whichNode).scale(xScale, yScale, zScale)
member(whichCastmember).node(whichNode).scale(uniformScale)
transform.scale(xScale, yScale, zScale)
transform.scale(uniformScale)

            

Description

3D transform command; applies a scaling after the current positional, rotational, and scale offsets held by a referenced node’s transform or the directly referenced transform. The scaling must be specified as either a set of three scalings along the corresponding axes or as a single scaling to be applied uniformly along all axes. You can specify the individual scalings using the xScale, yScale and zScale parameters, otherwise you can specify the uniform scaling amount using the uniformScale parameter.

A node can be a camera, group, light or model object. Using the scale command adjusts the referenced node’s transform.scale property, but it does not have any visual effect on lights or cameras as they do not contain geometry.

The scaling values provided must be greater than zero.

Parameters

xScale Required if specifying three scalings. Specifies the scale along the x-axis.

yScale Required if specifying three scalings. Specifies the scale along the y-axis.

zScale Required if specifying three scalings. Specifies the scale along the z-axis.

uniformScale Required if specifying a single, uniform scaling. Specifies the uniform scaling.

Example

This example first displays the transform.scale property for the model named Moon, then it scales the model using the scale command, and finally, it displays the resulting transform.scale value.

put member("Scene").model("Moon").transform.scale
-- vector( 1.0000, 1.0000, 1.0000)
member("Scene").model("Moon").scale(2.0,1.0,0.5)
put member("Scene").model("Moon").transform.scale
-- vector( 2.0000, 1.0000, 0.5000)

            

This statement scales the model named Pluto uniformly along all three axes by 0.5, resulting in the model displaying at half of its size.

member("Scene").model("Pluto").scale(0.5)

            

This statement scales the model named Oval in a nonuniform manner, scaling it along its z-axis but not its x- or y-axes.

member("Scene").model("Pluto").scale(0.0, 0.0, 0.5)

            

preScale()

Usage

transformReference.preScale( xScale, yScale, zScale )
transformReference.preScale( vector )
member( whichCastmember ).node.transform.preScale( xScale, yScale, zScale )
member( whichCastmember ).node.transform.preScale( vector )

            

Description

3D transform command; applies a scale prior to the existing positional, rotational, and scaling effects of the given transform.

Node may be a reference to a model, group, light, or camera.

Parameters

xScale Required if applying a scale using x-, y-, and z-axes. Specifies the scale around the x-axis.

yScale Required if applying a scale using x-, y-, and z-axes. Specifies the scale around the y-axis.

zScale Required if applying a scale using x-, y-, and z-axes. Specifies the scale around the z-axis.

vector Required if applying a scale using a vector. Specifies the vector that contains the scale to apply.

Example

Line 1 of the following Lingo creates a duplicate of Moon1’s transform. Remember that access to a model’s transform property is by reference.

Line 2 applies a scale to that transform prior to any existing positional or rotational effects of that transform. Assume that the transform represents the positional offset and rotational orbit of Moon1 relative to its parent planet. Lets also assume Moon2’s parent is the same as Moon1’s. If we used scale() here instead of preScale(), then Moon2 would be pushed out twice as far and rotated about the planet twice as much as is Moon1. This is because the scaling would be applied to the transform’s existing positional and rotational offsets. Using preScale() will apply the size change without affecting these existing positional and rotational offsets.

Line 3 applies an additional 180° rotation about the x-axis of the planet. This will put Moon2 on the opposite side of Moon1’s orbit. Using preRotate() would have left Moon2 in the same place as Moon1, spun around its own x-axis by 180°.

Line 4 assigns this new transform to Moon2.

t = member("scene").model("Moon1").transform.duplicate()
t.preScale(2,2,2)
t.rotate(180,0,0)
member("scene").model("Moon2").transform = t

            

 

 

scale (transform)

Usage

member(whichCastmember).node(whichNode).transform.scale
member(whichCastmember).node(whichNode).getWorldTransform().scale
transform.scale

            

Description

3D property; allows you to get or set the scaling component of a transform. A transform defines a scale, position and rotation within a given frame of reference. The scale property allows you to get and set the degree of scaling of the transform along each of the three axes. The default value of this property is vector(1.0,1.0,1.0).

A node can be a camera, group, light or model object. This command does not have any visual effect on lights or cameras as they do not contain geometry. Setting the scale property of a node’s transform defines that object’s scaling along the X, Y and Z axes within the transform’s frame of reference. Getting the scale property of an object’s world relative transform using getWorldTransform().scale returns the object’s scaling relative to the world origin. Setting the scale property of an object’s parent relative transform using transform.scale defines the object’s scaling relative to its parent node.

Example

This statement sets the scale property of the transform of the model named Moon to vector(2,5,3):

member("Scene").model("Moon").transform.scale = vector(2,5,3)

            

scale (backdrop and overlay)

Usage

member(whichCastmember).camera(whichCamera).backdrop[backdropIndex].scale
member(whichCastmember).camera(whichCamera).overlay[overlayIndex].scale

            

Description

3D property; allows you to get or set the scale value used by a specific overlay or backdrop in the referenced camera’s list of overlays or backdrops to display. The width and height of the backdrop or overlay are multiplied by the scale value.The default value for this property is 1.0.

Example

This statement doubles the size of a backdrop:

sprite(25).camera.backdrop[1].scale = 2.0

            

scale (Member)

Usage

-- Lingo syntax
memberOrSpriteObjRef.scale

// JavaScript syntax
memberOrSpriteObjRef.scale;

            

Description

Cast member property and sprite property; controls the scaling of a QuickTime, vector shape, or Flash movie sprite.

For QuickTime, this property does not scale the sprite’s bounding rectangle or the sprite’s controller. Instead, it scales the image around the image’s center point within the bounding rectangle. The scaling is specified as a Director list containing two percentages stored as float-point values:

[xPercent, yPercent]

            

The xPercent parameter specifies the amount of horizontal scaling; the yPercent parameter specifies vertical scaling.

When the sprite’s crop property is set to TRUE, the scale property can be used to simulate zooming within the sprite’s bounding rectangle. When the sprite’s crop property is set to FALSE, the scale property is ignored.

This property can be tested and set. The default value is [1.0000,1.0000].

For Flash movie or vector shape cast members, the scale is a floating-point value. The movie is scaled from its origin point, as specified by its originMode property.

Note: This property must be set to the default value if the scaleMode property is set to #autoSize; otherwise the sprite does not display correctly.

Example

This handler accepts a reference to a Flash movie sprite as a parameter, reduces the movie’s scale to 0% (so it disappears), and then scales it up again in 5% increments until it is full size (100%) again:

-- Lingo syntax
on scaleMovie whichSprite
	sprite(whichSprite).scale = 0
	_movie.updatestage()
	repeat with i = 1 to 20
		sprite(whichSprite).scale = i * 5
		_movie.updatestage()
	end repeat
end

// JavaScript syntax
function scaleMovie(whichSprite) {
	sprite(whichSprite).scale = 0;
	_movie.updatestage();
	var i = 1;
	while (i < 21) {
		sprite(whichSprite).scale = i * 5;
		_movie.updatestage();
		i++;
	}
}

            

scaleMode

Usage

-- Lingo syntax
memberOrSpriteObjRef.scaleMode

// JavaScript syntax
memberOrSpriteObjRef.scaleMode;

            

Description

Cast member property and sprite property; controls the way a Flash movie or vector shape is scaled within a sprite’s bounding rectangle. When you scale a Flash movie sprite by setting its scale and viewScale properties, the sprite itself is not scaled; only the view of the movie within the sprite is scaled. The scaleMode property can have these values:

  • #showAll (default for Director movies prior to version 7)--Maintains the aspect ratio of the original Flash movie cast member. If necessary, fill in any gap in the horizontal or vertical dimension using the background color.
  • #noBorder--Maintains the aspect ratio of the original Flash movie cast member. If necessary, crop the horizontal or vertical dimension.
  • #exactFit--Does not maintain the aspect ratio of the original Flash movie cast member. Stretch the Flash movie to fit the exact dimensions of the sprite.
  • #noScale--preserves the original size of the Flash media, regardless of how the sprite is sized on the Stage. If the sprite is made smaller than the original Flash movie, the movie displayed in the sprite is cropped to fit the bounds of the sprite.
  • #autoSize (default)--This specifies that the sprite rectangle is automatically sized and positioned to account for rotation, skew, flipH, and flipV. This means that when a Flash sprite is rotated, it will not crop as in earlier versions of Director. The #autoSize setting only functions properly when scale, viewScale, originPoint, and viewPoint are at their default values.

This property can be tested and set.

Example

The following sprite script checks the Stage color of the Director movie and, if the Stage color is indexed to position 0 in the current palette, the script sets the scaleMode property of a Flash movie sprite to #showAll. Otherwise, it sets the scaleMode property to #noBorder.

-- Lingo syntax
property spriteNum

on beginsprite me
	if _movie.stage.bgColor = 0 then
		sprite(spriteNum).scaleMode = #showAll
	else
		sprite(spriteNum).scaleMode = #noBorder
	end if
end

// JavaScript syntax
function beginsprite() {
	var stgClr = _movie.stage.bgColor;
	if (stgClr = 0) {
		sprite(this.spriteNum).scaleMode = symbol("showAll");
	} else {
		sprite(this.spriteNum).scaleMode = symbol("noBorder");
	}
}

                            

 

Назад

 

Hosted by uCoz