Public Types | |
enum | SPRITE_PLANE |
enum | ANCHOR_METHOD |
enum | WINDING_ORDER |
Public Member Functions | |
override void | Copy (SpriteRoot s) |
Copies all the attributes of another sprite. More... | |
void | AddAnimation (UVAnimation anim) |
Adds an animation to the sprite for its use. More... | |
override void | Aggregate (PathFromGUIDDelegate guid2Path, LoadAssetDelegate load, GUIDFromPathDelegate path2Guid) |
Collects all textures intended for packing, as well as sprite frames, together into a standard form for processing. More... | |
override void | Clear () |
Resets important sprite values to defaults for reuse. More... | |
void | Setup (float w, float h) |
Sets up the essential elements of a sprite. More... | |
void | Setup (float w, float h, Material material) |
Sets up the essential elements of a sprite. More... | |
virtual void | CopyAll (SpriteRoot s) |
Copies all the attributes of another sprite, including its edit-time TextureAnimations. More... | |
void | PlayAnim (UVAnimation anim, int frame) |
Starts playing the specified animation Note: this doesn't resume from a pause, it completely restarts the animation. To unpause, use UnpauseAnim. More... | |
void | PlayAnim (UVAnimation anim) |
Starts playing the specified animation Note: this doesn't resume from a pause, it completely restarts the animation. To unpause, use UnpauseAnim. More... | |
void | PlayAnim (int index, int frame) |
Starts playing the specified animation Note: this doesn't resume from a pause, it completely restarts the animation. To unpause, use UnpauseAnim. More... | |
override void | PlayAnim (int index) |
Starts playing the specified animation Note: this doesn't resume from a pause, it completely restarts the animation. To unpause, use UnpauseAnim. More... | |
void | PlayAnim (string name, int frame) |
Starts playing the specified animation Note: this doesn't resume from a pause, it completely restarts the animation. To unpause, use UnpauseAnim. More... | |
override void | PlayAnim (string name) |
Starts playing the specified animation Note: this doesn't resume from a pause, it completely restarts the animation. To unpause, use UnpauseAnim. More... | |
void | PlayAnimInReverse (UVAnimation anim) |
Like PlayAnim, but plays the animation in reverse. See PlayAnim. More... | |
void | PlayAnimInReverse (UVAnimation anim, int frame) |
Like PlayAnim, but plays the animation in reverse. See PlayAnim. More... | |
override void | PlayAnimInReverse (int index) |
Like PlayAnim, but plays the animation in reverse. See PlayAnim. More... | |
void | PlayAnimInReverse (int index, int frame) |
Like PlayAnim, but plays the animation in reverse. See PlayAnim. More... | |
override void | PlayAnimInReverse (string name) |
Like PlayAnim, but plays the animation in reverse. See PlayAnim. More... | |
void | PlayAnimInReverse (string name, int frame) |
Like PlayAnim, but plays the animation in reverse. See PlayAnim. More... | |
void | DoAnim (int index) |
Plays the specified animation only if it is not already playing. More... | |
void | DoAnim (string name) |
Plays the specified animation only if it is not already playing. More... | |
void | DoAnim (UVAnimation anim) |
Plays the specified animation only if it is not already playing. More... | |
void | SetCurFrame (int index) |
Sets the current frame of the current animation immediately. More... | |
void | SetFrame (UVAnimation anim, int frameNum) |
Sets the sprite to display the given frame of the specified animation. More... | |
void | SetFrame (string anim, int frameNum) |
Sets the sprite to display the given frame of the specified animation. More... | |
void | SetFrame (int anim, int frameNum) |
Sets the sprite to display the given frame of the specified animation. More... | |
override void | StopAnim () |
Stops the current animation from playing and resets it to the beginning for playing again. The sprite then reverts to the static image. More... | |
void | UnpauseAnim () |
Resumes an animation from where it left off previously. More... | |
UVAnimation | GetCurAnim () |
Returns a reference to the currently selected animation. NOTE: This does not mean the animation is currently playing. To determine whether the animation is playing, use IsAnimating More... | |
UVAnimation | GetAnim (string name) |
Returns a reference to the animation that matches the name specified. More... | |
override int | GetStateIndex (string stateName) |
Returns the index of the state with the specified name. -1 if no state matching the specified name is found. More... | |
override void | SetState (int index) |
Sets the sprite to the specified state/animation. More... | |
delegate void | AnimCompleteDelegate (SpriteBase sprite) |
delegate void | AnimFrameDelegate (SpriteBase sprite, int frame) |
override void | Delete () |
If non-managed, call Delete() before destroying this component or the GameObject to which it is attached. Memory leaks can ensue otherwise. More... | |
override void | Hide (bool tf) |
Hides or displays the sprite by disabling/enabling the sprite's mesh renderer component, or if managed, sets the mesh size to 0. More... | |
void | SetAnimCompleteDelegate (AnimCompleteDelegate del) |
Sets the delegate to be called upon animation completion. More... | |
void | SetAnimFrameDelegate (AnimFrameDelegate del) |
Sets the delegate to be called each frame of animation. More... | |
void | SetSpriteResizedDelegate (SpriteResizedDelegate del) |
Sets the delegate to be called when the sprite is resized. More... | |
void | AddSpriteResizedDelegate (SpriteResizedDelegate del) |
Adds the delegate to be called when the sprite is resized. More... | |
void | RemoveSpriteresizedDelegate (SpriteResizedDelegate del) |
Removes the specified delegate from the list of those to be called when the sprite is resized. More... | |
void | SetFramerate (float fps) |
Changes the framerate at which the current animation plays. NOTE: This only has effect if called AFTER PlayAnim() is called. Otherwise, PlayAnim() sets the framerate to whatever is specified in the animation itself. More... | |
void | PauseAnim () |
Pauses the currently-playing animation. More... | |
void | RevertToStatic () |
Reverts the sprite to its static (non-animating) default appearance. More... | |
bool | IsAnimating () |
Returns whether the sprite is currently animating. More... | |
delegate void | SpriteResizedDelegate (float newWidth, float newHeight, SpriteRoot sprite) |
void | CalcSize () |
Recalculates the width and height of the sprite based upon the change in its UV dimensions (autoResize) or on the current camera's disposition (pixelPerfect). More... | |
virtual void | SetSize (float w, float h) |
Sets the physical dimensions of the sprite in the plane selected More... | |
virtual void | TruncateRight (float pct) |
Truncates the right edge of the sprite to the specified percentage. 1 == no truncation 0 == complete truncation More... | |
virtual void | TruncateLeft (float pct) |
Truncates the left edge of the sprite to the specified percentage. 1 == no truncation 0 == complete truncation More... | |
virtual void | TruncateTop (float pct) |
Truncates the top edge of the sprite to the specified percentage. 1 == no truncation 0 == complete truncation More... | |
virtual void | TruncateBottom (float pct) |
Truncates the bottom edge of the sprite to the specified percentage. 1 == no truncation 0 == complete truncation More... | |
virtual void | Untruncate () |
Removes any truncation. More... | |
virtual void | Unclip () |
Removes any clipping that is being applied to the sprite. More... | |
virtual void | UpdateUVs () |
Applies any changes to the UVs to the actual sprite mesh. More... | |
virtual void | SetColor (Color c) |
Sets the sprite's color to the specified color. More... | |
void | CalcPixelToUV () |
Recalculates the pixel-to-UV ratio based on the current texture. More... | |
void | SetTexture (Texture2D tex) |
Changes the texture to be used by the sprite's material. NOTE: This will cause the sprite not to batch with other sprites and can only be used with non-managed sprites. More... | |
void | SetMaterial (Material mat) |
Changes the material to be used by the sprite. NOTE: This can only be used with non-managed sprites. More... | |
void | UpdateCamera () |
Updates any camera-dependent settings, such as the calculated pixel-perfect size. Use this with BroadcastMessage() to do bulk re-calculation of object sizes whenever your screensize/resolution changes at runtime. More... | |
void | SetCamera () |
A no-argument version of SetCamera() that simply re-assigns the same camera to the object, forcing it to recalculate all camera-dependent calculations. More... | |
virtual void | SetCamera (Camera c) |
Sets the camera to use when calculating a pixel-perfect sprite size. More... | |
bool | IsHidden () |
Returns whether the sprite is currently set to be hideAtStart (whether its mesh renderer component is enabled). More... | |
void | SetBleedCompensation (float x, float y) |
Sets the bleed compensation to use (see bleedCompensation). More... | |
void | SetBleedCompensation (Vector2 xy) |
Sets the bleed compensation to use (see bleedCompensation). More... | |
void | SetPlane (SPRITE_PLANE p) |
Sets the plane in which the sprite is to be drawn. See: SPRITE_PLANE More... | |
void | SetWindingOrder (WINDING_ORDER order) |
Sets the winding order to use. See WINDING_ORDER. More... | |
void | SetDrawLayer (int layer) |
Sets the draw layer of the sprite (only applies to managed sprites). More... | |
void | SetFrameInfo (SPRITE_FRAME fInfo) |
Sets the sprite's frame info, which includes UVs, offsets, etc. More... | |
void | SetUVs (Rect uv) |
Sets the sprite's UVs to the specified values. More... | |
void | SetUVsFromPixelCoords (Rect pxCoords) |
Sets the sprite's UVs from pixel coordinates. More... | |
Rect | GetUVs () |
Returns the current UV coordinates of the sprite (before bleed compensation). More... | |
Vector3[] | GetVertices () |
Returns a reference to the sprite's vertices. NOTE: You can only directly modify the sprite's vertices if it is a non-managed sprite. More... | |
Vector3 | GetCenterPoint () |
Gets the center point of the sprite, taking into account the actual positions of vertices. More... | |
void | SetAnchor (ANCHOR_METHOD a) |
Sets the anchor method to use. See ANCHOR_METHOD More... | |
void | SetOffset (Vector3 o) |
Sets the offset of the sprite from its GameObject. See offset More... | |
Vector2 | PixelSpaceToUVSpace (Vector2 xy) |
Converts pixel-space values to UV-space scalar values according to the currently assigned material. NOTE: This is for converting widths and heights-not coordinates (which have reversed Y-coordinates). For coordinates, use PixelCoordToUVCoord()! More... | |
Vector2 | PixelSpaceToUVSpace (int x, int y) |
Converts pixel-space values to UV-space scalar values according to the currently assigned material. NOTE: This is for converting widths and heights-not coordinates (which have reversed Y-coordinates). For coordinates, use PixelCoordToUVCoord()! More... | |
Vector2 | PixelCoordToUVCoord (Vector2 xy) |
Converts pixel coordinates to UV coordinates according to the currently assigned material. NOTE: This is for converting coordinates and will reverse the Y component accordingly. For converting widths and heights, use PixelSpaceToUVSpace()! More... | |
Vector2 | PixelCoordToUVCoord (int x, int y) |
Converts pixel coordinates to UV coordinates according to the currently assigned material. NOTE: This is for converting coordinates and will reverse the Y component accordingly. For converting widths and heights, use PixelSpaceToUVSpace()! More... | |
Static Public Member Functions | |
static PackedSprite | Create (string name, Vector3 pos) |
Creates a GameObject and attaches this component type to it. More... | |
static PackedSprite | Create (string name, Vector3 pos, Quaternion rotation) |
Creates a GameObject and attaches this component type to it. More... | |
Public Attributes | |
string | staticTexPath ="" |
TextureAnim[] | textureAnimations |
The animations as defined using individual textures. See TextureAnim More... | |
bool | doNotTrimImages = false |
When set to true, even if the "Trim Images" option is enabled in the atlas builder, the images for this object will not be trimmed. More... | |
UVAnimation[] | animations |
Holds the actual UV sequences that will be used at run-time. More... | |
bool | playAnimOnStart = false |
When set to true, the sprite will play the default animation (see defaultAnim) when the sprite is instantiated. More... | |
int | defaultAnim = 0 |
Index of the animation to play by default. More... | |
bool | managed = false |
When true, the sprite will be managed by the selected sprite manager script. When false, the sprite has its own mesh and will be batched automatically with other sprites (when available - Unity iPhone). More... | |
SpriteManager | manager |
Reference to the manager which will manage this sprite, provided managed is set to true. More... | |
int | drawLayer |
The layer in which the sprite will be drawn if managed. More... | |
bool | persistent = false |
This must be set to true at design time for the sprite to survive loading a new level. More... | |
SPRITE_PLANE | plane = SPRITE_PLANE.XY |
The plane in which the sprite will be drawn. More... | |
WINDING_ORDER | winding = WINDING_ORDER.CW |
The winding order of the sprite's polygons - determines the direction the sprite will "face". More... | |
float | width |
Width of the sprite in world space. More... | |
float | height |
Height of the sprite in world space. More... | |
Vector2 | bleedCompensation |
Will contract the UV edges of the sprite by the specified amount to prevent "bleeding" from neighboring pixels, especially when mipmapping. More... | |
ANCHOR_METHOD | anchor = ANCHOR_METHOD.TEXTURE_OFFSET |
Anchor method to use.
| |
bool | pixelPerfect = false |
Automatically sizes the sprite so that it will display pixel-perfect on-screen. NOTE: If you change the orthographic size of the camera or the distance between the sprite and a perspective camera, call SetCamera() to make the text pixel-perfect again. However, if you want automatic resizing functionality without being pixel-perfect and therefore allowing zooming in and out, use autoResize instead. More... | |
bool | autoResize = false |
Automatically resizes the sprite based on its new UV dimensions compared to its previous dimensions. Setting this to true allows you to use non-uniform sized sprites for animation without causing the sprite to appear "squashed" while animating. More... | |
Vector3 | offset = new Vector3() |
Offsets the sprite, in world space, from the center of its GameObject. More... | |
Color | color = Color.white |
The color to be used by all four of the sprite's vertices. This can be used to color, highlight, or fade the sprite. Be sure to use a vertex-colored shader for this to have an effect. More... | |
bool | hideAtStart = false |
Whether the sprite will be hideAtStart when it starts. More... | |
bool | ignoreClipping = false |
When true, the sprite will not be clipped. More... | |
Properties | |
virtual bool | DoNotTrimImages [get, set] |
When set to true, even if the "Trim Images" option is enabled in the atlas builder, the images for this object will not be trimmed. More... | |
bool | Animating [get, set] |
Property useful for use with EZ Game Saver. When it gets set, the current animation is started. Include this, along with CurAnimIndex, as a saved property so that any playing animation is resumed. More... | |
int | CurAnimIndex [get, set] |
Property useful for use with EZ Game Saver. Include this as a saved property, along with Animating, so that any playing animation is resumed. More... | |
Color | Color [get, set] |
Accessor for the object's current overall color tint. More... | |
virtual Camera | RenderCamera [get, set] |
Accessor for the camera that will be used to render this object. Use this to ensure the object is properly configured for the specific camera that will render it. More... | |
Vector2 | PixelSize [get, set] |
Gets/Sets the width and height of the sprite in pixels as it appears on-screen. More... | |
Vector2 | ImageSize [get] |
Gets the width and height of the image the sprite is displaying. NOTE: This is not the number of screen pixels occupied by the sprite, but rather the original number of texels which compose the sprite's image. More... | |
bool | Managed [get, set] |
Sets the sprite to a managed or batched state. More... | |
virtual Rect3D | ClippingRect [get, set] |
The rect against which the sprite should be clipped. The sprite will be immediately clipped by this rect when set. When setting, the rect should be in world space. More... | |
virtual bool | Clipped [get, set] |
Accessor for whether the sprite is to be clipped by any already-specified clipping rect. More... | |
ANCHOR_METHOD | Anchor [get, set] |
Accessor for the object's anchor method. More... | |
Vector3 | UnclippedTopLeft [get] |
The top-left corner of the sprite when no clipping or trimming is applied. More... | |
Vector3 | UnclippedBottomRight [get] |
The bottom-right corner of the sprite when no clipping or trimming is applied. More... | |
Vector3 | TopLeft [get] |
Returns the position of the top-left vertex of the sprite after any clipping or trimming. More... | |
Vector3 | BottomRight [get] |
Returns the position of the bottom-right vertex of the sprite after any clipping or trimming. More... | |
This implements SpriteBase and adds animation functionality allowing the user to define their sprite animations using individual, non-uniform sprite textures which will then be compiled into a sprite atlas automatically.
Definition at line 20 of file PackedSprite.cs.
|
inherited |
The anchoring scheme of a sprite. The anchor point is the point on the sprite that will remain stationary when the sprite's size changes. For a health bar that "grows" to the right while its left edge remains stationary, you would use UPPER_LEFT, MIDDLE_LEFT, or BOTTOM_LEFT.
For a health bar that "grows" upward while the bottom edge remains stationary, you would use BOTTOM_LEFT, BOTTOM_CENTER, or BOTTOM_RIGHT.
Definition at line 651 of file SpriteRoot.cs.
|
inherited |
The plane in which a sprite should be drawn.
Definition at line 633 of file SpriteRoot.cs.
|
inherited |
Defines which way the polygons of a sprite should be wound. The two options are clock-wise (CW) and counter clock-wise (CCW). These determine the direction the sprite will "face".
Definition at line 673 of file SpriteRoot.cs.
void PackedSprite.AddAnimation | ( | UVAnimation | anim | ) |
Adds an animation to the sprite for its use.
anim | The animation to add |
Definition at line 182 of file PackedSprite.cs.
|
inherited |
Adds the delegate to be called when the sprite is resized.
del | A delegate to be called when the sprite is resized. |
Definition at line 1475 of file SpriteBase.cs.
|
virtual |
Collects all textures intended for packing, as well as sprite frames, together into a standard form for processing.
Reimplemented from AutoSpriteBase.
Definition at line 199 of file PackedSprite.cs.
|
inherited |
Defines a delegate that can be called upon animation completion. Use this if you want something to happen as soon as an animation reaches the end. Receives a reference to the sprite.
sprite | A reference to the sprite whose animation has finished. |
|
inherited |
Defines a delegate that can be called once for each frame of animation. Use this if you want something to happen on an animation frame. Receives a reference to the sprite and the zero-based index of the current frame as an argument.
sprite | A reference to the sprite which is calling the delegate. |
frame | The current animation frame number. (0-based) |
|
inherited |
Recalculates the pixel-to-UV ratio based on the current texture.
Definition at line 1775 of file SpriteRoot.cs.
|
inherited |
Recalculates the width and height of the sprite based upon the change in its UV dimensions (autoResize) or on the current camera's disposition (pixelPerfect).
Definition at line 1350 of file SpriteRoot.cs.
|
virtualinherited |
Resets important sprite values to defaults for reuse.
Reimplemented from SpriteRoot.
Definition at line 256 of file AutoSpriteBase.cs.
|
virtual |
Copies all the attributes of another sprite.
s | A reference to the sprite to be copied. |
Reimplemented from SpriteRoot.
Definition at line 127 of file PackedSprite.cs.
|
virtualinherited |
Copies all the attributes of another sprite, including its edit-time TextureAnimations.
s | A reference to the sprite to be copied. |
Definition at line 341 of file AutoSpriteBase.cs.
|
static |
Creates a GameObject and attaches this component type to it.
name | Name to give to the new GameObject. |
pos | Position, in world space, where the new object should be created. |
Definition at line 270 of file PackedSprite.cs.
|
static |
Creates a GameObject and attaches this component type to it.
name | Name to give to the new GameObject. |
pos | Position, in world space, where the new object should be created. |
rotation | Rotation of the object. |
Definition at line 285 of file PackedSprite.cs.
|
virtualinherited |
If non-managed, call Delete() before destroying this component or the GameObject to which it is attached. Memory leaks can ensue otherwise.
Reimplemented from SpriteRoot.
Definition at line 1342 of file SpriteBase.cs.
|
inherited |
Plays the specified animation only if it is not already playing.
index | Index of the animation to play. |
Definition at line 907 of file AutoSpriteBase.cs.
|
inherited |
Plays the specified animation only if it is not already playing.
name | Name of the animation to play. |
Definition at line 920 of file AutoSpriteBase.cs.
|
inherited |
Plays the specified animation only if it is not already playing.
anim | Reference to the animation to play. |
Definition at line 933 of file AutoSpriteBase.cs.
|
inherited |
Returns a reference to the animation that matches the name specified.
name | Name of the animation sought. |
Definition at line 1084 of file AutoSpriteBase.cs.
|
inherited |
Gets the center point of the sprite, taking into account the actual positions of vertices.
Definition at line 2207 of file SpriteRoot.cs.
|
inherited |
Returns a reference to the currently selected animation. NOTE: This does not mean the animation is currently playing. To determine whether the animation is playing, use IsAnimating
Definition at line 1076 of file AutoSpriteBase.cs.
|
virtualinherited |
Returns the index of the state with the specified name. -1 if no state matching the specified name is found.
stateName | The name of the state sought. |
Implements SpriteRoot.
Definition at line 1097 of file AutoSpriteBase.cs.
|
inherited |
Returns the current UV coordinates of the sprite (before bleed compensation).
Definition at line 2183 of file SpriteRoot.cs.
|
inherited |
Returns a reference to the sprite's vertices. NOTE: You can only directly modify the sprite's vertices if it is a non-managed sprite.
Definition at line 2194 of file SpriteRoot.cs.
|
virtualinherited |
Hides or displays the sprite by disabling/enabling the sprite's mesh renderer component, or if managed, sets the mesh size to 0.
tf | When true, the sprite is hideAtStart, when false, the sprite will be displayed. |
Reimplemented from SpriteRoot.
Definition at line 1403 of file SpriteBase.cs.
|
inherited |
Returns whether the sprite is currently animating.
Definition at line 1566 of file SpriteBase.cs.
|
inherited |
Returns whether the sprite is currently set to be hideAtStart (whether its mesh renderer component is enabled).
Definition at line 1942 of file SpriteRoot.cs.
|
inherited |
Pauses the currently-playing animation.
Definition at line 1515 of file SpriteBase.cs.
|
inherited |
Converts pixel coordinates to UV coordinates according to the currently assigned material. NOTE: This is for converting coordinates and will reverse the Y component accordingly. For converting widths and heights, use PixelSpaceToUVSpace()!
xy | The coordinates to convert. |
Definition at line 2457 of file SpriteRoot.cs.
|
inherited |
Converts pixel coordinates to UV coordinates according to the currently assigned material. NOTE: This is for converting coordinates and will reverse the Y component accordingly. For converting widths and heights, use PixelSpaceToUVSpace()!
x | The x-coordinate to convert. |
y | The y-coordinate to convert. |
Definition at line 2475 of file SpriteRoot.cs.
|
inherited |
Converts pixel-space values to UV-space scalar values according to the currently assigned material. NOTE: This is for converting widths and heights-not coordinates (which have reversed Y-coordinates). For coordinates, use PixelCoordToUVCoord()!
xy | The values to convert. |
Definition at line 2425 of file SpriteRoot.cs.
|
inherited |
Converts pixel-space values to UV-space scalar values according to the currently assigned material. NOTE: This is for converting widths and heights-not coordinates (which have reversed Y-coordinates). For coordinates, use PixelCoordToUVCoord()!
x | The X-value to convert. |
y | The Y-value to convert. |
Definition at line 2443 of file SpriteRoot.cs.
|
inherited |
Starts playing the specified animation Note: this doesn't resume from a pause, it completely restarts the animation. To unpause, use UnpauseAnim.
anim | A reference to the animation to play. |
frame | The zero-based index of the frame at which to start playing. |
Definition at line 558 of file AutoSpriteBase.cs.
|
inherited |
Starts playing the specified animation Note: this doesn't resume from a pause, it completely restarts the animation. To unpause, use UnpauseAnim.
anim | A reference to the animation to play. |
Definition at line 635 of file AutoSpriteBase.cs.
|
inherited |
Starts playing the specified animation Note: this doesn't resume from a pause, it completely restarts the animation. To unpause, use UnpauseAnim.
index | Index of the animation to play. |
frame | The zero-based index of the frame at which to start playing. |
Definition at line 649 of file AutoSpriteBase.cs.
|
virtualinherited |
Starts playing the specified animation Note: this doesn't resume from a pause, it completely restarts the animation. To unpause, use UnpauseAnim.
index | Index of the animation to play. |
Reimplemented from SpriteBase.
Definition at line 667 of file AutoSpriteBase.cs.
|
inherited |
Starts playing the specified animation Note: this doesn't resume from a pause, it completely restarts the animation. To unpause, use UnpauseAnim.
name | The name of the animation to play. |
frame | The zero-based index of the frame at which to start playing. |
Definition at line 686 of file AutoSpriteBase.cs.
|
virtualinherited |
Starts playing the specified animation Note: this doesn't resume from a pause, it completely restarts the animation. To unpause, use UnpauseAnim.
name | The name of the animation to play. |
Reimplemented from SpriteBase.
Definition at line 707 of file AutoSpriteBase.cs.
|
inherited |
Like PlayAnim, but plays the animation in reverse. See PlayAnim.
anim | Reference to the animation to play in reverse. |
Definition at line 717 of file AutoSpriteBase.cs.
|
inherited |
Like PlayAnim, but plays the animation in reverse. See PlayAnim.
anim | Reference to the animation to play in reverse. |
frame | The zero-based index of the frame at which to start playing. |
Definition at line 778 of file AutoSpriteBase.cs.
|
virtualinherited |
Like PlayAnim, but plays the animation in reverse. See PlayAnim.
index | Index of the animation to play in reverse. |
Reimplemented from SpriteBase.
Definition at line 832 of file AutoSpriteBase.cs.
|
inherited |
Like PlayAnim, but plays the animation in reverse. See PlayAnim.
index | Index of the animation to play in reverse. |
frame | The zero-based index of the frame at which to start playing. |
Definition at line 849 of file AutoSpriteBase.cs.
|
virtualinherited |
Like PlayAnim, but plays the animation in reverse. See PlayAnim.
name | Name of the animation to play in reverse. |
Reimplemented from SpriteBase.
Definition at line 865 of file AutoSpriteBase.cs.
|
inherited |
Like PlayAnim, but plays the animation in reverse. See PlayAnim.
name | Name of the animation to play in reverse. |
frame | The zero-based index of the frame at which to start playing. |
Definition at line 886 of file AutoSpriteBase.cs.
|
inherited |
Removes the specified delegate from the list of those to be called when the sprite is resized.
del | The delegate to be removed. |
Definition at line 1484 of file SpriteBase.cs.
|
inherited |
Reverts the sprite to its static (non-animating) default appearance.
Definition at line 1538 of file SpriteBase.cs.
|
inherited |
Sets the anchor method to use. See ANCHOR_METHOD
a | The anchor method to use. |
Definition at line 2287 of file SpriteRoot.cs.
|
inherited |
Sets the delegate to be called upon animation completion.
del | The delegate to be called when an animation finishes playing. |
Definition at line 1448 of file SpriteBase.cs.
|
inherited |
Sets the delegate to be called each frame of animation.
del | The delegate to be called each frame of animation. |
Definition at line 1457 of file SpriteBase.cs.
|
inherited |
Sets the bleed compensation to use (see bleedCompensation).
Definition at line 2059 of file SpriteRoot.cs.
|
inherited |
Sets the bleed compensation to use (see bleedCompensation).
Definition at line 2064 of file SpriteRoot.cs.
|
inherited |
A no-argument version of SetCamera() that simply re-assigns the same camera to the object, forcing it to recalculate all camera-dependent calculations.
Definition at line 1857 of file SpriteRoot.cs.
|
virtualinherited |
Sets the camera to use when calculating a pixel-perfect sprite size.
c |
Definition at line 1869 of file SpriteRoot.cs.
|
virtualinherited |
Sets the sprite's color to the specified color.
c | Color to shade the sprite. |
Definition at line 1723 of file SpriteRoot.cs.
|
inherited |
Sets the current frame of the current animation immediately.
index | Zero-based index of the desired frame. |
Definition at line 943 of file AutoSpriteBase.cs.
|
inherited |
Sets the draw layer of the sprite (only applies to managed sprites).
layer | The draw layer of the sprite. Lower values cause an earlier draw order, higher values, a later draw order. |
Definition at line 2105 of file SpriteRoot.cs.
|
inherited |
Sets the sprite to display the given frame of the specified animation.
anim | The animation containing the desired frame. |
frameNum | The 0-based index of the frame to be displayed. |
Definition at line 961 of file AutoSpriteBase.cs.
|
inherited |
Sets the sprite to display the given frame of the specified animation.
anim | The animation containing the desired frame. |
frameNum | The 0-based index of the frame to be displayed. |
Definition at line 975 of file AutoSpriteBase.cs.
|
inherited |
Sets the sprite to display the given frame of the specified animation.
anim | The 0-based index of the animation containing the desired frame. |
frameNum | The 0-based index of the frame to be displayed. |
Definition at line 989 of file AutoSpriteBase.cs.
|
inherited |
Sets the sprite's frame info, which includes UVs, offsets, etc.
fInfo | A SPRITE_FRAME structure containing the frame info. |
Definition at line 2121 of file SpriteRoot.cs.
|
inherited |
Changes the framerate at which the current animation plays. NOTE: This only has effect if called AFTER PlayAnim() is called. Otherwise, PlayAnim() sets the framerate to whatever is specified in the animation itself.
fps | The new framerate, in frames per second. |
Definition at line 1506 of file SpriteBase.cs.
|
inherited |
Changes the material to be used by the sprite. NOTE: This can only be used with non-managed sprites.
mat | The new material. |
Definition at line 1813 of file SpriteRoot.cs.
|
inherited |
Sets the offset of the sprite from its GameObject. See offset
o | The offset to use. |
Definition at line 2309 of file SpriteRoot.cs.
|
inherited |
Sets the plane in which the sprite is to be drawn. See: SPRITE_PLANE
p | The plane in which the sprite should be drawn. |
Definition at line 2082 of file SpriteRoot.cs.
|
virtualinherited |
Sets the physical dimensions of the sprite in the plane selected
width | Width of the sprite in world space. |
height | Height of the sprite in world space. |
Definition at line 1384 of file SpriteRoot.cs.
|
inherited |
Sets the delegate to be called when the sprite is resized.
del | The delegate to be called when the sprite is resized. |
Definition at line 1466 of file SpriteBase.cs.
|
virtualinherited |
Sets the sprite to the specified state/animation.
index | The zero-based index of the desired state/animation. |
Implements SpriteRoot.
Definition at line 1110 of file AutoSpriteBase.cs.
|
inherited |
Changes the texture to be used by the sprite's material. NOTE: This will cause the sprite not to batch with other sprites and can only be used with non-managed sprites.
tex | The new texture. |
Definition at line 1795 of file SpriteRoot.cs.
|
inherited |
Sets up the essential elements of a sprite.
w | The width, in local space, of the sprite. |
h | The height, in local space, of the sprite. |
Definition at line 273 of file AutoSpriteBase.cs.
|
inherited |
Sets up the essential elements of a sprite.
w | The width, in local space, of the sprite. |
h | The height, in local space, of the sprite. |
material | The material to use for the sprite. |
Definition at line 284 of file AutoSpriteBase.cs.
|
inherited |
Sets the sprite's UVs to the specified values.
nextFrame | A Rect containing the new UV coordinates. |
Definition at line 2136 of file SpriteRoot.cs.
|
inherited |
Sets the sprite's UVs from pixel coordinates.
pxCoords | A rect containing the pixel coordinates. When populating the Rect, use the following syntax: Rect.MinMaxRect(leftCoord, bottomCoord, rightCoord, topCoord) Where the coordinates are in pixel space. Like in any image editor, the coordinate space runs from 0 on the left to width-1 on the right, and 0 at the top, to height-1 at the bottom. |
Definition at line 2161 of file SpriteRoot.cs.
|
inherited |
Sets the winding order to use. See WINDING_ORDER.
order | The winding order to use. |
Definition at line 2092 of file SpriteRoot.cs.
|
inherited |
Defines a delegate that can be called upon resizing of the sprite. Use this if you want to adjust colliders, etc, when the sprites dimensions are resized.
|
virtualinherited |
Stops the current animation from playing and resets it to the beginning for playing again. The sprite then reverts to the static image.
Reimplemented from SpriteBase.
Definition at line 1003 of file AutoSpriteBase.cs.
|
virtualinherited |
Truncates the bottom edge of the sprite to the specified percentage. 1 == no truncation 0 == complete truncation
pct | The percentage of the sprite to truncate (0-1) |
Definition at line 1599 of file SpriteRoot.cs.
|
virtualinherited |
Truncates the left edge of the sprite to the specified percentage. 1 == no truncation 0 == complete truncation
pct | The percentage of the sprite to truncate (0-1) |
Definition at line 1555 of file SpriteRoot.cs.
|
virtualinherited |
Truncates the right edge of the sprite to the specified percentage. 1 == no truncation 0 == complete truncation
pct | The percentage of the sprite to truncate (0-1) |
Definition at line 1533 of file SpriteRoot.cs.
|
virtualinherited |
Truncates the top edge of the sprite to the specified percentage. 1 == no truncation 0 == complete truncation
pct | The percentage of the sprite to truncate (0-1) |
Definition at line 1577 of file SpriteRoot.cs.
|
virtualinherited |
Removes any clipping that is being applied to the sprite.
Definition at line 1636 of file SpriteRoot.cs.
|
inherited |
Resumes an animation from where it left off previously.
Definition at line 1022 of file AutoSpriteBase.cs.
|
virtualinherited |
Removes any truncation.
Definition at line 1618 of file SpriteRoot.cs.
|
inherited |
Updates any camera-dependent settings, such as the calculated pixel-perfect size. Use this with BroadcastMessage() to do bulk re-calculation of object sizes whenever your screensize/resolution changes at runtime.
Definition at line 1847 of file SpriteRoot.cs.
|
virtualinherited |
Applies any changes to the UVs to the actual sprite mesh.
Definition at line 1654 of file SpriteRoot.cs.
|
inherited |
|
inherited |
Holds the actual UV sequences that will be used at run-time.
Definition at line 157 of file AutoSpriteBase.cs.
|
inherited |
Automatically resizes the sprite based on its new UV dimensions compared to its previous dimensions. Setting this to true allows you to use non-uniform sized sprites for animation without causing the sprite to appear "squashed" while animating.
Definition at line 771 of file SpriteRoot.cs.
|
inherited |
Will contract the UV edges of the sprite by the specified amount to prevent "bleeding" from neighboring pixels, especially when mipmapping.
Definition at line 744 of file SpriteRoot.cs.
|
inherited |
The color to be used by all four of the sprite's vertices. This can be used to color, highlight, or fade the sprite. Be sure to use a vertex-colored shader for this to have an effect.
Definition at line 824 of file SpriteRoot.cs.
|
inherited |
Index of the animation to play by default.
Definition at line 1297 of file SpriteBase.cs.
|
inherited |
When set to true, even if the "Trim Images" option is enabled in the atlas builder, the images for this object will not be trimmed.
Definition at line 149 of file AutoSpriteBase.cs.
|
inherited |
The layer in which the sprite will be drawn if managed.
Definition at line 711 of file SpriteRoot.cs.
|
inherited |
Height of the sprite in world space.
Definition at line 737 of file SpriteRoot.cs.
|
inherited |
Whether the sprite will be hideAtStart when it starts.
Definition at line 856 of file SpriteRoot.cs.
|
inherited |
When true, the sprite will not be clipped.
Definition at line 868 of file SpriteRoot.cs.
|
inherited |
When true, the sprite will be managed by the selected sprite manager script. When false, the sprite has its own mesh and will be batched automatically with other sprites (when available - Unity iPhone).
Definition at line 696 of file SpriteRoot.cs.
|
inherited |
Reference to the manager which will manage this sprite, provided managed is set to true.
Definition at line 702 of file SpriteRoot.cs.
|
inherited |
Offsets the sprite, in world space, from the center of its GameObject.
Definition at line 816 of file SpriteRoot.cs.
|
inherited |
This must be set to true at design time for the sprite to survive loading a new level.
Definition at line 716 of file SpriteRoot.cs.
|
inherited |
Automatically sizes the sprite so that it will display pixel-perfect on-screen. NOTE: If you change the orthographic size of the camera or the distance between the sprite and a perspective camera, call SetCamera() to make the text pixel-perfect again. However, if you want automatic resizing functionality without being pixel-perfect and therefore allowing zooming in and out, use autoResize instead.
Definition at line 762 of file SpriteRoot.cs.
|
inherited |
The plane in which the sprite will be drawn.
Definition at line 721 of file SpriteRoot.cs.
|
inherited |
When set to true, the sprite will play the default animation (see defaultAnim) when the sprite is instantiated.
Definition at line 1284 of file SpriteBase.cs.
string PackedSprite.staticTexPath ="" |
Texture to use for the sprite before animating.
Definition at line 26 of file PackedSprite.cs.
TextureAnim [] PackedSprite.textureAnimations |
The animations as defined using individual textures. See TextureAnim
Definition at line 42 of file PackedSprite.cs.
|
inherited |
Width of the sprite in world space.
Definition at line 732 of file SpriteRoot.cs.
|
inherited |
The winding order of the sprite's polygons - determines the direction the sprite will "face".
Definition at line 727 of file SpriteRoot.cs.
|
getsetinherited |
Accessor for the object's anchor method.
Definition at line 2298 of file SpriteRoot.cs.
|
getsetinherited |
Property useful for use with EZ Game Saver. When it gets set, the current animation is started. Include this, along with CurAnimIndex, as a saved property so that any playing animation is resumed.
Definition at line 1575 of file SpriteBase.cs.
|
getinherited |
Returns the position of the bottom-right vertex of the sprite after any clipping or trimming.
Definition at line 2369 of file SpriteRoot.cs.
|
getsetinherited |
Accessor for whether the sprite is to be clipped by any already-specified clipping rect.
Definition at line 2265 of file SpriteRoot.cs.
|
getsetinherited |
The rect against which the sprite should be clipped. The sprite will be immediately clipped by this rect when set. When setting, the rect should be in world space.
Definition at line 2233 of file SpriteRoot.cs.
|
getsetinherited |
Accessor for the object's current overall color tint.
Definition at line 1736 of file SpriteRoot.cs.
|
getsetinherited |
Property useful for use with EZ Game Saver. Include this as a saved property, along with Animating, so that any playing animation is resumed.
Definition at line 1592 of file SpriteBase.cs.
|
getsetinherited |
When set to true, even if the "Trim Images" option is enabled in the atlas builder, the images for this object will not be trimmed.
Definition at line 1170 of file AutoSpriteBase.cs.
|
getinherited |
Gets the width and height of the image the sprite is displaying. NOTE: This is not the number of screen pixels occupied by the sprite, but rather the original number of texels which compose the sprite's image.
Definition at line 1970 of file SpriteRoot.cs.
|
getsetinherited |
Sets the sprite to a managed or batched state.
Definition at line 1979 of file SpriteRoot.cs.
|
getsetinherited |
Gets/Sets the width and height of the sprite in pixels as it appears on-screen.
Definition at line 1956 of file SpriteRoot.cs.
|
getsetinherited |
Accessor for the camera that will be used to render this object. Use this to ensure the object is properly configured for the specific camera that will render it.
Definition at line 1831 of file SpriteRoot.cs.
|
getinherited |
Returns the position of the top-left vertex of the sprite after any clipping or trimming.
Definition at line 2354 of file SpriteRoot.cs.
|
getinherited |
The bottom-right corner of the sprite when no clipping or trimming is applied.
Definition at line 2337 of file SpriteRoot.cs.
|
getinherited |
The top-left corner of the sprite when no clipping or trimming is applied.
Definition at line 2320 of file SpriteRoot.cs.