3D Lingo Dictionary > T-Z > worldSpaceToSpriteSpace |  |

worldSpaceToSpriteSpace

Syntax

    member(whichCastmember).camera(whichCamera).worldSpaceToSpriteSpace(vector)

Description

3D command; returns the point within the camera's rect at which the world-relative position specified by `vector` would appear. The position returned by this command is relative to the upper left corner of the camera's rect.

If the position specified is out of view of the camera, this command returns `void`.

Example

This statement shows that the world origin, specified by vector (0, 0, 0), appears at point (250,281) within the camera's rect.

    put sprite(5).camera.worldSpaceToSpriteSpace(vector(0, 0, 0))
    -- point(250, 281)

See also

`spriteSpaceToWorldSpace`, `rect`