User Guide

spriteSpaceToWorldSpace 545
See also
channel() (Sound), Sound Channel
sprite()
Usage
-- Lingo syntax
sprite(nameOrNum)
// JavaScript syntax
sprite(nameOrNum);
Description
Top level function; returns a reference to a given sprite in the Score.
If the movie
scriptExecutionStyle property is set to a value of 9, calling sprite("foo")
where no sprite with that name exists returns a reference to sprite 1. If the movie
scriptExecutionStyle property is set to a value of 10, calling sprite("foo") where no sprite
with that name exists returns
VOID if called from Lingo or undefined if called from JavaScript.
Parameters
nameOrNum
Required. A string or integer that specifies the name or index position of the sprite.
Example
This statement sets the variable thisSprite to the sprite named Cave:
-- Lingo syntax
thisSprite = sprite("Cave")
// JavaScript syntax
var thisSprite = sprite("Cave");
See also
Sprite Channel
spriteSpaceToWorldSpace
Usage
sprite(whichSprite).camera.spriteSpaceToWorldSpace(loc)
sprite(whichSprite).camera(index).spriteSpaceToWorldSpace(loc)
Description
3D command; returns a world-space position that is found on the specified cameras projection
plane that corresponds to a location within the referenced sprite.
The projection plane is defined by the camera's X and Y axes, and is at a distance in front of the
camera such that one pixel represents one world unit of measurement. It is this projection plane
that is used for the sprite display on stage.
The
camera.spriteSpaceToWorldSpace() form of this command is a shortcut for using
camera(1).spriteSpaceToWorldSpace().
All cameras that are used by the referenced sprite will respond to the
spriteSpaceToWorldSpace
command as if their display rect is the same size as the sprite.