LDK_TEXTURE_ATLAS_REGION_NAME_CAPACITY

#define LDK_TEXTURE_ATLAS_REGION_NAME_CAPACITY 96u
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_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_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_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.