Class used for animations in Spritemap.
More...
|
| Anim (int[] frames, float[] frameDelays=null) |
| Creates a new Anim with an array of ints for frames, and an array of floats for frameDelays. More...
|
|
| Anim (string frames, string frameDelays) |
| Creates a new Anim with a string of ints for frames, and a string of floats for frameDelays. More...
|
|
Anim | Repeat (int times=-1) |
| Determines how many times this animation loops. -1 for infinite. More...
|
|
Anim | NoRepeat () |
| Disables repeating. Animations default to repeat on. More...
|
|
Anim | PingPong (bool pingpong=true) |
| Determines if the animation will repeat by going back and forth between the start and end. More...
|
|
Anim | Speed (float speed) |
| Determines the playback speed of the animation. 1 = 1 frame. More...
|
|
Anim | LoopBackTo (int frame=0) |
| Determines which frame the animation will loop back to when it repeats. More...
|
|
Anim | Stop () |
| Stops the animation and returns it to the first frame. More...
|
|
Anim | Reset () |
| Resets the animation back to frame 0 but does not stop it. More...
|
|
void | Update (float t=1f) |
| Updates the Anim object. Handled by the Spritemap usually. If this doesn't run the animation will not play. More...
|
|
|
static int[] | FramesRange (int min, int max) |
| Returns an array of numbers from min to max. Useful for passing in arguments for long animations. More...
|
|
static int[] | ParseFrames (string input) |
| Creates an array of frames from a string expression. The expression must be similar to the following format: "0,3,7-11,2,5" Whitespace is permitted, and commas are optional.
- Parameters
-
input | A string formatted as above, describing the frames to generate. |
More...
|
|
|
Action | OnComplete = delegate { } |
| An action to run when the animation finishes playing. More...
|
|
Action | OnNewFrame = delegate { } |
| An action that is called when the Anim switches to a new frame. More...
|
|
bool | Active |
| Determines if the animation is active (playing.) More...
|
|
Class used for animations in Spritemap.
Otter.Anim.Anim |
( |
int[] |
frames, |
|
|
float[] |
frameDelays = null |
|
) |
| |
Creates a new Anim with an array of ints for frames, and an array of floats for frameDelays.
- Parameters
-
frames | The frames from the sprite sheet to display. |
frameDelays | The time that each frame should be displayed. |
Otter.Anim.Anim |
( |
string |
frames, |
|
|
string |
frameDelays |
|
) |
| |
Creates a new Anim with a string of ints for frames, and a string of floats for frameDelays.
- Parameters
-
frames | A string of frames separated by a delim character. Example: "0,1,2-7,9,11" |
frameDelays | A string of floats separated by a delim character. Example: "0.5f,1,0.5f,1" |
delim | The string of characters to parse the string by. Default is "," |
static int [] Otter.Anim.FramesRange |
( |
int |
min, |
|
|
int |
max |
|
) |
| |
|
static |
Returns an array of numbers from min to max. Useful for passing in arguments for long animations.
- Parameters
-
min | The start of the animation (includes this number.) |
max | The end of the animation (includes this number.) |
- Returns
- The array of ints representing an animation.
Anim Otter.Anim.LoopBackTo |
( |
int |
frame = 0 | ) |
|
Determines which frame the animation will loop back to when it repeats.
- Parameters
-
frame | The frame to loop back to (from 0 to frame count - 1) |
- Returns
- The anim object.
Anim Otter.Anim.NoRepeat |
( |
| ) |
|
Disables repeating. Animations default to repeat on.
- Returns
- The anim object.
static int [] Otter.Anim.ParseFrames |
( |
string |
input | ) |
|
|
static |
Creates an array of frames from a string expression. The expression must be similar to the following format: "0,3,7-11,2,5" Whitespace is permitted, and commas are optional.
- Parameters
-
input | A string formatted as above, describing the frames to generate. |
Anim Otter.Anim.PingPong |
( |
bool |
pingpong = true | ) |
|
Determines if the animation will repeat by going back and forth between the start and end.
- Parameters
-
pingpong | True for yes, false for no no no. |
- Returns
- The anim object.
Anim Otter.Anim.Repeat |
( |
int |
times = -1 | ) |
|
Determines how many times this animation loops. -1 for infinite.
- Parameters
-
times | How many times the animation should repeat. |
- Returns
- The anim object.
Anim Otter.Anim.Reset |
( |
| ) |
|
Resets the animation back to frame 0 but does not stop it.
- Returns
- The anim object.
Anim Otter.Anim.Speed |
( |
float |
speed | ) |
|
Determines the playback speed of the animation. 1 = 1 frame.
- Parameters
-
- Returns
- The anim object.
Stops the animation and returns it to the first frame.
- Returns
- The anim object.
void Otter.Anim.Update |
( |
float |
t = 1f | ) |
|
Updates the Anim object. Handled by the Spritemap usually. If this doesn't run the animation will not play.
- Parameters
-
Determines if the animation is active (playing.)
Action Otter.Anim.OnComplete = delegate { } |
An action to run when the animation finishes playing.
Action Otter.Anim.OnNewFrame = delegate { } |
An action that is called when the Anim switches to a new frame.
int Otter.Anim.CurrentFrame |
|
get |
The current frame of the animation.
int Otter.Anim.CurrentFrameIndex |
|
getset |
The current frame index of the animation.
int Otter.Anim.FrameCount |
|
get |
The total number of frames in this animation.
List<float> Otter.Anim.FrameDelays |
|
getset |
The frame delays used in the animation.
List<int> Otter.Anim.Frames |
|
getset |
The frames used in the animation.
float Otter.Anim.PlaybackSpeed |
|
getset |
The overall playback speed of the animation.
int Otter.Anim.RepeatCount |
|
getset |
The repeat count of the animation.
float Otter.Anim.TotalDuration |
|
get |
The total duration of the animation.
The documentation for this class was generated from the following file: