Hatch Game Engine Documentation v1.4.0
The documentation for the Hatch Game Engine
Loading...
Searching...
No Matches
Animator Class Reference

A sprite animation player. More...

Public Member Functions

integer Create (integer sprite, integer animationID, integer frameID, integer unloadPolicy)
 Creates a new animator.
void Remove (integer animator)
 Removes an animator.
void SetAnimation (integer animator, integer sprite, integer animationID, integer frameID, boolean forceApply)
 Sets the current animation and frame of an animator.
void Animate (integer animator)
 Animates an animator.
integer GetSprite (integer animator)
 Gets the sprite index of an animator.
integer GetCurrentAnimation (integer animator)
 Gets the current animation value of an animator.
integer GetCurrentFrame (integer animator)
 Gets the current animation value of an animator.
hitbox GetHitbox (integer animator, integer hitboxID=0)
 Gets the hitbox of an animation and frame of an animator.
integer GetPrevAnimation (integer animator)
 Gets the previous animation value of an animator.
integer GetAnimationSpeed (integer animator)
 Gets the animation speed of an animator's current animation.
integer GetAnimationTimer (integer animator)
 Gets the animation timer of an animator.
integer GetDuration (integer animator)
 Gets the frame duration of an animator's current frame.
integer GetFrameCount (integer animator)
 Gets the frame count of an animator's current animation.
integer GetLoopIndex (integer animator)
 Gets the loop index of an animator's current animation.
integer GetRotationStyle (integer animator)
 Gets the loop index of an animator's rotation style.
void SetSprite (integer animator, integer spriteID)
 Sets the sprite index of an animator.
void SetCurrentAnimation (integer animator, integer animationID)
 Sets the current animation of an animator.
void SetCurrentFrame (integer animator, integer frameID)
 Sets the current frame of an animator.
void SetPrevAnimation (integer animator, integer prevAnimationID)
 Sets the previous animation of an animator.
void SetAnimationSpeed (integer animator, integer speed)
 Sets the animation speed of an animator.
void SetAnimationTimer (integer animator, integer timer)
 Sets the animation timer of an animator.
void SetDuration (integer animator, integer duration)
 Sets the frame duration of an animator.
void SetFrameCount (integer animator, integer frameCount)
 Sets the frame count of an animator.
void SetLoopIndex (integer animator, integer loopIndex)
 Sets the loop index of an animator.
void SetRotationStyle (integer animator, integer rotationStyle)
 Sets the rotation style of an animator.
void AdjustCurrentAnimation (integer animator, integer amount)
 Adjusts the current animation of an animator by an amount.
void AdjustCurrentFrame (integer animator, integer amount)
 Adjusts the current frame of an animator by an amount.
void AdjustAnimationSpeed (integer animator, integer amount)
 Adjusts the animation speed of an animator by an amount.
void AdjustAnimationTimer (integer animator, integer amount)
 Adjusts the animation timer of an animator by an amount.
void AdjustDuration (integer animator, integer amount)
 Adjusts the duration of an animator by an amount.
void AdjustFrameCount (integer animator, integer amount)
 Adjusts the frame count of an animator by an amount.
void AdjustLoopIndex (integer animator, integer amount)
 Adjusts the loop index of an animator by an amount.

Detailed Description

A sprite animation player.

Member Function Documentation

◆ AdjustAnimationSpeed()

void Animator.AdjustAnimationSpeed ( integer animator,
integer amount )

Adjusts the animation speed of an animator by an amount.

Parameters
animatorThe animator index to change.
amountThe amount to adjust the animator's animation speed.

◆ AdjustAnimationTimer()

void Animator.AdjustAnimationTimer ( integer animator,
integer amount )

Adjusts the animation timer of an animator by an amount.

Parameters
animatorThe animator index to change.
amountThe amount to adjust the animator's animation timer.

◆ AdjustCurrentAnimation()

void Animator.AdjustCurrentAnimation ( integer animator,
integer amount )

Adjusts the current animation of an animator by an amount.

Parameters
animatorThe animator index to change.
amountThe amount to adjust the animator's animation ID.

◆ AdjustCurrentFrame()

void Animator.AdjustCurrentFrame ( integer animator,
integer amount )

Adjusts the current frame of an animator by an amount.

Parameters
animatorThe animator index to change.
amountThe amount to adjust the animator's frame ID.

◆ AdjustDuration()

void Animator.AdjustDuration ( integer animator,
integer amount )

Adjusts the duration of an animator by an amount.

Parameters
animatorThe animator index to change.
amountThe amount to adjust the animator's duration.

◆ AdjustFrameCount()

void Animator.AdjustFrameCount ( integer animator,
integer amount )

Adjusts the frame count of an animator by an amount.

Parameters
animatorThe animator index to change.
amountThe amount to adjust the animator's duration.

◆ AdjustLoopIndex()

void Animator.AdjustLoopIndex ( integer animator,
integer amount )

Adjusts the loop index of an animator by an amount.

Parameters
animatorThe animator index to change.
amountThe amount to adjust the animator's loop index.

◆ Animate()

void Animator.Animate ( integer animator)

Animates an animator.

Parameters
animatorThe index of the animator.

◆ Create()

integer Animator.Create ( integer sprite,
integer animationID,
integer frameID,
integer unloadPolicy )

