2.10.0
Functions
Sequence

Sequence resources management for layer, sprite and palette animations. More...

Description

Sequence resources management for layer, sprite and palette animations.

Functions

TLN_Sequence TLN_CreateSequence (const char *name, int target, int num_frames, TLN_SequenceFrame *frames)
 Creates a new sequence for the animation engine. More...
 
TLN_Sequence TLN_CreateCycle (const char *name, int num_strips, TLN_ColorStrip *strips)
 Creates a color cycle sequence for palette animation. More...
 
TLN_Sequence TLN_CreateSpriteSequence (const char *name, TLN_Spriteset spriteset, const char *basename, int delay)
 
TLN_Sequence TLN_CloneSequence (TLN_Sequence src)
 Creates a duplicate of the specified sequence. More...
 
bool TLN_GetSequenceInfo (TLN_Sequence sequence, TLN_SequenceInfo *info)
 Returns runtime info about a given sequence. More...
 
bool TLN_DeleteSequence (TLN_Sequence sequence)
 Deletes the sequence and frees resources. More...
 

Function Documentation

◆ TLN_CreateSequence()

TLN_Sequence TLN_CreateSequence ( const char *  name,
int  target,
int  count,
TLN_SequenceFrame frames 
)

Creates a new sequence for the animation engine.

Parameters
nameString with an unique name to query later
targetFor tileset animations, the tile index to animate
countNumber of frames
framesArray of TLN_Frame items with indexes and delays
Returns
Reference to the new sequence or NULL if error
Remarks
Use this function to create tileset or sprite animations
See also
TLN_SetTilemapAnimation(), TLN_SetSpriteAnimation()

◆ TLN_CreateCycle()

TLN_Sequence TLN_CreateCycle ( const char *  name,
int  count,
TLN_ColorStrip strips 
)

Creates a color cycle sequence for palette animation.

Parameters
nameString with an unique name to query later
countNumber of color strips
stripsArray of color strips to assign
Returns
Reference to the created cycle or NULL if error
Remarks
Use this function to create advanced palette animation effects
See also
TLN_ColorStrip(), TLN_SetPaletteAnimation()

◆ TLN_CreateSpriteSequence()

TLN_Sequence TLN_CreateSpriteSequence ( const char *  name,
TLN_Spriteset  spriteset,
const char *  basename,
int  delay 
)
See also
Creates a name based Sprite Sequence
Parameters
nameOptional name used to retrieve it when adding to a TLN_SequencePack, can be NULL
spritesetReference to the spriteset with frames to animate
basenameBase of the sprite name for the numbered sequence
delayNumber of ticks to delay between frame
Returns
Reference to the created TLN_Sequence object or NULL if error
Remarks
Trailing numbers in sprite names must start with 1 and be correlative (eg basename1... basename14)

◆ TLN_CloneSequence()

TLN_Sequence TLN_CloneSequence ( TLN_Sequence  src)

Creates a duplicate of the specified sequence.

Parameters
srcSequence to clone
Returns
A reference to the newly cloned sequence, or NULL if error
See also
TLN_FindSequence()

◆ TLN_GetSequenceInfo()

bool TLN_GetSequenceInfo ( TLN_Sequence  sequence,
TLN_SequenceInfo info 
)

Returns runtime info about a given sequence.

Parameters
sequenceSequence to query
infoPointer to a user-provided TLN_SequenceInfo structure to hold the returned data
See also
TLN_FindSequence()

◆ TLN_DeleteSequence()

bool TLN_DeleteSequence ( TLN_Sequence  sequence)

Deletes the sequence and frees resources.

Parameters
sequenceReference to the sequence to be deleted
Remarks
Don't delete an active sequence!