Class "Sprite"⚓︎
Constructors⚓︎
Sprite ()⚓︎
Sprite Sprite ( )⚓︎
Functions⚓︎
Get·Default·Animation ()⚓︎
string GetDefaultAnimation ( )⚓︎
This function returns the name of the "Default" animation of a given sprite based on its .anm2 file.
Info
This function seems to be the same as GetDefaultAnimationName()
.
Example Code
This code print the default animation name "WalkDown" of the player sprite.
1 2 3 |
|
Get·Default·Animation·Name ()⚓︎
string GetDefaultAnimationName ( )⚓︎
This function returns the name of the "Default" animation of a given sprite based on its .anm2 file.
Info
This function seems to be the same as GetDefaultAnimation()
.
Example Code
This code print the default animation name "WalkDown" of the player sprite.
1 2 3 |
|
Get·Filename ()⚓︎
string GetFilename ( )⚓︎
This function returns the path to the .anm2 file used by the sprite.
Info
This function seems to be the same as GetDefaultAnimation()
.
Example Code
This code print the .anm2 path of the player sprite.
1 2 3 |
|
Get·Frame ()⚓︎
int GetFrame ( )⚓︎
Returns the currently rendered Frame of the given Sprite.
Get·Layer·Count ()⚓︎
int GetLayerCount ( )⚓︎
Returns the number of layers of the .anm2 file of the sprite. All Animations use the same amount of Layers.
Get·Overlay·Frame ()⚓︎
int GetOverlayFrame ( )⚓︎
Returns the currently rendered Frame of the Overlay of the given Sprite. It acts independent from the normal Frame count.
Get·Texel ()⚓︎
Color GetTexel ( Vector SamplePos, Vector RenderPos, float AlphaThreshold )⚓︎
Is·Event·Triggered ()⚓︎
boolean IsEventTriggered ( string EventName )⚓︎
Is·Finished ()⚓︎
boolean IsFinished ( string AnimationName )⚓︎
Is·Loaded ()⚓︎
boolean IsLoaded ( )⚓︎
Is·Overlay·Finished ()⚓︎
boolean IsOverlayFinished ( string AnimationName )⚓︎
Is·Overlay·Playing ()⚓︎
boolean IsOverlayPlaying ( string AnimationName )⚓︎
Is·Playing ()⚓︎
boolean IsPlaying ( string AnimationName )⚓︎
Load ()⚓︎
void Load ( string Filename, boolean LoadGraphics )⚓︎
Loads a given ".anm2" file. The filepath is relative to the "resources" folder. The boolean can be used to load the graphics (.png files) as well, without calling the LoadGraphics() function.
Example Code
This code creates a new sprite object, loads an .anm2 file and renders it on the screen.
1 2 3 |
|
Load·Graphics ()⚓︎
void LoadGraphics ( )⚓︎
Loads and applies assosiated graphic-objects like ".png" files.
Example Code
This code creates a new sprite object and replaces the spritesheet of layer 0 of a sprite object with a different spritesheet.
1 2 3 4 |
|
Play ()⚓︎
void Play ( string AnimationName, boolean Force )⚓︎
Play·Overlay ()⚓︎
void PlayOverlay ( string AnimationName, boolean Force )⚓︎
Play·Random ()⚓︎
void PlayRandom ( int Seed )⚓︎
Reload ()⚓︎
void Reload ( )⚓︎
Remove·Overlay ()⚓︎
void RemoveOverlay ( )⚓︎
Render ()⚓︎
void Render ( Vector Pos, Vector TopLeftClamp, Vector BottomRightClamp )⚓︎
Render·Layer ()⚓︎
void RenderLayer ( int LayerId, Vector Pos )⚓︎
Replace·Spritesheet ()⚓︎
void ReplaceSpritesheet ( int LayerId, string PngFilename )⚓︎
Changes the ".png" file assosiated to a specific layer of a sprite.
Notes
The effect is only applied after calling the LoadGraphics() function afterwards.
Example Code
This code creates a new sprite object and replaces the spritesheet of layer 0 of a sprite object with a different spritesheet.
1 2 3 4 |
|