546
Chapter 12: Methods
Parameters
loc
Required. Specifies the location in the referenced sprite. This location should be a point
relative to the sprite’s upper-left corner.
Example
This statement shows that the point (50, 50) within sprite 5 is equivalent to the vector
(-1993.6699, 52.0773, 2263.7446) on the projection plane of the camera of sprite 5:
put sprite(5).camera.spriteSpaceToWorldSpace(point(50, 50))
-- vector(-1993.6699, 52.0773, 2263.7446)
See also
worldSpaceToSpriteSpace
,
rect (camera)
,
camera
sqrt()
Usage
sqrt(
number
)
the sqrt of
number
Description
Math function (Lingo only); returns the square root of a specified number.
The value must be a decimal number greater than 0. Negative values return 0.
In JavaScript syntax, use the Math object’s
sqrt()
function.
Parameters
number
Required. Specifies the number. This number is either a floating-point number or an
integer rounded to the nearest integer.
Example
This statement displays the square root of 3.0 in the Message window:
put sqrt(3.0)
-- 1.7321
This statement displays the square root of 3 in the Message window:
put sqrt(3)
-- 2
See also
floatPrecision
Summary of Contents for DIRECTOR MX 2004-DIRECTOR SCRIPTING
Page 1: ...DIRECTOR MX 2004 Director Scripting Reference...
Page 48: ...48 Chapter 2 Director Scripting Essentials...
Page 100: ...100 Chapter 4 Debugging Scripts in Director...
Page 118: ...118 Chapter 5 Director Core Objects...
Page 594: ...594 Chapter 12 Methods...
Page 684: ...684 Chapter 14 Properties See also DVD...
Page 702: ...702 Chapter 14 Properties See also face vertices vertices flat...
Page 856: ...856 Chapter 14 Properties JavaScript syntax sprite 15 member member 3 4...
Page 1102: ...1102 Chapter 14 Properties...