Animations
Functions
Animation Count
Returns the number of Animation
s within an Animation Script
.
Parameters:
Name | Type | Description |
---|---|---|
script | Animation Script | The Animation Script to count the animations in. |
Return Type: Integer
Signatures:
Animation Current Cell
Returns the current cell (the part of the image or sprite) of this animation. This can be used to animate an image or sprite.
Parameters:
Name | Type | Description |
---|---|---|
anim | Animation | The Animation to return the cell of. |
Return Type: Integer
Signatures:
Animation Current Vector
Returns the Vector 2d
assigned to the current frame in the animation.
Parameters:
Name | Type | Description |
---|---|---|
anim | Animation | The animation to check the vector of. |
Return Type: Vector 2d
Signatures:
Animation Ended
Checks if an Animation
has ended.
Parameters:
Name | Type | Description |
---|---|---|
anim | Animation | The animation to check. |
Return Type: Boolean
Signatures:
Animation Entered Frame
Returns true if the Animation
entered a new frame on its last update. This can be used to trigger actions on frames within an animation.
Parameters:
Name | Type | Description |
---|---|---|
anim | Animation | The animation to check. |
Return Type: Boolean
Signatures:
Animation Frame Time
Returns the amount of time spent in the current frame. When this exceeds the frames duration the animation moves to the next frame.
Parameters:
Name | Type | Description |
---|---|---|
anim | Animation | The animation to check. |
Return Type: Float
Signatures:
Animation Index
Searches an Animation Script
for an Animation
and returns its index.
Parameters:
Name | Type | Description |
---|---|---|
script | Animation Script | The Animation Script to look for the Animation in. |
name | String | The name of the Animation to look for. |
Return Type: Integer
Signatures:
Animation Name
Searches an Animation Script
for an animation and returns its name.
Parameters:
Name | Type | Description |
---|---|---|
temp | Animation | The Animation to search for. |
Return Type: String
Usage:
Signatures:
Animation Script Name
Retuns the name of an Animation Script
.
Parameters:
Name | Type | Description |
---|---|---|
script | Animation Script | The Animation Script to return the name of. |
Return Type: String
Signatures:
Animation Script Named
Loads and returns a Animation Script
. The supplied filename is used to locate the Animation Script
to load. The supplied name indicates the name to use to refer to this in SplashKit. The Animation Script
can then be retrieved by passing this name to the animation_script_named method.
Parameters:
Name | Type | Description |
---|---|---|
name | String | Indicates the name used to locate the animation_script to load |
Return Type: Animation Script
Usage:
Signatures:
Assign Animation
Assign Animation
Setup an Animation
to follow the script from an indicated name. This will switch the animation to use the supplied script. It locates the name of the animation with the animation script and sets the anim
to start at that point in the script.
Parameters:
Name | Type | Description |
---|---|---|
anim | Animation | The Animation to be assigned. |
script | Animation Script | The Animation Script to assign the Animation to. |
name | String | The name of the Animation to be assigned. |
Signatures:
Assign Animation
Assigns an Animation
to an Animation Script
. This may play a sound effect if the animation is set to play a sound effect on its first frame.
Parameters:
Name | Type | Description |
---|---|---|
anim | Animation | The Animation to be assigned. |
script | Animation Script | The Animation Script to assign the Animation to. |
name | String | The name of the Animation to be assigned. |
with_sound | Boolean | Denotes whether the Animation should play audio. |
Signatures:
Assign Animation
Assigns an Animation
to an Animation Script
.
Parameters:
Name | Type | Description |
---|---|---|
anim | Animation | The Animation to be assigned. |
script | Animation Script | The Animation Script to assign the Animation to. |
idx | Integer | The index of the Animation to create. |
Signatures:
Assign Animation
Assigns an Animation
to an Animation Script
. This may play a sound effect if the animation is set to play a sound effect on its first frame.
Parameters:
Name | Type | Description |
---|---|---|
anim | Animation | The Animation to be assigned. |
script | Animation Script | The Animation Script to assign the Animation to. |
idx | Integer | The index of the Animation to create. |
with_sound | Boolean | Denotes whether the Animation should play audio. |
Signatures:
Assign Animation
Assigns an Animation
to an Animation Script
.
Parameters:
Name | Type | Description |
---|---|---|
anim | Animation | The Animation to be assigned. |
script_name | String | The name of the Animation Script to assign the Animation to. |
name | String | The name of the Animation to be assigned. |
Signatures:
Assign Animation
Assigns an Animation
to an Animation Script
. This may play a sound effect if the animation is set to play a sound effect on its first frame.
Parameters:
Name | Type | Description |
---|---|---|
anim | Animation | The Animation to be assigned. |
script_name | String | The name of the Animation Script to assign the Animation to. |
name | String | The name of the Animation to be assigned |
with_sound | Boolean | Denotes whether the Animation should play audio. |
Signatures:
Assign Animation
Setup an Animation
to follow the script from an indicated index. This uses the index from the current animation script and sets the supplied animation to start at that point in the script.
Parameters:
Name | Type | Description |
---|---|---|
anim | Animation | The Animation to be assigned. |
idx | Integer | The index of the animation to use from its current script. |
Signatures:
Assign Animation
Setup an Animation
to follow the script from an indicated index. This uses the index from the current animation script and sets the supplied animation to start at that point in the script.
Parameters:
Name | Type | Description |
---|---|---|
anim | Animation | The Animation to be assigned. |
idx | Integer | The index of the animation to use from its current script. |
with_sound | Boolean | Denotes whether the Animation should play audio. |
Signatures:
Assign Animation
Setup an Animation
to follow the script from an indicated name. This locates the name of the animation from the current animation script and sets the supplied animation to start at that point in the script.
Parameters:
Name | Type | Description |
---|---|---|
anim | Animation | The Animation to be assigned. |
name | String | The name of the animation to use from its current script. |
Usage:
Signatures:
Assign Animation
Setup an Animation
to follow the script from an indicated name. This locates the name of the animation from the current animation script and sets the supplied animation to start at that point in the script.
Parameters:
Name | Type | Description |
---|---|---|
anim | Animation | The Animation to be assigned. |
name | String | The name of the animation to use from its current script. |
with_sound | Boolean | Denotes whether the Animation should play audio. |
Signatures:
Create Animation
Create Animation
Creates an animation from an Animation Script
. This may play a sound effect if the animation is set to play a sound effect on its first frame.
Parameters:
Name | Type | Description |
---|---|---|
script | Animation Script | The Animation Script to create the Animation from. |
idx | Integer | The index of the Animation to create. |
with_sound | Boolean | Denotes whether the Animation should play audio. |
Return Type: Animation
Signatures:
Create Animation
Creates an animation from an Animation Script
.
Parameters:
Name | Type | Description |
---|---|---|
script | Animation Script | The Animation Script to create the Animation from |
name | String | The name for the new Animation |
Return Type: Animation
Signatures:
Create Animation
Creates an animation from a Animation Script
. This may play a sound effect if the animation is set to play a sound effect on its first frame.
Parameters:
Name | Type | Description |
---|---|---|
script | Animation Script | The Animation Script to create the Animation from |
name | String | The name for the new Animation |
with_sound | Boolean | Denotes whether the Animation should play audio. |
Return Type: Animation
Signatures:
Create Animation
Creates an animation from an Animation Script
’s name. This may play a sound effect if the animation is set to play a sound effect on its first frame.
Parameters:
Name | Type | Description |
---|---|---|
script_name | String | The name of the Animation Script to create the Animation from |
name | String | The name for the new Animation |
Return Type: Animation
Usage:
Signatures:
Create Animation
Creates an animation from an Animation Script
’s name. This may play a sound effect if the animation is set to play a sound effect on its first frame.
Parameters:
Name | Type | Description |
---|---|---|
script_name | String | The name of the Animation Script to create the Animation from |
name | String | The name for the new Animation |
with_sound | Boolean | Denotes whether the Animation should play audio. |
Return Type: Animation
Signatures:
Free All Animation Scripts
Frees all loaded Animation Script
s.
Signatures:
Free Animation
Disposes of the resources used in the animation.
Parameters:
Name | Type | Description |
---|---|---|
ani | Animation | The Animation to be disposed of. |
Signatures:
Free Animation Script
Free Animation Script
Frees loaded animation frames data. Use this when you will no longer be using the animation for any purpose, including within sprite.
Parameters:
Name | Type | Description |
---|---|---|
script_to_free | Animation Script | The Animation Script to be freed. |
Signatures:
Free Animation Script
Frees loaded Animation Script
data. Use this when you will no longer be using the animation for any purpose, including within sprite.
Parameters:
Name | Type | Description |
---|---|---|
name | String | The name of the Animation Script to be freed. |
Signatures:
Has Animation Named
Returns whether an Animation Script
has been loaded with the given name.
Parameters:
Name | Type | Description |
---|---|---|
script | Animation Script | The Animation Script to check. |
name | String | The name of the Animation Script to look for. |
Return Type: Boolean
Signatures:
Has Animation Script
Determines if SplashKit has animation frames loaded for the supplied name. This checks against all loaded animation frames, those loaded without a name are assigned the filename as a default.
Parameters:
Name | Type | Description |
---|---|---|
name | String | The name of the animation script to look for. |
Return Type: Boolean
Signatures:
Load Animation Script
Load animation details from an animation frames file.
Parameters:
Name | Type | Description |
---|---|---|
name | String | The name of the Animation Script . |
filename | String | The file to load the Animation Script from. |
Return Type: Animation Script
Signatures:
Restart Animation
Restart Animation
Restarts an Animation
.
Parameters:
Name | Type | Description |
---|---|---|
anim | Animation | The Animation to restart. |
Signatures:
Restart Animation
Restarts an Animation
. This may play a sound effect if the first frame triggers a sound.
Parameters:
Name | Type | Description |
---|---|---|
anim | Animation | The Animation to restart. |
with_sound | Boolean | Denotes whether the Animation should play audio. |
Signatures:
Update Animation
Update Animation
Updates the animation, updating the time spent and possibly moving to a new frame in the animation. This may play a sound effect if the new frame triggers a sound.
Parameters:
Name | Type | Description |
---|---|---|
anim | Animation | The Animation to update. |
pct | Float | The amount that the frame time will be incremented |
with_sound | Boolean | Denotes whether the Animation should play audio. |
Signatures:
Update Animation
Updates the animation, updating the time spent and possibly moving to a new frame in the animation. This may play a sound effect if the new frame triggers a sound.
Parameters:
Name | Type | Description |
---|---|---|
anim | Animation | The Animation to update. |
Usage:
Signatures:
Update Animation
Updates the animation, updating the time spent and possibly moving to a new frame in the animation. This may play a sound effect if the new frame triggers a sound.
Parameters:
Name | Type | Description |
---|---|---|
anim | Animation | The Animation to update. |
pct | Float | The amount that the frame time will be incremented |
Signatures: