| Name | Type | Description |
|---|---|---|
json |
Object | optional Json object describing the sprite |
Properties:
| Name | Type | Argument | Default | Description |
|---|---|---|---|---|
Sprite.Y_AXIS |
THREE.Vector3 |
<optional> |
new THREE.Vector3(0, 1, 0) | The unit Y axis vector |
Sprite.X_AXIS |
THREE.Vector3 |
<optional> |
new THREE.Vector3(1, 0, 0) | The unit X axis vector |
Sprite.Z_AXIS |
THREE.Vector3 |
<optional> |
new THREE.Vector3(0, 0, 1) | The unit Z axis vector |
front |
boolean | Indicate if the sprite is in front (for layers) | ||
kind |
ElementMapKind | The element map kind | ||
textureRect |
Array.<number> | Texture UV coords |
Extends
Methods
-
Create a new sprite
Name Type Description kindElementMapKind The element map kind textureArray.<number> Texture UV coords -
Rotate a vertex around a specified center
Name Type Description vecTHREE.Vector3 The vertex to rotate centerTHREE.Vector3 The center to rotate around anglenumber The angle in degree axisTHREE.Vector3 The vector axis -
Rotate the four vertices of a sprite around a specified center
Name Type Description vecATHREE.Vector3 The A vertex to rotate vecBTHREE.Vector3 The B vertex to rotate vecCTHREE.Vector3 The C vertex to rotate vecDTHREE.Vector3 The D vertex to rotate centerTHREE.Vector3 The center to rotate around anglenumber The angle in degree axisTHREE.Vector3 The vector axis -
Add a static sprite to the geometry
Name Type Description geometryTHREE.Geometry The geometry vecATHREE.Vector3 The A vertex vecBTHREE.Vector3 The B vertex vecCTHREE.Vector3 The C vertex vecDTHREE.Vector3 The D vertex texFaceATHREE.Vector2 The texture face A texFaceBTHREE.Vector2 The texture face B countnumber The faces count Returns:
Type Description number -
read (json) overrides
-
Read the JSON associated to the sprite
Name Type Description jsonObject Json object describing the sprite -
Update the geometry associated to this
Name Type Description geometryTHREE.Geometry The geometry widthnumber The total texture width heightnumber The total texture height positionArray.<number> The json position countnumber The faces count tilesetboolean Indicate if the texture is tileset localPositionTHREE.Vector3 The local position Returns:
Type Description Array.<any> -
Create the geometry associated to this sprite
Name Type Description widthnumber The texture total width heightnumber The texture total height tilesetboolean Indicate if the texture is tileset positionArray.<number> The json position Returns:
Type Description Array.<any> -
Scale the vertices correctly
Name Type Description vecATHREE.Vector3 The A vertex to rotate vecBTHREE.Vector3 The B vertex to rotate vecCTHREE.Vector3 The C vertex to rotate vecDTHREE.Vector3 The D vertex to rotate centerTHREE.Vector3 The center to rotate around positionArray.<number> The json position sizeTHREE.Vector3 The scale size kindElementMapKind The element map kind