Background layers management. More...
Background layers management.
Functions | |
bool | TLN_SetLayer (int nlayer, TLN_Tileset tileset, TLN_Tilemap tilemap) |
Configures a background layer with the specified tileset and tilemap. More... | |
bool | TLN_SetLayerTilemap (int nlayer, TLN_Tilemap tilemap) |
Configures a tiled background layer with the specified tilemap. More... | |
bool | TLN_SetLayerBitmap (int nlayer, TLN_Bitmap bitmap) |
Configures a background layer with the specified full bitmap. More... | |
bool | TLN_SetLayerPalette (int nlayer, TLN_Palette palette) |
Sets the color palette to the layer. More... | |
bool | TLN_SetLayerPosition (int nlayer, int hstart, int vstart) |
Sets the position of the tileset that corresponds to the upper left corner. More... | |
bool | TLN_SetLayerScaling (int nlayer, float xfactor, float yfactor) |
Sets simple scaling. More... | |
bool | TLN_SetLayerAffineTransform (int nlayer, TLN_Affine *affine) |
Sets affine transform matrix to enable rotating and scaling of this layer. More... | |
bool | TLN_SetLayerTransform (int layer, float angle, float dx, float dy, float sx, float sy) |
Sets affine transform matrix to enable rotating and scaling of this layer. More... | |
bool | TLN_SetLayerPixelMapping (int nlayer, TLN_PixelMap *table) |
Sets the table for pixel mapping render mode. More... | |
bool | TLN_SetLayerBlendMode (int nlayer, TLN_Blend mode, uint8_t factor) |
Sets the blending mode (transparency effect) More... | |
bool | TLN_SetLayerColumnOffset (int nlayer, int *offset) |
Enables column offset mode for this layer. More... | |
bool | TLN_SetLayerClip (int nlayer, int x1, int y1, int x2, int y2) |
Enables clipping rectangle on selected layer. More... | |
bool | TLN_DisableLayerClip (int nlayer) |
Disables clipping rectangle on selected layer. More... | |
bool | TLN_SetLayerWindow (int nlayer, int x1, int y1, int x2, int y2, bool invert) |
Enables clipping window on selected layer. More... | |
bool | TLN_SetLayerWindowColor (int nlayer, uint8_t r, uint8_t g, uint8_t b, TLN_Blend blend) |
Enables solid color processing on clipped region in window layer. More... | |
bool | TLN_DisableLayerWindow (int nlayer) |
Disables layer window clipping. More... | |
bool | TLN_DisableLayerWindowColor (int nlayer) |
Disables color processing for window on selected layer. More... | |
bool | TLN_SetLayerMosaic (int nlayer, int width, int height) |
Enables mosaic effect (pixelation) for selected layer. More... | |
bool | TLN_DisableLayerMosaic (int nlayer) |
Disables mosaic effect for selected layer. More... | |
bool | TLN_ResetLayerMode (int nlayer) |
Disables scaling or affine transform for the layer. More... | |
bool | TLN_SetLayerObjects (int nlayer, TLN_ObjectList objects, TLN_Tileset tileset) |
Configures a background layer with a object list and an image-based tileset. More... | |
bool | TLN_SetLayerPriority (int nlayer, bool enable) |
Sets full layer priority, appearing in front of sprites. More... | |
bool | TLN_DisableLayer (int nlayer) |
Disables the specified layer so it is not drawn. More... | |
bool | TLN_EnableLayer (int nlayer) |
Enables a layer previously disabled with TLN_DisableLayer. More... | |
TLN_LayerType | TLN_GetLayerType (int nlayer) |
Returns the type of the layer. More... | |
TLN_Palette | TLN_GetLayerPalette (int nlayer) |
Returns the active palette of a layer if set with TLN_SetLayerPalette(), or the palette of the first tileset, or palette of bitmap. More... | |
TLN_Tileset | TLN_GetLayerTileset (int nlayer) |
TLN_Tilemap | TLN_GetLayerTilemap (int nlayer) |
Returns the active tilemap on a LAYER_TILE layer type. More... | |
TLN_Bitmap | TLN_GetLayerBitmap (int nlayer) |
Returns the active bitmap on a LAYER_BITMAP layer type. More... | |
TLN_ObjectList | TLN_GetLayerObjects (int nlayer) |
Returns the active object list on a LAYER_OBJECT layer type. More... | |
bool | TLN_GetLayerTile (int nlayer, int x, int y, TLN_TileInfo *info) |
Gets info about the tile located in tilemap space. More... | |
int | TLN_GetLayerWidth (int nlayer) |
Returns the layer width in pixels. More... | |
int | TLN_GetLayerHeight (int nlayer) |
Returns the layer height in pixels. More... | |
bool TLN_SetLayer | ( | int | nlayer, |
TLN_Tileset | tileset, | ||
TLN_Tilemap | tilemap | ||
) |
Configures a background layer with the specified tileset and tilemap.
nlayer | Layer index [0, num_layers - 1] |
tileset | Optional reference to the tileset to assign. If the tilemap has a reference to its own tileset, passing NULL will assign the default tileset. |
tilemap | Reference to the tilemap to assign |
bool TLN_SetLayerTilemap | ( | int | nlayer, |
TLN_Tilemap | tilemap | ||
) |
Configures a tiled background layer with the specified tilemap.
nlayer | Layer index [0, num_layers - 1] |
tilemap | Reference to the tilemap to assign |
bool TLN_SetLayerBitmap | ( | int | nlayer, |
TLN_Bitmap | bitmap | ||
) |
Configures a background layer with the specified full bitmap.
nlayer | Layer index [0, num_layers - 1] |
bitmap | Reference to the bitmap to assign |
bool TLN_SetLayerPalette | ( | int | nlayer, |
TLN_Palette | palette | ||
) |
Sets the color palette to the layer.
nlayer | Layer index [0, num_layers - 1] |
palette | Reference to the palette to assign to the layer |
Overrides the palette of the current tileset or bitmap
bool TLN_SetLayerPosition | ( | int | nlayer, |
int | hstart, | ||
int | vstart | ||
) |
Sets the position of the tileset that corresponds to the upper left corner.
nlayer | Layer index [0, num_layers - 1] |
hstart | Horizontal offset in the tileset on the left side |
vstart | Vertical offset in the tileset on the top side |
The tileset usually spans an area much bigger than the viewport. Use this function to move the viewport insde the tileset. Change this value progressively for each frame to get a scrolling effect
bool TLN_SetLayerScaling | ( | int | nlayer, |
float | sx, | ||
float | sy | ||
) |
Sets simple scaling.
nlayer | Layer index [0, num_layers - 1] |
sx | Horizontal scale factor |
sy | Vertical scale factor |
By default the scaling factor of a given layer is 1.0f, 1.0f, which means no scaling. Use values below 1.0 to downscale (shrink) and above 1.0 to upscale (enlarge). Call TLN_ResetLayerMode() to disable scaling
Write detailed description for TLN_SetLayerScaling here.
bool TLN_SetLayerAffineTransform | ( | int | nlayer, |
TLN_Affine * | affine | ||
) |
Sets affine transform matrix to enable rotating and scaling of this layer.
nlayer | Layer index [0, num_layers - 1] |
affine | Pointer to an TLN_Affine matrix, or NULL to disable it |
Enable the transformation matrix to give the layer the capabilities of the famous Super Nintendo / Famicom Mode 7. Beware that the rendering of a transformed layer uses more CPU than a regular layer. Unlike the original Mode 7, that could only transform the single layer available, Tilengine can transform all the layers at the same time. The only limitation is the available CPU power.
bool TLN_SetLayerTransform | ( | int | layer, |
float | angle, | ||
float | dx, | ||
float | dy, | ||
float | sx, | ||
float | sy | ||
) |
Sets affine transform matrix to enable rotating and scaling of this layer.
layer | Layer index [0, num_layers - 1] |
angle | Rotation angle in degrees |
dx | Horizontal displacement |
dy | Vertical displacement |
sx | Horizontal scaling |
sy | Vertical scaling |
bool TLN_SetLayerPixelMapping | ( | int | nlayer, |
TLN_PixelMap * | table | ||
) |
Sets the table for pixel mapping render mode.
nlayer | Layer index [0, num_layers - 1] |
table | User-provided array of hres*vres sized TLN_PixelMap items |
bool TLN_SetLayerBlendMode | ( | int | nlayer, |
TLN_Blend | mode, | ||
uint8_t | factor | ||
) |
Sets the blending mode (transparency effect)
nlayer | Layer index [0, num_layers - 1] |
mode | Member of the TLN_Blend enumeration |
factor | Deprecated as of 1.12, left for backwards compatibility but doesn't have effect. |
bool TLN_SetLayerColumnOffset | ( | int | nlayer, |
int * | offset | ||
) |
Enables column offset mode for this layer.
nlayer | Layer index [0, num_layers - 1] |
offset | Array of offsets to set. Set NULL to disable column offset mode |
Column offset is a value that is added or substracted (depeinding on the sign) to the vertical position for that layer (see TLN_SetLayerPosition) for each column in the tilemap assigned to that layer.
bool TLN_SetLayerClip | ( | int | nlayer, |
int | x1, | ||
int | y1, | ||
int | x2, | ||
int | y2 | ||
) |
Enables clipping rectangle on selected layer.
nlayer | Layer index [0, num_layers - 1] |
x1 | left coordinate |
y1 | top coordinate |
x2 | right coordinate |
y2 | bottom coordinate |
bool TLN_DisableLayerClip | ( | int | nlayer | ) |
Disables clipping rectangle on selected layer.
nlayer | Layer index [0, num_layers - 1] |
bool TLN_SetLayerWindow | ( | int | nlayer, |
int | x1, | ||
int | y1, | ||
int | x2, | ||
int | y2, | ||
bool | invert | ||
) |
Enables clipping window on selected layer.
nlayer | Layer index [0, num_layers - 1] |
x1 | left coordinate |
y1 | top coordinate |
x2 | right coordinate |
y2 | bottom coordinate |
invert | false=clip outer region, true=clip inner region |
bool TLN_SetLayerWindowColor | ( | int | nlayer, |
uint8_t | r, | ||
uint8_t | g, | ||
uint8_t | b, | ||
TLN_Blend | blend | ||
) |
Enables solid color processing on clipped region in window layer.
nlayer | Layer index [0, num_layers - 1] |
r | Red component (0-255) |
g | Green component (0-255) |
b | Blue component (0-255) |
blend | one of possible TLN_Blend modes When color is enabled on window, the area outside the clipped region gets filled with this color. If one of blending modes is selected, color math is performed with underlying layer |
bool TLN_DisableLayerWindow | ( | int | nlayer | ) |
Disables layer window clipping.
nlayer | Layer index [0, num_layers - 1] |
bool TLN_DisableLayerWindowColor | ( | int | nlayer | ) |
Disables color processing for window on selected layer.
nlayer | Layer index [0, num_layers - 1] |
bool TLN_SetLayerMosaic | ( | int | nlayer, |
int | width, | ||
int | height | ||
) |
Enables mosaic effect (pixelation) for selected layer.
nlayer | Layer index [0, num_layers - 1] |
width | horizontal pixel size |
height | vertical pixel size |
bool TLN_DisableLayerMosaic | ( | int | nlayer | ) |
Disables mosaic effect for selected layer.
nlayer | Layer index [0, num_layers - 1] |
bool TLN_ResetLayerMode | ( | int | nlayer | ) |
Disables scaling or affine transform for the layer.
nlayer | Layer index [0, num_layers - 1] |
Write detailed description for TLN_ResetLayerMode here.
bool TLN_SetLayerObjects | ( | int | nlayer, |
TLN_ObjectList | objects, | ||
TLN_Tileset | tileset | ||
) |
Configures a background layer with a object list and an image-based tileset.
nlayer | Layer index [0, num_layers - 1] |
objects | Reference to the TLN_ObjectList to attach |
tileset | optional reference to the image-based tileset object. If NULL, object list must have an attached tileset |
bool TLN_SetLayerPriority | ( | int | nlayer, |
bool | enable | ||
) |
Sets full layer priority, appearing in front of sprites.
nlayer | Layer index [0, num_layers - 1] |
enable | Enable (true) or dsiable (false) full priority |
bool TLN_DisableLayer | ( | int | nlayer | ) |
Disables the specified layer so it is not drawn.
nlayer | Layer index [0, num_layers - 1] |
bool TLN_EnableLayer | ( | int | nlayer | ) |
Enables a layer previously disabled with TLN_DisableLayer.
nlayer | Layer index [0, num_layers - 1] |
TLN_LayerType TLN_GetLayerType | ( | int | nlayer | ) |
Returns the type of the layer.
nlayer | Layer index [0, num_layers - 1] |
TLN_Palette TLN_GetLayerPalette | ( | int | nlayer | ) |
Returns the active palette of a layer if set with TLN_SetLayerPalette(), or the palette of the first tileset, or palette of bitmap.
nlayer | Layer index [0, num_layers - 1] |
TLN_Tileset TLN_GetLayerTileset | ( | int | nlayer | ) |
TLN_Tilemap TLN_GetLayerTilemap | ( | int | nlayer | ) |
Returns the active tilemap on a LAYER_TILE layer type.
nlayer | Layer index [0, num_layers - 1] |
TLN_Bitmap TLN_GetLayerBitmap | ( | int | nlayer | ) |
Returns the active bitmap on a LAYER_BITMAP layer type.
nlayer | Layer index [0, num_layers - 1] |
TLN_ObjectList TLN_GetLayerObjects | ( | int | nlayer | ) |
Returns the active object list on a LAYER_OBJECT layer type.
nlayer | Layer index [0, num_layers - 1] |
bool TLN_GetLayerTile | ( | int | nlayer, |
int | x, | ||
int | y, | ||
TLN_TileInfo * | info | ||
) |
Gets info about the tile located in tilemap space.
nlayer | Id of the layer to query [0, num_layers - 1] |
x | x position |
y | y position |
info | Pointer to an application-allocated TLN_TileInfo struct that will get the data |
int TLN_GetLayerWidth | ( | int | nlayer | ) |
Returns the layer width in pixels.
nlayer | Layer index [0, num_layers - 1] |
int TLN_GetLayerHeight | ( | int | nlayer | ) |
Returns the layer height in pixels.
nlayer | Layer index [0, num_layers - 1] |
Last update on Tue Aug 29 2023 for Tilengine 2.15.1