2.15.1
Functions
World

World management. More...

Description

World management.

Functions

bool TLN_LoadWorld (const char *tmxfile, int first_layer)
 Loads and assigns complete TMX file. More...
 
void TLN_SetWorldPosition (int x, int y)
 Sets global world position, moving all layers in sync according to their parallax factor. More...
 
bool TLN_SetLayerParallaxFactor (int nlayer, float x, float y)
 Sets layer parallax factor to use in conjunction with TLN_SetWorldPosition. More...
 
bool TLN_SetSpriteWorldPosition (int nsprite, int x, int y)
 Sets the sprite position in world space coordinates. More...
 
void TLN_ReleaseWorld (void)
 Releases world resources loaded with TLN_LoadWorld.
 

Function Documentation

◆ TLN_LoadWorld()

bool TLN_LoadWorld ( const char *  filename,
int  first_layer 
)

Loads and assigns complete TMX file.

Parameters
filenameTMX file to load
first_layerStarting layer number where place the loaded tmx

◆ TLN_SetWorldPosition()

void TLN_SetWorldPosition ( int  x,
int  y 
)

Sets global world position, moving all layers in sync according to their parallax factor.

Parameters
xhorizontal position in world space
yvertical position in world space

◆ TLN_SetLayerParallaxFactor()

bool TLN_SetLayerParallaxFactor ( int  nlayer,
float  x,
float  y 
)

Sets layer parallax factor to use in conjunction with TLN_SetWorldPosition.

Parameters
nlayerLayer index [0, num_layers - 1]
xHorizontal parallax factor
yVertical parallax factor

◆ TLN_SetSpriteWorldPosition()

bool TLN_SetSpriteWorldPosition ( int  nsprite,
int  x,
int  y 
)

Sets the sprite position in world space coordinates.

Parameters
nspriteId of the sprite [0, num_sprites - 1]
xHorizontal world position of pivot (0 = left margin)
yVertical world position of pivot (0 = top margin)
See also
TLN_SetSpritePivot