Z.ScreenTransform

Inherits from Z.Group

Description

Z.ScreenTransform is a node with a coordinate system mapped to the screen of the device. Nodes relative to a Z.ScreenTransform node will appear flat on the screen.

Holding the device in landscape, screen space has the following coordinate system:

  • it is centered at the middle of the screen;
  • its X coordinate is positive to the right;
  • its Y coordinate is positive towards the top of the screen;
  • its Z coordinate is positive out of the screen towards the user;

Screen space is scaled such that a Y value of +1 is always at the top of the screen and a Y value of -1 is at the bottom of the screen.

Screen space is orthographic. This means that objects appear the same size regardless of how far they are from the camera (i.e. regardless of their Z coordinate).

A global instance of this object is available as Z.screen.

For more information see Coordinate Systems.

Provided by Z.ScreenTransform

Constructor

Z.ScreenTransform( ) Constructs a new Z.ScreenTransform object.

Events

resize Emitted when the device screen changes size.

Functions

depth( ) Gets the range of z-coordinate values that map to the depth buffer.
depth(...) Sets the range of z-coordinate values that map to the depth buffer.
zoom( ) Gets the zoom of the transform.
zoom(...) Sets the zoom of the transform.

Inherited from Z.Group

Constructor

Z.Group( ) Constructs a new Z.Group object.

Functions

child(...) Gets the child node at the specified index.
children( ) Gets the children of the group.
clear( ) Removes all children from the group.
insert(...) Inserts a node into the group at the specified index.
push(...) Inserts a node as the last child of the group.
remove(...) Removes a node from the group.

Inherited from Z.Node

Functions

blend( ) Gets the type of blending used to render this object.
blend(...) Sets the type of blending used to render this object
color( ) Gets the color of the node.
color(...) Sets the color of the node.
cullFaces( ) Gets the type of culling to performed on this object.
cullFaces(...) Sets the type of culling to performed on this object.
enabled( ) Gets the value of enabled for the node.
enabled(...) Sets the value of enabled for the node.
position( ) Gets the position of the node.
position(...) Sets the position of the node
relativeTo( ) Gets an array of nodes that this node's location is relative to.
relativeTo(...) Sets the node(s) that this node's location is relative to.
relativeToProp( ) Gets the ratio of contributions that the nodes specified by relativeTo have on this node's location.
relativeToProp(...) Sets the ratio of contributions that the nodes specified by relativeTo have on this node's location.
rotation( ) Gets the rotation of the node.
rotation(...) Sets the rotation of the node.
scale( ) Gets the scale of the node.
scale(...) Sets the scale of the node.
visible( ) Gets the visibility of the node.
visible(...) Sets the visibility of this node.

Inherited from Z.Base

Functions

emit(...) Calls the handler functions attached to an event.
hasTag(...) Returns true if this object has the specified tag.
off(...) Removes a handler function from an event.
on(...) Attaches a handler function to an event.
one(...) Attaches a single-use handler function to an event.
pushTag(...) Adds a tag to this object.
removeTag(...) Removes a tag from this object.
tags( ) Gets an array of the tags that this object belongs to.
tags(...) Sets the array of the tags that this object belongs to.
zapcode branded_zapcode i