Creates a new animator.

Parameters
spriteThe index of the sprite.
animationIDWhich animation to use.
frameIDWhich frame to use.
unloadPolicyWhen to unload the animator.
Returns
Returns the index of the Animator.

◆ GetAnimationSpeed()

integer Animator.GetAnimationSpeed ( integer animator)

Gets the animation speed of an animator's current animation.

Parameters
animatorThe index of the animator.
Returns
Returns an integer value.

◆ GetAnimationTimer()

integer Animator.GetAnimationTimer ( integer animator)

Gets the animation timer of an animator.

Parameters
animatorThe index of the animator.
Returns
Returns an integer value.

◆ GetCurrentAnimation()

integer Animator.GetCurrentAnimation ( integer animator)

Gets the current animation value of an animator.

Parameters
animatorThe index of the animator.
Returns
Returns an integer value.

◆ GetCurrentFrame()

integer Animator.GetCurrentFrame ( integer animator)

Gets the current animation value of an animator.

Parameters
animatorThe index of the animator.
Returns
Returns an integer value.

◆ GetDuration()

integer Animator.GetDuration ( integer animator)

Gets the frame duration of an animator's current frame.

Parameters
animatorThe index of the animator.
Returns
Returns an integer value.

◆ GetFrameCount()

integer Animator.GetFrameCount ( integer animator)

Gets the frame count of an animator's current animation.

Parameters
animatorThe index of the animator.
Returns
Returns an integer value.

◆ GetHitbox()

hitbox Animator.GetHitbox ( integer animator,
integer hitboxID = 0 )

Gets the hitbox of an animation and frame of an animator.

Parameters
animatorThe index of the animator.
hitboxIDThe index number of the hitbox.
Returns
Returns a Hitbox value.

◆ GetLoopIndex()

integer Animator.GetLoopIndex ( integer animator)

Gets the loop index of an animator's current animation.

Parameters
animatorThe index of the animator.
Returns
Returns an integer value.

◆ GetPrevAnimation()

integer Animator.GetPrevAnimation ( integer animator)

Gets the previous animation value of an animator.

Parameters
animatorThe index of the animator.
Returns
Returns an integer value.

◆ GetRotationStyle()

integer Animator.GetRotationStyle ( integer animator)

Gets the loop index of an animator's rotation style.

Parameters
animatorThe index of the animator.
Returns
Returns an integer value.

◆ GetSprite()

integer Animator.GetSprite ( integer animator)

Gets the sprite index of an animator.

Parameters
animatorThe index of the animator.
Returns
Returns an integer value.

◆ Remove()

void Animator.Remove ( integer animator)

Removes an animator.

Parameters
animatorThe index of the animator.

◆ SetAnimation()

void Animator.SetAnimation ( integer animator,
integer sprite,
integer animationID,
integer frameID,
boolean forceApply )

Sets the current animation and frame of an animator.

Parameters
animatorThe index of the animator.
spriteThe index of the sprite.
animationIDThe animator's changed animation ID.
frameIDThe animator's changed frame ID.
forceApplyWhether to force the animation to go back to the frame if the animation is the same as the current animation.

◆ SetAnimationSpeed()

void Animator.SetAnimationSpeed ( integer animator,
integer speed )

Sets the animation speed of an animator.

Parameters
animatorThe animator index to change.
speedThe animation speed.

◆ SetAnimationTimer()

void Animator.SetAnimationTimer ( integer animator,
integer timer )

Sets the animation timer of an animator.

Parameters
animatorThe animator index to change.
timerThe animation timer.

◆ SetCurrentAnimation()

void Animator.SetCurrentAnimation ( integer animator,
integer animationID )

Sets the current animation of an animator.

Parameters
animatorThe animator index to change.
animationIDThe animation ID.

◆ SetCurrentFrame()

void Animator.SetCurrentFrame ( integer animator,
integer frameID )

Sets the current frame of an animator.

Parameters
animatorThe animator index to change.
frameIDThe frame ID.

◆ SetDuration()

void Animator.SetDuration ( integer animator,
integer duration )

Sets the frame duration of an animator.

Parameters
animatorThe animator index to change.
durationThe animator's changed duration.

◆ SetFrameCount()

void Animator.SetFrameCount ( integer animator,
integer frameCount )

Sets the frame count of an animator.

Parameters
animatorThe animator index to change.
frameCountThe animator's changed frame count.

◆ SetLoopIndex()

void Animator.SetLoopIndex ( integer animator,
integer loopIndex )

Sets the loop index of an animator.

Parameters
animatorThe animator index to change.
loopIndexThe animator's changed loop index.

◆ SetPrevAnimation()

void Animator.SetPrevAnimation ( integer animator,
integer prevAnimationID )

Sets the previous animation of an animator.

Parameters
animatorThe animator index to change.
prevAnimationIDThe animation ID.

◆ SetRotationStyle()

void Animator.SetRotationStyle ( integer animator,
integer rotationStyle )

Sets the rotation style of an animator.

Parameters
animatorThe animator index to change.
rotationStyleThe animator's changed rotation style.

◆ SetSprite()

void Animator.SetSprite ( integer animator,
integer spriteID )

Sets the sprite index of an animator.

Parameters
animatorThe animator index to change.
spriteIDThe sprite ID.