SPA (SPrite Animation) is a custom file format which holds optimized sprite animations and also supports alpha. As it's a custom format, we also have a freely available tool on the website which will encode a series of images into an .SPA file. Important Note: You must add .bytes onto the end of any .spa file in your Resources folder, otherwise it won't work! (e.g. countdown.spa.bytes).
Public Member Functions | |
| SPA (string name, int frameWidth, int frameHeight, int frameRate) | |
| Creates a new empty SPA animation. More... | |
| void | ChangeFrameRate (int newRate) |
| Changes the framerate of this animation. More... | |
| void | CreateSprites (int spriteCount, uint frameCount) |
| Creates space for the given number of sprites which hold the given total number of frames. More... | |
| SPA (string name, byte[] binaryData) | |
| Creates a new SPA animation with the given name from the given binary data. More... | |
| SPAInstance | GetInstance () |
| Creates a playable instance of this animation. Instances are required as the same animation could be visible multiple times. More... | |
Static Public Member Functions | |
| static void | Clear () |
| Clears all active SPA animations. More... | |
| static SPA | Get (string name) |
| Gets an already loaded SPA from the cache. More... | |
| static int | ActiveCount () |
| Gets how many animations are actively playing. More... | |
| static void | Update () |
| Advances playback of any running animations and performs some garbage collection. Called by UI.Update. More... | |
Public Attributes | |
| int | FrameRate |
| The frame rate in frames/second. More... | |
| int | FrameWidth |
| The width of a frame. More... | |
| int | FrameHeight |
| The height of a frame. More... | |
| uint | FrameCount |
| The number of frames in this animation. More... | |
| SPASprite[] | Sprites |
| The set of sprites (images) in this animation. Note that a sprite can hold more than 1 frame. More... | |
Static Public Attributes | |
| static SPAInstance | LastInstance |
| The tail of the linked list of actively playing animations. More... | |
| static SPAInstance | FirstInstance |
| The head of the linked list of actively playing animations. More... | |
Properties | |
| static Shader | IsolationShader [get] |
| The shader used to "isolate" things like animations from everything else. More... | |
| SPASprite | this[int id] [get] |
| Gets a sprite with the given ID. More... | |
Static Private Attributes | |
| static Shader | RawIsolationShader |
| The shader used to "isolate" things like animations from everything else. More... | |
| static Dictionary< string, SPA > | Instances =new Dictionary<string,SPA>() |
| A cache of all loaded SPA animations. If the garbage truck is active, it clears this. More... | |
|
inline |
|
inline |
Creates a new SPA animation with the given name from the given binary data.
| name | The name of the animation. Used for caching purposes so the binary doesn't have to be reloaded if the animation is displayed multiple times. |
| binaryData | The raw binary data of the spa file. |
|
inlinestatic |
Gets how many animations are actively playing.
|
inline |
Changes the framerate of this animation.
|
inlinestatic |
Clears all active SPA animations.
|
inline |
Creates space for the given number of sprites which hold the given total number of frames.
| spriteCount | The number of sprites. |
| frameCount | The total number of frames held by the sprites. |
|
inlinestatic |
|
inline |
Creates a playable instance of this animation. Instances are required as the same animation could be visible multiple times.
|
inlinestatic |
Advances playback of any running animations and performs some garbage collection. Called by UI.Update.
|
static |
The head of the linked list of actively playing animations.
| uint PowerUI.SPA.FrameCount |
The number of frames in this animation.
| int PowerUI.SPA.FrameHeight |
The height of a frame.
| int PowerUI.SPA.FrameRate |
The frame rate in frames/second.
| int PowerUI.SPA.FrameWidth |
The width of a frame.
A cache of all loaded SPA animations. If the garbage truck is active, it clears this.
|
static |
The tail of the linked list of actively playing animations.
|
staticprivate |
The shader used to "isolate" things like animations from everything else.
| SPASprite [] PowerUI.SPA.Sprites |
The set of sprites (images) in this animation. Note that a sprite can hold more than 1 frame.
|
staticget |
The shader used to "isolate" things like animations from everything else.
|
get |
Gets a sprite with the given ID.