tk2dSpriteDefinition Class Reference

Sprite Definition. More...

List of all members.

Public Types

enum  ColliderType
 Collider type. More...
enum  PhysicsEngine
 Physics engine. More...

Public Member Functions

Bounds GetBounds ()
 Gets the trimmed bounds of the sprite.
Bounds GetUntrimmedBounds ()
 Gets untrimmed bounds of the sprite.

Public Attributes

string name
 Name.
Vector3[] positions
 Array of positions for sprite geometry.
Vector3[] normals
 Array of normals for sprite geometry, zero length array if they dont exist.
Vector4[] tangents
 Array of tangents for sprite geometry, zero length array if they dont exist.
Vector2[] uvs
 Array of UVs for sprite geometry, will match the position count.
int[] indices = new int[] { 0, 3, 1, 2, 3, 0 }
 Array of indices for sprite geometry.
Material material
 The material used by this sprite. This is generally the same on all sprites in a colletion, but this is not true when multi-atlas spanning is enabled.
int materialId
 The material id used by this sprite. This is an index into the materials array and corresponds to the material flag above.
string sourceTextureGUID
 Source texture GUID - this is used by the inspector to find the source image without adding a unity dependency.
bool extractRegion
 Speficies if this texture is extracted from a larger texture source, for instance an atlas. This is used in the inspector.
FlipMode flipped
 Specifies if this texture is flipped to its side (rotated) in the atlas.
bool complexGeometry = false
 Specifies if this texture has complex geometry.
PhysicsEngine physicsEngine = PhysicsEngine.Physics3D
 Physics engine.
ColliderType colliderType = ColliderType.Unset
 Collider type.
tk2dSpriteColliderDefinition[] customColliders = new tk2dSpriteColliderDefinition[0]
 Advanced custom colliders, set when colliderType == Advanced.
Vector3[] colliderVertices
 v0 and v1 are center and size respectively for box colliders when colliderType is Box. It is an array of vertices, and the geometry defined by indices when colliderType is Mesh.

Detailed Description

Sprite Definition.


Member Enumeration Documentation

Collider type.

Physics engine.


Member Function Documentation

Gets the trimmed bounds of the sprite.

Returns:
Local space bounds

Gets untrimmed bounds of the sprite.

Returns:
Local space untrimmed bounds

Member Data Documentation

Collider type.

v0 and v1 are center and size respectively for box colliders when colliderType is Box. It is an array of vertices, and the geometry defined by indices when colliderType is Mesh.

Specifies if this texture has complex geometry.

Advanced custom colliders, set when colliderType == Advanced.

Speficies if this texture is extracted from a larger texture source, for instance an atlas. This is used in the inspector.

Specifies if this texture is flipped to its side (rotated) in the atlas.

int [] tk2dSpriteDefinition.indices = new int[] { 0, 3, 1, 2, 3, 0 }

Array of indices for sprite geometry.

The material used by this sprite. This is generally the same on all sprites in a colletion, but this is not true when multi-atlas spanning is enabled.

The material id used by this sprite. This is an index into the materials array and corresponds to the material flag above.

Array of normals for sprite geometry, zero length array if they dont exist.

Physics engine.

Array of positions for sprite geometry.

Source texture GUID - this is used by the inspector to find the source image without adding a unity dependency.

Array of tangents for sprite geometry, zero length array if they dont exist.

Array of UVs for sprite geometry, will match the position count.