Skip to content

Class "Sprite"⚓︎

Modified Constructors⚓︎

Sprite ()⚓︎

Sprite,bool Sprite ( string ANM2Path, bool LoadGraphics = true )⚓︎

Added two optional arguments, the function now returns two values: Sprite object and the bool signifying whether the sprite was loaded successfully or not.


Modified Functions⚓︎

ReplaceSpritesheet ()⚓︎

void ReplaceSpritesheet ( int LayerId, string PngFilename, boolean LoadGraphics = false )⚓︎

Now accepts an optional bool to determine if Sprite:LoadGraphics should be called after replacing the spritesheet. In most cases, you'll want to do this.


SetOverlayFrame ()⚓︎

void SetOverlayFrame ( int FrameNum )⚓︎

New overload for SetOverlayFrame() that sets the frame for the current animation without stopping it, akin to the one for SetFrame().


Stop ()⚓︎

void Stop ( boolean StopOverlay = true )⚓︎

Now accepts an optional bool for whether to also stop the overlay animation. Defaults to true.


Functions⚓︎

ClearCustomChampionShader ()⚓︎

void ClearCustomChampionShader ( )⚓︎

Removes any custom coloroffset_champion shader applied by sprite:SetCustomChampionShader(path).


ClearCustomShader ()⚓︎

void ClearCustomShader ( )⚓︎

Removes any custom coloroffset shader applied by sprite:SetCustomShader(path).


Continue ()⚓︎

void Continue ( boolean ContinueOverlay = true )⚓︎

If the animation is currently stopped, makes it start playing again from the current frame. Will not restart a finished, non-looping animation.


ContinueOverlay ()⚓︎

void ContinueOverlay ( )⚓︎

Same as above, but only for the overlay animation.


GetAllAnimationData ()⚓︎

AnimationData[] GetAllAnimationData ( )⚓︎

Returns a table of AnimationData representing all animations in this anm2 file.


GetAllLayers ()⚓︎

LayerStates[] GetAllLayers ( )⚓︎

Returns a table of all LayerStates in this Sprite.


GetAnimationData ()⚓︎

AnimationData GetAnimationData ( string AnimationName )⚓︎


GetCurrentAnimationData ()⚓︎

AnimationData GetCurrentAnimationData ( )⚓︎


GetLayer ()⚓︎

LayerState GetLayer ( int LayerId )⚓︎

LayerState GetLayer ( string LayerName )⚓︎

Returns the layer data from the provided layer id.


GetNullFrame ()⚓︎

NullFrame GetNullFrame ( string LayerName )⚓︎

Returns the NullFrame from the provided layer name.


GetOverlayAnimationData ()⚓︎

AnimationData GetOverlayAnimationData ( )⚓︎

Returns the AnimationData of the currently playing overlay.


GetOverlayNullFrame ()⚓︎

NullFrame GetOverlayNullFrame ( string LayerName )⚓︎

Returns the NullFrame from the provided layer name of the overlay animation.


GetRenderFlags ()⚓︎

AnimRenderFlags GetRenderFlags ( )⚓︎


HasCustomChampionShader ()⚓︎

boolean HasCustomChampionShader ( string ShaderPath )⚓︎

Returns true if the specified custom champion shader is currently loaded (see SetCustomChampionShader below). If no string is provided, returns true if ANY custom champion shader is applied.


HasCustomShader ()⚓︎

boolean HasCustomShader ( string ShaderPath )⚓︎

Returns true if the specified custom shader is currently loaded (see SetCustomShader below). If no string is provided, returns true if ANY custom shader is applied.


IsOverlayEventTriggered ()⚓︎

boolean IsOverlayEventTriggered ( string EventName )⚓︎

Returns true if the currently playing overlay animation just reached the event with the provided name.


SetCustomChampionShader ()⚓︎

void SetCustomChampionShader ( string ShaderPath )⚓︎

Specify a custom champion shader file for this Sprite to use instead of the usual coloroffset_champion shader. Provided path is expected to start at .../resources/ and to find both a .vs and .fs file at that location. For example: sprite:SetCustomChampionShader("shaders/my_shader") will load .../resources/shaders/my_shader.vs and .../resources/shaders/my_shader.fs.

The custom champion shader will only be used by the game if the entity is actually a champion.

Note that the custom shader must take the exact same inputs as the default coloroffset_champion shader the game uses (it has one additional input compared to coloroffset).

You can also set a per-layer shader via LayerState.


SetCustomShader ()⚓︎

void SetCustomShader ( string ShaderPath )⚓︎

Specify a custom shader file for this Sprite to use instead of the default coloroffset shader. Provided path is expected to start at .../resources/ and to find both a .vs and .fs file at that location. For example: sprite:SetCustomShader("shaders/my_shader") will load .../resources/shaders/my_shader.vs and .../resources/shaders/my_shader.fs.

This custom shader will not be used by the game if the entity is a champion, or if it has the gold/dogma shader applied.

Note that the custom shader must take the exact same inputs as the default coloroffset shader the game uses. The gold and dogma shaders also use the same inputs, and can be a good reference.

You can also set a per-layer shader via LayerState.


SetRenderFlags ()⚓︎

void SetRenderFlags ( AnimRenderFlags Flags )⚓︎


StopOverlay ()⚓︎

void StopOverlay ( )⚓︎


WasOverlayEventTriggered ()⚓︎

boolean WasOverlayEventTriggered ( string EventName )⚓︎