Functions
Animation

Animation engine manager. More...

Description

Functions

TLNAPI bool TLN_SetPaletteAnimation (int index, TLN_Palette palette, TLN_Sequence sequence, bool blend)
 Starts a palette animation. More...
 
TLNAPI bool TLN_SetPaletteAnimationSource (int index, TLN_Palette)
 Sets the source palette of a color cycle animation. More...
 
TLNAPI bool TLN_SetTilesetAnimation (int index, int nlayer, TLN_Sequence)
 Starts a tileset animation. More...
 
TLNAPI bool TLN_SetTilemapAnimation (int index, int nlayer, TLN_Sequence)
 Starts a tilemap animation. More...
 
TLNAPI bool TLN_SetSpriteAnimation (int index, int nsprite, TLN_Sequence sequence, int loop)
 Starts a sprite animation. More...
 
TLNAPI bool TLN_GetAnimationState (int index)
 Checks the state of the specified animation. More...
 
TLNAPI bool TLN_SetAnimationDelay (int index, int delay)
 Sets the playback speed of a given animation. More...
 
TLNAPI int TLN_GetAvailableAnimation (void)
 Finds an available (unused) animation. More...
 
TLNAPI bool TLN_DisableAnimation (int index)
 Disables the animation so it stops playing and returns it to the list of available animations. More...
 

Function Documentation

TLNAPI bool TLN_SetPaletteAnimation ( int  index,
TLN_Palette  palette,
TLN_Sequence  sequence,
bool  blend 
)
Parameters
indexId of the animation to set (0 <= id < num_animations)
paletteReference of the palette to be animated
sequenceReference of the sequence to assign
blendtrue for smooth frame interpolation, false for classic, discrete mode
TLNAPI bool TLN_SetPaletteAnimationSource ( int  index,
TLN_Palette  palette 
)
Parameters
indexId of the animation to set (0 <= id < num_animations)
paletteReference of the palette to assign
Remarks
Use this function to change the palette assigned to a color cycle animation running. This is useful to combine color cycling and palette interpolation at the same time
TLNAPI bool TLN_SetTilesetAnimation ( int  index,
int  nlayer,
TLN_Sequence  sequence 
)
Parameters
indexId of the animation to set (0 <= id < num_animations)
nlayerId of the layer to animate (0 <= id < num_layers)
sequenceReference of the sequence to assign
See also
Animations
TLNAPI bool TLN_SetTilemapAnimation ( int  index,
int  nlayer,
TLN_Sequence  sequence 
)
Parameters
indexId of the animation to set (0 <= id < num_animations)
nlayerId of the layer to animate (0 <= id < num_layers)
sequenceReference of the sequence to assign
See also
Animations
TLNAPI bool TLN_SetSpriteAnimation ( int  index,
int  nsprite,
TLN_Sequence  sequence,
int  loop 
)
Parameters
indexId of the animation to set (0 <= id < num_animations)
nspriteIf of the sprite to animate (0 <= id < num_sprites)
sequenceReference of the sequence to assign
loopamount of times to loop, 0=infinite
See also
Animations
TLNAPI bool TLN_GetAnimationState ( int  index)
Parameters
indexId of the animation to check (0 <= id < num_animations)
Returns
true if animation is running, false if it's finished or inactive
TLNAPI bool TLN_SetAnimationDelay ( int  index,
int  delay 
)
Parameters
indexId of the animation to set (0 <= id < num_animations)
delayNew delay between frames to assign

Each sequence has its own delay set in the sqx file. However sometimes it's convenient to speed up or down the playback speed in realtime, for example for a character that is accelerating.

Remarks
The meaning of the delay value (i.e. its units) is application dependant. It can usually be frames or milliseconds. Make sure that its units match the ones insode the sqx file and the ones passed to the TLN_UpdateFrame()
See also
Animations, TLN_UpdateFrame()
TLNAPI int TLN_GetAvailableAnimation ( void  )
Returns
Index of the first unused animation (starting from 0) or -1 if none found
TLNAPI bool TLN_DisableAnimation ( int  index)
Parameters
indexId of the animation to set (0 <= id < num_animations)
See also
Animations