Configuration

struct CRConfig

A struct which holds all of the configuration information used to draw things on the screen. All of the primary drawing, layer, window, and camera information is stored in here.

int window_width

Width of the window.

int window_height

Height of the window.

int fps

Target FPS

char *title

Window Title

float tile_size

Tile size (width and height) in pixels

int default_layer_width

Default layer width, in number of tiles

int default_layer_height

Default layer height, in number of tiles

Color default_foreground

Default foreground tile color. Used for drawing text and tinting tilemap tiles.

Color default_background

Default background tile color.

uint8_t default_visibility

Default tile visibility

CRLayer *world_layers

Pointer to an array of world layers

size_t world_layer_count

Size of the world layer array

CRLayer *ui_layers

Pointer to an array of UI layers

size_t ui_layer_count

Size of the UI layer array

CRMask *masks

Pointer to an array of layer masks

size_t mask_count

Size of the mask array

Camera2D main_camera

Main camera struct

Color background_color

Background color of the screen

CRCharIndexAssoc char_index_assoc[255]

Character-to-index association array

CRCharIndexAssoc *assocs

Pointer to an array of additional character-to-index associations beyond the first 255

size_t assoc_count

Size of the assocs array

Font *fonts

Pointer to an array of font structs

size_t font_count

Size of the font array

CRTilemap *tilemaps

Pointer to an array of tilemaps

size_t tilemap_count

Size of the tilemap array

void CRSetCharacterAssoc(char *character, int index)

Associates a character with an index on a tilemap. Takes in an up-to 4 byte-long character. Any character smaller than 4 bytes must be null terminated. This lets the user represent tiles as characters, but associate them with a specific position on a tilemap.

For example, if you want to use “@” for your player character, but the tile is index 10 on your tilemap, you would call:

CRSetCharacterAssoc("@", 10);