cmdfx 0.1.0
Lightweight game engine for your terminal
Loading...
Searching...
No Matches
builder.h
Go to the documentation of this file.
1
11
12#pragma once
13
14#ifdef __cplusplus
15extern "C" {
16#endif
17
18#pragma region Character Builder
19
20// Utility Functions - General (Character)
21
27int getArrayWidth(char** array);
28
34int getArrayHeight(char** array);
35
36// Core Functions (Character)
37
54char** CharBuilder_create(int width, int height);
55
68int CharBuilder_setChar(char** array, int x, int y, char c);
69
83int CharBuilder_hLine(char** array, int x, int y, int width, char c);
84
98int CharBuilder_vLine(char** array, int x, int y, int height, char c);
99
114int CharBuilder_rect(char** array, int x, int y, int width, int height, char c);
115
126int CharBuilder_fillRect(char** array, int x, int y, int width, int height, char c);
127
137int CharBuilder_circle(char** array, int x, int y, int radius, char c);
138
148int CharBuilder_fillCircle(char** array, int x, int y, int radius, char c);
149
160int CharBuilder_ellipse(char** array, int x, int y, int xradius, int yradius, char c);
161
172int CharBuilder_fillEllipse(char** array, int x, int y, int xradius, int yradius, char c);
173
184int CharBuilder_line(char** array, int x1, int y1, int x2, int y2, char c);
185
199int CharBuilder_text(char** array, int x, int y, char* text);
200
201// Utility Functions - Sizing
202
216int CharBuilder_resize(char** array, int width, int height);
217
232int CharBuilder_resizeWithPadding(char** array, int width, int height, char padding);
233
244int CharBuilder_center(char** array);
245
259int CharBuilder_resizeAndCenter(char** array, int width, int height);
260
261#pragma endregion
262
263#pragma region ANSI Builder
264
265// Utility Functions - General (ANSI)
266
272int getAnsiArrayWidth(char*** array);
273
279int getAnsiArrayHeight(char*** array);
280
281// Core Functions (ANSI)
282
296char*** AnsiBuilder_create(int width, int height);
297
319int AnsiBuilder_setAnsi(char*** array, int x, int y, char* c);
320
334int AnsiBuilder_hLine(char*** array, int x, int y, int width, char* c);
335
349int AnsiBuilder_vLine(char*** array, int x, int y, int height, char* c);
350
365int AnsiBuilder_rect(char*** array, int x, int y, int width, int height, char* c);
366
381int AnsiBuilder_fillRect(char*** array, int x, int y, int width, int height, char* c);
382
396int AnsiBuilder_circle(char*** array, int x, int y, int radius, char* c);
397
411int AnsiBuilder_fillCircle(char*** array, int x, int y, int radius, char* c);
412
427int AnsiBuilder_ellipse(char*** array, int x, int y, int xradius, int yradius, char* c);
428
443int AnsiBuilder_fillEllipse(char*** array, int x, int y, int xradius, int yradius, char* c);
444
459int AnsiBuilder_line(char*** array, int x1, int y1, int x2, int y2, char* c);
460
461#pragma endregion
462
463#ifdef __cplusplus
464}
465#endif
int CharBuilder_hLine(char **array, int x, int y, int width, char c)
Draws a horizontal line in a 2D Character Array.
char *** AnsiBuilder_create(int width, int height)
Creates a 2D String Array with a specific width and height.
int CharBuilder_fillCircle(char **array, int x, int y, int radius, char c)
Fills a circle in a 2D Character Array.
int AnsiBuilder_fillCircle(char ***array, int x, int y, int radius, char *c)
Fills a circle in a 2D String Array.
int CharBuilder_resize(char **array, int width, int height)
Resizes an 2D Character Array to a specific width and height.
int getArrayWidth(char **array)
Gets the width of a 2D Character Array.
int CharBuilder_setChar(char **array, int x, int y, char c)
Sets a character in a 2D Character Array.
int AnsiBuilder_fillRect(char ***array, int x, int y, int width, int height, char *c)
Fills a rectangle in a 2D String Array.
int AnsiBuilder_fillEllipse(char ***array, int x, int y, int xradius, int yradius, char *c)
Fills an ellipse in a 2D String Array.
int AnsiBuilder_ellipse(char ***array, int x, int y, int xradius, int yradius, char *c)
Draws an ellipse in a 2D String Array.
int CharBuilder_rect(char **array, int x, int y, int width, int height, char c)
Draws a rectangle in a 2D Character Array.
int AnsiBuilder_rect(char ***array, int x, int y, int width, int height, char *c)
Draws a rectangle in a 2D String Array.
int CharBuilder_fillEllipse(char **array, int x, int y, int xradius, int yradius, char c)
Fills an ellipse in a 2D Character Array.
int CharBuilder_resizeWithPadding(char **array, int width, int height, char padding)
Resizes an 2D Character Array to a specific width and height with padding.
int getAnsiArrayWidth(char ***array)
Gets the width of a 2D String Array.
int AnsiBuilder_circle(char ***array, int x, int y, int radius, char *c)
Draws a circle in a 2D String Array.
int CharBuilder_circle(char **array, int x, int y, int radius, char c)
Draws a circle in a 2D Character Array.
int AnsiBuilder_hLine(char ***array, int x, int y, int width, char *c)
Draws a horizontal line in a 2D String Array.
int CharBuilder_line(char **array, int x1, int y1, int x2, int y2, char c)
Draws a line in a 2D Character Array.
int CharBuilder_center(char **array)
Centers an 2D Character Array.
int CharBuilder_vLine(char **array, int x, int y, int height, char c)
Draws a vertical line in a 2D Character Array.
int AnsiBuilder_setAnsi(char ***array, int x, int y, char *c)
Sets an ANSI code in a 2D String Array.
int CharBuilder_ellipse(char **array, int x, int y, int xradius, int yradius, char c)
Draws an ellipse in a 2D Character Array.
int CharBuilder_resizeAndCenter(char **array, int width, int height)
Resizes and centers an 2D Character Array.
int CharBuilder_fillRect(char **array, int x, int y, int width, int height, char c)
Fills a rectangle in a 2D Character Array.
int CharBuilder_text(char **array, int x, int y, char *text)
Writes text in a 2D Character Array.
int getArrayHeight(char **array)
Gets the height of a 2D Character Array.
char ** CharBuilder_create(int width, int height)
Creates a 2D Character Array with a specific width and height.
int getAnsiArrayHeight(char ***array)
Gets the height of a 2D String Array.
int AnsiBuilder_line(char ***array, int x1, int y1, int x2, int y2, char *c)
Draws a line in a 2D String Array.
int AnsiBuilder_vLine(char ***array, int x, int y, int height, char *c)
Draws a vertical line in a 2D String Array.