NAME
lam_tile_render - liblamina tile rendering
- Functions for drawing individual tiles.
SYNOPSIS
Functions
Draw a single tile from a tilemap.
Render a complete 2D grid map from an array of tile indices.
Draw a single tile lying flat on the 3D ground plane (Z = elevation).
Draw a billboard sprite standing upright in 3D world space.
Detailed Description
Functions for drawing individual tiles.
Function Documentation
void lam_tile_draw (uint32_t ref, uint32_t idx, uint32_t x, uint32_t y, uint32_t w, uint32_t h, uint32_t rx, uint32_t ry)
Draw a single tile from a tilemap.
Parameters
ref Tilemap handle.
idx Tile index (0-based).
x Destination X position.
y Destination Y position.
w Destination width.
h Destination height.
rx Optional crop offset X (source space).
ry Optional crop offset Y (source space).
void lam_tile_draw_billboard_3d (uint32_t ref, uint32_t idx, float x, float y, float z, float w, float h, float anchor_x, float anchor_y)
Draw a billboard sprite standing upright in 3D world space.
Parameters
ref Tilemap handle.
idx Tile index (0-based).
x,y,z Anchor position in world coordinates (e.g. feet position).
w,h Sprite width and height in world units.
anchor_x Horizontal anchor (0.0 = left, 0.5 = center, 1.0 = right).
anchor_y Vertical anchor (0.0 = bottom/feet, 0.5 = center, 1.0 = top).
void lam_tile_draw_ground_3d (uint32_t ref, uint32_t idx, float x, float y, float z, float w, float h)
Draw a single tile lying flat on the 3D ground plane (Z = elevation).
Parameters
ref Tilemap handle.
idx Tile index (0-based).
x,y World coordinates of top-left corner on ground plane.
z Elevation (Z coordinate).
w,h Width and height of tile in world units.
void lam_tile_map_draw (uint32_t ref, const uint16_t * tiles, uint32_t map_w, uint32_t map_h, int32_t start_x, int32_t start_y, uint32_t scale)
Render a complete 2D grid map from an array of tile indices.
Parameters
ref Tilemap handle.
tiles Pointer to 2D array of tile indices (row-major, map_w * map_h entries).
map_w Width of map in tiles.
map_h Height of map in tiles.
start_x Destination X coordinate on screen in pixels.
start_y Destination Y coordinate on screen in pixels.
scale Integer scale multiplier for each tile (1 = 1x, 2 = 2x, etc.).
Author
Generated automatically by Doxygen for liblamina from the source code.