LDK_TEXTURE_ATLAS_REGION_NAME_CAPACITY

#define LDK_TEXTURE_ATLAS_REGION_NAME_CAPACITY 96u
Function in ldk_texture_atlas.h

ldk_texture_atlas_validate

Validate the texture atlas.

LDK_API bool ldk_texture_atlas_validate(const LDKTextureAtlas *atlas);

Parameters

const LDKTextureAtlas *atlas
Texture atlas being inspected or modified.

Returns

True if the operation succeeds; false otherwise.

Function in ldk_texture_atlas.h

ldk_texture_atlas_texture_set

Set the texture atlas texture.

LDK_API bool ldk_texture_atlas_texture_set(
 LDKTextureAtlas *atlas,
 const char *path
);

Parameters

LDKTextureAtlas *atlas
Texture atlas being inspected or modified.
const char *path
Path identifying the file or resource.

Returns

True if the operation succeeds; false otherwise.

Function in ldk_texture_atlas.h

ldk_texture_atlas_region_find_const

Find a region by stable ID without exposing mutable access.

LDK_API const LDKTextureAtlasRegion * ldk_texture_atlas_region_find_const(
 const LDKTextureAtlas *atlas,
 u64 id
);

Parameters

const LDKTextureAtlas *atlas
Texture atlas being inspected or modified.
u64 id
Identifier of the target object.

Returns

Pointer to the requested object or data; NULL when unavailable.

Function in ldk_texture_atlas.h

ldk_texture_atlas_region_add

Add the texture atlas region.

LDK_API bool ldk_texture_atlas_region_add(
 LDKTextureAtlas *atlas,
 const char *name,
 u32 x,
 u32 y,
 u32 width,
 u32 height,
 u64 *out_id
);

Parameters

LDKTextureAtlas *atlas
Texture atlas being inspected or modified.
const char *name
Name identifying the object or setting.
u32 x
X coordinate or component.
u32 y
Y coordinate or component.
u32 width
Width in pixels or the units expected by the API.
u32 height
Height in pixels or the units expected by the API.
u64 *out_id
Receives the resulting ID.

Returns

True if the operation succeeds; false otherwise.

Function in ldk_texture_atlas.h

ldk_texture_atlas_region_remove

Remove the texture atlas region.

LDK_API bool ldk_texture_atlas_region_remove(
 LDKTextureAtlas *atlas,
 u64 id
);

Parameters

LDKTextureAtlas *atlas
Texture atlas being inspected or modified.
u64 id
Identifier of the target object.

Returns

True if the operation succeeds; false otherwise.

Function in ldk_texture_atlas.h

ldk_texture_atlas_region_rename

Rename a region without changing its stable identifier.

LDK_API bool ldk_texture_atlas_region_rename(
 LDKTextureAtlas *atlas,
 u64 id,
 const char *name
);

Parameters

LDKTextureAtlas *atlas
Texture atlas being inspected or modified.
u64 id
Identifier of the target object.
const char *name
Name identifying the object or setting.

Returns

True if the operation succeeds; false otherwise.

Function in ldk_texture_atlas.h

ldk_texture_atlas_grid_append

Add a grid of regions to the atlas.

LDK_API bool ldk_texture_atlas_grid_append(
 LDKTextureAtlas *atlas,
 u32 image_width,
 u32 image_height,
 u32 cell_width,
 u32 cell_height,
 u32 spacing_x,
 u32 spacing_y,
 u32 margin_x,
 u32 margin_y
);

Parameters

LDKTextureAtlas *atlas
Texture atlas being inspected or modified.
u32 image_width
Image width used by this operation.
u32 image_height
Image height used by this operation.
u32 cell_width
Cell width used by this operation.
u32 cell_height
Cell height used by this operation.
u32 spacing_x
Spacing x used by this operation.
u32 spacing_y
Spacing y used by this operation.
u32 margin_x
Margin x used by this operation.
u32 margin_y
Margin y used by this operation.

Returns

True if the operation succeeds; false otherwise.

Function in ldk_texture_atlas.h

ldk_texture_atlas_region_uv

Compute normalized UV coordinates for an atlas region. Atlas regions are specified in pixel coordinates; this operation converts them to normalized texture coordinates.

LDK_API bool ldk_texture_atlas_region_uv(
 const LDKTextureAtlasRegion *region,
 u32 image_width,
 u32 image_height,
 float out_uv[4]
);

Parameters

const LDKTextureAtlasRegion *region
Region used by this operation.
u32 image_width
Image width used by this operation.
u32 image_height
Image height used by this operation.
float out_uv[4]
Receives the resulting UV.

Returns

True if the operation succeeds; false otherwise.

Function in ldk_texture_atlas.h

ldk_texture_atlas_to_tml

Serialize the atlas and its regions to TML.

LDK_API bool ldk_texture_atlas_to_tml(
 const LDKTextureAtlas *atlas,
 char **out_text
);

Parameters

const LDKTextureAtlas *atlas
Texture atlas being inspected or modified.
char **out_text
Destination buffer for the resulting text.

Returns

True if the operation succeeds; false otherwise.

Function in ldk_texture_atlas.h

ldk_texture_atlas_from_tml

Read an atlas and its regions from TML.

LDK_API bool ldk_texture_atlas_from_tml(
 LDKTextureAtlas *atlas,
 const char *text
);

Parameters

LDKTextureAtlas *atlas
Texture atlas being inspected or modified.
const char *text
Text used by this operation.

Returns

True if the operation succeeds; false otherwise.

Function in ldk_texture_atlas.h

ldk_texture_atlas_load

Load the texture atlas.

LDK_API bool ldk_texture_atlas_load(
 LDKTextureAtlas *atlas,
 const char *filename
);

Parameters

LDKTextureAtlas *atlas
Texture atlas being inspected or modified.
const char *filename
Filename used by this operation.

Returns

True if the operation succeeds; false otherwise.

Function in ldk_texture_atlas.h

ldk_texture_atlas_save

Save the texture atlas.

LDK_API bool ldk_texture_atlas_save(
 const LDKTextureAtlas *atlas,
 const char *filename
);

Parameters

const LDKTextureAtlas *atlas
Texture atlas being inspected or modified.
const char *filename
Filename used by this operation.

Returns

True if the operation succeeds; false otherwise.