Public Types | |
enum | SPRITE_PLANE |
enum | ANCHOR_METHOD |
enum | WINDING_ORDER |
Public Member Functions | |
override void | Clear () |
Resets important sprite values to defaults for reuse. | |
void | Setup (float w, float h) |
Sets up the essential elements of a sprite. | |
void | Setup (float w, float h, Material material) |
Sets up the essential elements of a sprite. | |
override void | Copy (SpriteRoot s) |
Copies all the attributes of another sprite. | |
virtual void | CopyAll (SpriteRoot s) |
Copies all the attributes of another sprite, including its edit-time TextureAnimations. | |
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. | |
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. | |
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. | |
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. | |
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. | |
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. | |
void | PlayAnimInReverse (UVAnimation anim) |
Like PlayAnim, but plays the animation in reverse. See PlayAnim. | |
void | PlayAnimInReverse (UVAnimation anim, int frame) |
Like PlayAnim, but plays the animation in reverse. See PlayAnim. | |
override void | PlayAnimInReverse (int index) |
Like PlayAnim, but plays the animation in reverse. See PlayAnim. | |
void | PlayAnimInReverse (int index, int frame) |
Like PlayAnim, but plays the animation in reverse. See PlayAnim. | |
override void | PlayAnimInReverse (string name) |
Like PlayAnim, but plays the animation in reverse. See PlayAnim. | |
void | PlayAnimInReverse (string name, int frame) |
Like PlayAnim, but plays the animation in reverse. See PlayAnim. | |
void | DoAnim (int index) |
Plays the specified animation only if it is not already playing. | |
void | DoAnim (string name) |
Plays the specified animation only if it is not already playing. | |
void | DoAnim (UVAnimation anim) |
Plays the specified animation only if it is not already playing. | |
void | SetCurFrame (int index) |
Sets the current frame of the current animation immediately. | |
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. | |
void | UnpauseAnim () |
Resumes an animation from where it left off previously. | |
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. | |
UVAnimation | GetAnim (string name) |
Returns a reference to the animation that matches the name specified. | |
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. | |
override void | SetState (int index) |
Sets the sprite to the specified state/animation. | |
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. | |
virtual void | Copy (SpriteRoot s) |
Copies all the vital attributes of another sprite. | |
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. | |
void | SetAnimCompleteDelegate (AnimCompleteDelegate del) |
Sets the delegate to be called upon animation completion. | |
void | SetAnimFrameDelegate (AnimFrameDelegate del) |
Sets the delegate to be called each frame of animation. | |
void | SetSpriteResizedDelegate (SpriteResizedDelegate del) |
Sets the delegate to be called when the sprite is resized. | |
void | AddSpriteResizedDelegate (SpriteResizedDelegate del) |
Adds the delegate to be called when the sprite is resized. | |
void | RemoveSpriteresizedDelegate (SpriteResizedDelegate del) |
Removes the specified delegate from the list of those to be called when the sprite is resized. | |
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. | |
void | PauseAnim () |
Pauses the currently-playing animation. | |
void | RevertToStatic () |
Reverts the sprite to its static (non-animating) default appearance. | |
bool | IsAnimating () |
Returns whether the sprite is currently animating. | |
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). | |
virtual void | SetSize (float w, float h) |
Sets the physical dimensions of the sprite in the plane selected. | |
virtual void | TruncateRight (float pct) |
Truncates the right edge of the sprite to the specified percentage. 1 == no truncation 0 == complete truncation. | |
virtual void | TruncateLeft (float pct) |
Truncates the left edge of the sprite to the specified percentage. 1 == no truncation 0 == complete truncation. | |
virtual void | TruncateTop (float pct) |
Truncates the top edge of the sprite to the specified percentage. 1 == no truncation 0 == complete truncation. | |
virtual void | TruncateBottom (float pct) |
Truncates the bottom edge of the sprite to the specified percentage. 1 == no truncation 0 == complete truncation. | |
virtual void | Untruncate () |
Removes any truncation. | |
virtual void | Unclip () |
Removes any clipping that is being applied to the sprite. | |
virtual void | UpdateUVs () |
Applies any changes to the UVs to the actual sprite mesh. | |
virtual void | SetColor (Color c) |
Sets the sprite's color to the specified color. | |
void | CalcPixelToUV () |
Recalculates the pixel-to-UV ratio based on the current texture. | |
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. | |
void | SetMaterial (Material mat) |
Changes the material to be used by the sprite. NOTE: This can only be used with non-managed sprites. | |
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. | |
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. | |
virtual void | SetCamera (Camera c) |
Sets the camera to use when calculating a pixel-perfect sprite size. | |
bool | IsHidden () |
Returns whether the sprite is currently set to be hideAtStart (whether its mesh renderer component is enabled). | |
void | SetBleedCompensation (float x, float y) |
Sets the bleed compensation to use (see bleedCompensation). | |
void | SetBleedCompensation (Vector2 xy) |
Sets the bleed compensation to use (see bleedCompensation). | |
void | SetPlane (SPRITE_PLANE p) |
Sets the plane in which the sprite is to be drawn. See: SPRITE_PLANE. | |
void | SetWindingOrder (WINDING_ORDER order) |
Sets the winding order to use. See WINDING_ORDER. | |
void | SetDrawLayer (int layer) |
Sets the draw layer of the sprite (only applies to managed sprites). | |
void | SetFrameInfo (SPRITE_FRAME fInfo) |
Sets the sprite's frame info, which includes UVs, offsets, etc. | |
void | SetUVs (Rect uv) |
Sets the sprite's UVs to the specified values. | |
void | SetUVsFromPixelCoords (Rect pxCoords) |
Sets the sprite's UVs from pixel coordinates. | |
Rect | GetUVs () |
Returns the current UV coordinates of the sprite (before bleed compensation). | |
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. | |
Vector3 | GetCenterPoint () |
Gets the center point of the sprite, taking into account the actual positions of vertices. | |
void | SetAnchor (ANCHOR_METHOD a) |
Sets the anchor method to use. See ANCHOR_METHOD. | |
void | SetOffset (Vector3 o) |
Sets the offset of the sprite from its GameObject. See offset. | |
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()! | |
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()! | |
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()! | |
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()! | |
Public Attributes | |
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. | |
UVAnimation[] | animations |
Holds the actual UV sequences that will be used at run-time. | |
bool | playAnimOnStart = false |
When set to true, the sprite will play the default animation (see defaultAnim) when the sprite is instantiated. | |
int | defaultAnim = 0 |
Index of the animation to play by default. | |
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). | |
SpriteManager | manager |
Reference to the manager which will manage this sprite, provided managed is set to true. | |
int | drawLayer |
The layer in which the sprite will be drawn if managed. | |
bool | persistent = false |
This must be set to true at design time for the sprite to survive loading a new level. | |
SPRITE_PLANE | plane = SPRITE_PLANE.XY |
The plane in which the sprite will be drawn. | |
WINDING_ORDER | winding = WINDING_ORDER.CW |
The winding order of the sprite's polygons - determines the direction the sprite will "face". | |
float | width |
Width of the sprite in world space. | |
float | height |
Height of the sprite in world space. | |
Vector2 | bleedCompensation |
Will contract the UV edges of the sprite by the specified amount to prevent "bleeding" from neighboring pixels, especially when mipmapping. | |
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. | |
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. | |
Vector3 | offset = new Vector3() |
Offsets the sprite, in world space, from the center of its GameObject. | |
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. | |
bool | hideAtStart = false |
Whether the sprite will be hideAtStart when it starts. | |
bool | ignoreClipping = false |
When true, the sprite will not be clipped. | |
Properties | |
abstract TextureAnim[] | States [get, set] |
Accessor for the sprite's various states as defined in the editor (not used at runtime). | |
virtual CSpriteFrame | DefaultFrame [get] |
Gets the default frame of the sprite object. This is the appearance the sprite is to have in the editor. | |
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. | |
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. | |
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. | |
Color | Color [get, set] |
Accessor for the object's current overall color tint. | |
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. | |
Vector2 | PixelSize [get, set] |
Gets/Sets the width and height of the sprite in pixels as it appears on-screen. | |
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. | |
bool | Managed [get, set] |
Sets the sprite to a managed or batched state. | |
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. | |
virtual bool | Clipped [get, set] |
Accessor for whether the sprite is to be clipped by any already-specified clipping rect. | |
ANCHOR_METHOD | Anchor [get, set] |
Accessor for the object's anchor method. | |
Vector3 | UnclippedTopLeft [get] |
The top-left corner of the sprite when no clipping or trimming is applied. | |
Vector3 | UnclippedBottomRight [get] |
The bottom-right corner of the sprite when no clipping or trimming is applied. | |
Vector3 | TopLeft [get] |
Returns the position of the top-left vertex of the sprite after any clipping or trimming. | |
Vector3 | BottomRight [get] |
Returns the position of the bottom-right vertex of the sprite after any clipping or trimming. |
Serves as a base for all "packable" sprite types. That is, all sprites which are defined by one or more source textures, which then get "packed" into an atlas.
enum SpriteRoot::ANCHOR_METHOD [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.
enum SpriteRoot::SPRITE_PLANE [inherited] |
The plane in which a sprite should be drawn.
enum SpriteRoot::WINDING_ORDER [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".
void SpriteBase.AddSpriteResizedDelegate | ( | SpriteResizedDelegate | del | ) | [inherited] |
Adds the delegate to be called when the sprite is resized.
del | A delegate to be called when the sprite is resized. |
delegate void SpriteBase.AnimCompleteDelegate | ( | SpriteBase | sprite | ) | [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. |
delegate void SpriteBase.AnimFrameDelegate | ( | SpriteBase | sprite, | |
int | frame | |||
) | [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) |
void SpriteRoot.CalcPixelToUV | ( | ) | [inherited] |
Recalculates the pixel-to-UV ratio based on the current texture.
void SpriteRoot.CalcSize | ( | ) | [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).
override void AutoSpriteBase.Clear | ( | ) | [virtual] |
Resets important sprite values to defaults for reuse.
Reimplemented from SpriteBase.
virtual void SpriteRoot.Copy | ( | SpriteRoot | s | ) | [virtual, inherited] |
Copies all the vital attributes of another sprite.
s | Source sprite to be copied. |
override void AutoSpriteBase.Copy | ( | SpriteRoot | s | ) |
Copies all the attributes of another sprite.
s | A reference to the sprite to be copied. |
Reimplemented from SpriteBase.
Reimplemented in UIBtnChangePanel, UIBtnLoadScene, UIBtnWWW, UIButton, UIListItem, UIPanelTab, UIProgressBar, UIRadioBtn, UISlider, UIStateToggleBtn, UITextField, AutoSpriteControlBase, and PackedSprite.
virtual void AutoSpriteBase.CopyAll | ( | SpriteRoot | s | ) | [virtual] |
Copies all the attributes of another sprite, including its edit-time TextureAnimations.
s | A reference to the sprite to be copied. |
override void SpriteBase.Delete | ( | ) | [virtual, inherited] |
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.
void AutoSpriteBase.DoAnim | ( | UVAnimation | anim | ) |
Plays the specified animation only if it is not already playing.
anim | Reference to the animation to play. |
void AutoSpriteBase.DoAnim | ( | string | name | ) |
Plays the specified animation only if it is not already playing.
name | Name of the animation to play. |
void AutoSpriteBase.DoAnim | ( | int | index | ) |
Plays the specified animation only if it is not already playing.
index | Index of the animation to play. |
UVAnimation AutoSpriteBase.GetAnim | ( | string | name | ) |
Returns a reference to the animation that matches the name specified.
name | Name of the animation sought. |
Vector3 SpriteRoot.GetCenterPoint | ( | ) | [inherited] |
Gets the center point of the sprite, taking into account the actual positions of vertices.
UVAnimation AutoSpriteBase.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.
override int AutoSpriteBase.GetStateIndex | ( | string | stateName | ) | [virtual] |
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.
Rect SpriteRoot.GetUVs | ( | ) | [inherited] |
Returns the current UV coordinates of the sprite (before bleed compensation).
Vector3 [] SpriteRoot.GetVertices | ( | ) | [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.
override void SpriteBase.Hide | ( | bool | tf | ) | [virtual, inherited] |
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.
Reimplemented in UIListItem, UIProgressBar, UISlider, UITextField, and AutoSpriteControlBase.
bool SpriteBase.IsAnimating | ( | ) | [inherited] |
Returns whether the sprite is currently animating.
bool SpriteRoot.IsHidden | ( | ) | [inherited] |
Returns whether the sprite is currently set to be hideAtStart (whether its mesh renderer component is enabled).
void SpriteBase.PauseAnim | ( | ) | [inherited] |
Pauses the currently-playing animation.
Vector2 SpriteRoot.PixelCoordToUVCoord | ( | int | x, | |
int | y | |||
) | [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. |
Vector2 SpriteRoot.PixelCoordToUVCoord | ( | Vector2 | xy | ) | [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. |
Vector2 SpriteRoot.PixelSpaceToUVSpace | ( | int | x, | |
int | y | |||
) | [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. |
Vector2 SpriteRoot.PixelSpaceToUVSpace | ( | Vector2 | xy | ) | [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. |
override void AutoSpriteBase.PlayAnim | ( | string | name | ) | [virtual] |
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.
void AutoSpriteBase.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.
name | The name of the animation to play. | |
frame | The zero-based index of the frame at which to start playing. |
override void AutoSpriteBase.PlayAnim | ( | int | index | ) | [virtual] |
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.
void AutoSpriteBase.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.
index | Index of the animation to play. | |
frame | The zero-based index of the frame at which to start playing. |
void AutoSpriteBase.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.
anim | A reference to the animation to play. |
void AutoSpriteBase.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.
anim | A reference to the animation to play. | |
frame | The zero-based index of the frame at which to start playing. |
void AutoSpriteBase.PlayAnimInReverse | ( | string | name, | |
int | frame | |||
) |
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. |
override void AutoSpriteBase.PlayAnimInReverse | ( | string | name | ) | [virtual] |
Like PlayAnim, but plays the animation in reverse. See PlayAnim.
name | Name of the animation to play in reverse. |
Reimplemented from SpriteBase.
void AutoSpriteBase.PlayAnimInReverse | ( | int | index, | |
int | frame | |||
) |
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. |
override void AutoSpriteBase.PlayAnimInReverse | ( | int | index | ) | [virtual] |
Like PlayAnim, but plays the animation in reverse. See PlayAnim.
index | Index of the animation to play in reverse. |
Reimplemented from SpriteBase.
void AutoSpriteBase.PlayAnimInReverse | ( | UVAnimation | anim, | |
int | frame | |||
) |
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. |
void AutoSpriteBase.PlayAnimInReverse | ( | UVAnimation | anim | ) |
Like PlayAnim, but plays the animation in reverse. See PlayAnim.
anim | Reference to the animation to play in reverse. |
void SpriteBase.RemoveSpriteresizedDelegate | ( | SpriteResizedDelegate | del | ) | [inherited] |
Removes the specified delegate from the list of those to be called when the sprite is resized.
del | The delegate to be removed. |
void SpriteBase.RevertToStatic | ( | ) | [inherited] |
Reverts the sprite to its static (non-animating) default appearance.
void SpriteRoot.SetAnchor | ( | ANCHOR_METHOD | a | ) | [inherited] |
Sets the anchor method to use. See ANCHOR_METHOD.
a | The anchor method to use. |
void SpriteBase.SetAnimCompleteDelegate | ( | AnimCompleteDelegate | del | ) | [inherited] |
Sets the delegate to be called upon animation completion.
del | The delegate to be called when an animation finishes playing. |
void SpriteBase.SetAnimFrameDelegate | ( | AnimFrameDelegate | del | ) | [inherited] |
Sets the delegate to be called each frame of animation.
del | The delegate to be called each frame of animation. |
void SpriteRoot.SetBleedCompensation | ( | Vector2 | xy | ) | [inherited] |
Sets the bleed compensation to use (see bleedCompensation).
void SpriteRoot.SetBleedCompensation | ( | float | x, | |
float | y | |||
) | [inherited] |
Sets the bleed compensation to use (see bleedCompensation).
virtual void SpriteRoot.SetCamera | ( | Camera | c | ) | [virtual, inherited] |
Sets the camera to use when calculating a pixel-perfect sprite size.
c |
Reimplemented in AutoSpriteControlBase.
void SpriteRoot.SetCamera | ( | ) | [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.
virtual void SpriteRoot.SetColor | ( | Color | c | ) | [virtual, inherited] |
Sets the sprite's color to the specified color.
c | Color to shade the sprite. |
Reimplemented in UIProgressBar, and UISlider.
void AutoSpriteBase.SetCurFrame | ( | int | index | ) |
Sets the current frame of the current animation immediately.
index | Zero-based index of the desired frame. |
void SpriteRoot.SetDrawLayer | ( | int | layer | ) | [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. |
void SpriteRoot.SetFrameInfo | ( | SPRITE_FRAME | fInfo | ) | [inherited] |
Sets the sprite's frame info, which includes UVs, offsets, etc.
fInfo | A SPRITE_FRAME structure containing the frame info. |
void SpriteBase.SetFramerate | ( | float | fps | ) | [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. |
void SpriteRoot.SetMaterial | ( | Material | mat | ) | [inherited] |
Changes the material to be used by the sprite. NOTE: This can only be used with non-managed sprites.
mat | The new material. |
void SpriteRoot.SetOffset | ( | Vector3 | o | ) | [inherited] |
Sets the offset of the sprite from its GameObject. See offset.
o | The offset to use. |
void SpriteRoot.SetPlane | ( | SPRITE_PLANE | p | ) | [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. |
virtual void SpriteRoot.SetSize | ( | float | w, | |
float | h | |||
) | [virtual, inherited] |
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. |
Reimplemented in UIProgressBar, and UISlider.
void SpriteBase.SetSpriteResizedDelegate | ( | SpriteResizedDelegate | del | ) | [inherited] |
Sets the delegate to be called when the sprite is resized.
del | The delegate to be called when the sprite is resized. |
override void AutoSpriteBase.SetState | ( | int | index | ) | [virtual] |
Sets the sprite to the specified state/animation.
index | The zero-based index of the desired state/animation. |
Implements SpriteRoot.
void SpriteRoot.SetTexture | ( | Texture2D | tex | ) | [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. |
void AutoSpriteBase.Setup | ( | float | w, | |
float | h, | |||
Material | material | |||
) |
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. |
void AutoSpriteBase.Setup | ( | float | w, | |
float | h | |||
) |
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. |
void SpriteRoot.SetUVs | ( | Rect | uv | ) | [inherited] |
Sets the sprite's UVs to the specified values.
nextFrame | A Rect containing the new UV coordinates. |
void SpriteRoot.SetUVsFromPixelCoords | ( | Rect | pxCoords | ) | [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. |
void SpriteRoot.SetWindingOrder | ( | WINDING_ORDER | order | ) | [inherited] |
Sets the winding order to use. See WINDING_ORDER.
order | The winding order to use. |
delegate void SpriteRoot.SpriteResizedDelegate | ( | float | newWidth, | |
float | newHeight, | |||
SpriteRoot | sprite | |||
) | [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.
override void AutoSpriteBase.StopAnim | ( | ) | [virtual] |
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.
virtual void SpriteRoot.TruncateBottom | ( | float | pct | ) | [virtual, inherited] |
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) |
Reimplemented in UIListItem, and AutoSpriteControlBase.
virtual void SpriteRoot.TruncateLeft | ( | float | pct | ) | [virtual, inherited] |
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) |
Reimplemented in UIListItem, and AutoSpriteControlBase.
virtual void SpriteRoot.TruncateRight | ( | float | pct | ) | [virtual, inherited] |
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) |
Reimplemented in UIListItem, and AutoSpriteControlBase.
virtual void SpriteRoot.TruncateTop | ( | float | pct | ) | [virtual, inherited] |
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) |
Reimplemented in UIListItem, and AutoSpriteControlBase.
virtual void SpriteRoot.Unclip | ( | ) | [virtual, inherited] |
Removes any clipping that is being applied to the sprite.
Reimplemented in UIProgressBar, UISlider, UITextField, and AutoSpriteControlBase.
void AutoSpriteBase.UnpauseAnim | ( | ) |
Resumes an animation from where it left off previously.
virtual void SpriteRoot.Untruncate | ( | ) | [virtual, inherited] |
Removes any truncation.
Reimplemented in UIListItem, and AutoSpriteControlBase.
void SpriteRoot.UpdateCamera | ( | ) | [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.
virtual void SpriteRoot.UpdateUVs | ( | ) | [virtual, inherited] |
Applies any changes to the UVs to the actual sprite mesh.
ANCHOR_METHOD SpriteRoot.anchor = ANCHOR_METHOD.TEXTURE_OFFSET [inherited] |
Holds the actual UV sequences that will be used at run-time.
bool SpriteRoot.autoResize = false [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.
Vector2 SpriteRoot.bleedCompensation [inherited] |
Will contract the UV edges of the sprite by the specified amount to prevent "bleeding" from neighboring pixels, especially when mipmapping.
Color SpriteRoot.color = Color.white [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.
int SpriteBase.defaultAnim = 0 [inherited] |
Index of the animation to play by default.
bool AutoSpriteBase.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.
int SpriteRoot.drawLayer [inherited] |
The layer in which the sprite will be drawn if managed.
float SpriteRoot.height [inherited] |
Height of the sprite in world space.
bool SpriteRoot.hideAtStart = false [inherited] |
Whether the sprite will be hideAtStart when it starts.
bool SpriteRoot.ignoreClipping = false [inherited] |
When true, the sprite will not be clipped.
bool SpriteRoot.managed = false [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).
SpriteManager SpriteRoot.manager [inherited] |
Reference to the manager which will manage this sprite, provided managed is set to true.
Vector3 SpriteRoot.offset = new Vector3() [inherited] |
Offsets the sprite, in world space, from the center of its GameObject.
bool SpriteRoot.persistent = false [inherited] |
This must be set to true at design time for the sprite to survive loading a new level.
bool SpriteRoot.pixelPerfect = false [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.
SPRITE_PLANE SpriteRoot.plane = SPRITE_PLANE.XY [inherited] |
The plane in which the sprite will be drawn.
bool SpriteBase.playAnimOnStart = false [inherited] |
When set to true, the sprite will play the default animation (see defaultAnim) when the sprite is instantiated.
float SpriteRoot.width [inherited] |
Width of the sprite in world space.
WINDING_ORDER SpriteRoot.winding = WINDING_ORDER.CW [inherited] |
The winding order of the sprite's polygons - determines the direction the sprite will "face".
ANCHOR_METHOD SpriteRoot.Anchor [get, set, inherited] |
Accessor for the object's anchor method.
bool SpriteBase.Animating [get, set, inherited] |
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.
Vector3 SpriteRoot.BottomRight [get, inherited] |
Returns the position of the bottom-right vertex of the sprite after any clipping or trimming.
virtual bool SpriteRoot.Clipped [get, set, inherited] |
Accessor for whether the sprite is to be clipped by any already-specified clipping rect.
Reimplemented in UIProgressBar, UISlider, UITextField, and AutoSpriteControlBase.
virtual Rect3D SpriteRoot.ClippingRect [get, set, inherited] |
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.
Reimplemented in UIProgressBar, UISlider, UITextField, and AutoSpriteControlBase.
Color SpriteRoot.Color [get, set, inherited] |
Accessor for the object's current overall color tint.
int SpriteBase.CurAnimIndex [get, set, inherited] |
Property useful for use with EZ Game Saver. Include this as a saved property, along with Animating, so that any playing animation is resumed.
virtual CSpriteFrame AutoSpriteBase.DefaultFrame [get] |
Gets the default frame of the sprite object. This is the appearance the sprite is to have in the editor.
Reimplemented in UIRadioBtn, UIStateToggleBtn, and PackedSprite.
virtual bool AutoSpriteBase.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.
Vector2 SpriteRoot.ImageSize [get, inherited] |
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.
bool SpriteRoot.Managed [get, set, inherited] |
Sets the sprite to a managed or batched state.
Vector2 SpriteRoot.PixelSize [get, set, inherited] |
Gets/Sets the width and height of the sprite in pixels as it appears on-screen.
virtual Camera SpriteRoot.RenderCamera [get, set, inherited] |
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.
Reimplemented in AutoSpriteControlBase.
abstract TextureAnim [] AutoSpriteBase.States [get, set] |
Accessor for the sprite's various states as defined in the editor (not used at runtime).
Reimplemented in UIButton, UIProgressBar, UIRadioBtn, UISlider, UIStateToggleBtn, UITextField, and PackedSprite.
Vector3 SpriteRoot.TopLeft [get, inherited] |
Returns the position of the top-left vertex of the sprite after any clipping or trimming.
Vector3 SpriteRoot.UnclippedBottomRight [get, inherited] |
The bottom-right corner of the sprite when no clipping or trimming is applied.
Vector3 SpriteRoot.UnclippedTopLeft [get, inherited] |
The top-left corner of the sprite when no clipping or trimming is applied.