Sprite atlases¶
Typedefs
-
typedef enum binocle_atlas_file_format binocle_atlas_file_format
The format of the atlas. We currently support libGDX and TexturePacker
-
typedef struct binocle_atlas_animation binocle_atlas_animation¶
-
typedef struct binocle_atlas_slice_key binocle_atlas_slice_key¶
-
typedef struct binocle_atlas_slice binocle_atlas_slice¶
-
typedef struct binocle_atlas_tp_meta binocle_atlas_tp_meta¶
-
typedef struct binocle_atlas_tp_frame binocle_atlas_tp_frame¶
-
typedef struct binocle_atlas_texturepacker binocle_atlas_texturepacker¶
Enums
Functions
-
bool binocle_atlas_load_texturepacker(char *filename, binocle_atlas_texturepacker *atlas)¶
Load a TexturePacker JSON atlas
- Parameters
filename – the JSON file path and name
- Returns
an instance of binocle_atlas_texturepacker with the data of the atlas
-
void binocle_atlas_texturepacker_create_subtextures(binocle_atlas_texturepacker *atlas, struct sg_image *texture, struct binocle_subtexture *subtextures, int *num_subtextures)¶
Load a TexturePacker JSON atlas
- Parameters
atlas – an instance of binocle_atlas_texturepacker with the data of the atlas
texture – the corresponding texture that we already loaded
subtextures – an array of subtextures to store those coming from the JSON
num_subtextures – the number of subtextures that have been loaded by this function
-
void binocle_atlas_destroy_texturepacker(binocle_atlas_texturepacker *atlas)¶
Frees the resources of the atlas
- Parameters
atlas – an instance of binocle_atlas_texturepacker to release
-
void binocle_atlas_load_libgdx(char *filename, struct sg_image *texture, struct binocle_subtexture *subtextures, int *num_subtextures)¶
Load a libGDX atlas
Note
Not yet implemented
- Parameters
filename – the JSON file path and name
texture – the corresponding texture that we already loaded
subtextures – an array of subtextures to store those coming from the JSON
num_subtextures – the number of subtextures that have been loaded by this function
-
void binocle_atlas_animation_destroy(binocle_atlas_animation *animations, size_t num_animations)¶
Frees the memory allocated while loading animations
- Parameters
animations – a pointer to the binocle_atlas_animation struct to free
num_animations – the number of animations previously loaded
-
struct binocle_atlas_animation
-
struct binocle_atlas_slice_key
-
struct binocle_atlas_slice
-
struct binocle_atlas_tp_meta
-
struct binocle_atlas_tp_frame
-
struct binocle_atlas_texturepacker