cmdfx 0.2.0
Lightweight game engine for your terminal
Loading...
Searching...
No Matches
builder.h File Reference

Builder API for building 2D Character Arrays. More...

Go to the source code of this file.

Enumerations

enum  CmdFX_GradientDirection {
  GRADIENT_HORIZONTAL , GRADIENT_HORIZONTAL_REVERSE , GRADIENT_VERTICAL , GRADIENT_VERTICAL_REVERSE ,
  GRADIENT_ANGLE_45 , GRADIENT_ANGLE_135 , GRADIENT_ANGLE_225 , GRADIENT_ANGLE_315 ,
  GRADIENT_RADIAL , GRADIENT_CONICAL
}
 Represents a color gradient that can be applied . More...
 

Functions

int getCharArrayWidth (char **array)
 Gets the width of a 2D Character Array.
 
int getCharArrayHeight (char **array)
 Gets the height of a 2D Character Array.
 
char ** createCharArrayCopy (char **array)
 Creates a copy of a 2D Character Array.
 
char ** Char2DBuilder_copy (char **array)
 Copies a 2D Character Array.
 
int areCharArraysSameSize (char **array1, char **array2)
 Checks if two 2D Character Arrays are the same size.
 
int compareCharArrays (char **array1, char **array2)
 Compares two 2D Character Arrays.
 
int printCharArray (char **array)
 Prints a 2D Character Array.
 
char ** Char2DBuilder_create (int width, int height)
 Creates a 2D Character Array with a specific width and height.
 
char ** Char2DBuilder_createFilled (int width, int height, char c)
 Creates a 2D Character Array with a specific width and height, filled with a specific character.
 
int Char2DBuilder_setChar (char **array, int x, int y, char c)
 Sets a character in a 2D Character Array.
 
int Char2DBuilder_hLine (char **array, int x, int y, int width, char c)
 Draws a horizontal line in a 2D Character Array.
 
int Char2DBuilder_vLine (char **array, int x, int y, int height, char c)
 Draws a vertical line in a 2D Character Array.
 
int Char2DBuilder_rect (char **array, int x, int y, int width, int height, char c)
 Draws a rectangle in a 2D Character Array.
 
int Char2DBuilder_fillRect (char **array, int x, int y, int width, int height, char c)
 Fills a rectangle in a 2D Character Array.
 
int Char2DBuilder_fill (char **array, char c)
 Fills the entire 2D Character Array.
 
int Char2DBuilder_circle (char **array, int x, int y, int radius, char c)
 Draws a circle in a 2D Character Array.
 
int Char2DBuilder_fillCircle (char **array, int x, int y, int radius, char c)
 Fills a circle in a 2D Character Array.
 
int Char2DBuilder_ellipse (char **array, int x, int y, int xradius, int yradius, char c)
 Draws an ellipse in a 2D Character Array.
 
int Char2DBuilder_fillEllipse (char **array, int x, int y, int xradius, int yradius, char c)
 Fills an ellipse in a 2D Character Array.
 
int Char2DBuilder_line (char **array, int x1, int y1, int x2, int y2, char c)
 Draws a line in a 2D Character Array.
 
int Char2DBuilder_polygon (char **array, int x, int y, int sides, int radius, char c)
 Draws a polygon in a 2D Character Array.
 
int Char2DBuilder_fillPolygon (char **array, int x, int y, int sides, int radius, char c)
 Fills a polygon in a 2D Character Array.
 
int Char2DBuilder_text (char **array, int x, int y, char *text)
 Writes text in a 2D Character Array.
 
int Char2DBuilder_resize (char **array, int width, int height)
 Resizes a 2D Character Array to a specific width and height.
 
int Char2DBuilder_resizeWithPadding (char **array, int width, int height, char padding)
 Resizes a 2D Character Array to a specific width and height with padding.
 
int Char2DBuilder_center (char **array)
 Centers a 2D Character Array.
 
int Char2DBuilder_resizeAndCenter (char **array, int width, int height)
 Resizes and centers a 2D Character Array.
 
int Char2DBuilder_rotate (char **array, double radians)
 Rotates a 2D Character Array.
 
double Char2DBuilder_getRotationAngle (char **array)
 Gets the rotation angle of a 2D Character Array.
 
int Char2DBuilder_hFlip (char **array)
 Flips a 2D Character Array horizontally.
 
int Char2DBuilder_vFlip (char **array)
 Flips a 2D Character Array vertically.
 
char ** Char2DBuilder_transpose (char **array)
 Transposes a 2D Character Array.
 
int Char2DBuilder_replaceAll (char **array, char find, char replace)
 Replaces all instances of a character in a 2D Character Array.
 
char ** Char2DBuilder_scale (char **array, double scale)
 Scales a 2D Character Array.
 
int Char2DBuilder_gradient (char **array, int x, int y, int width, int height, char start, char end, enum CmdFX_GradientDirection direction)
 Creates a gradient in a 2D Character Array.
 
int Char2DBuilder_multiGradient (char **array, int x, int y, int width, int height, int numChars, char *gradient, enum CmdFX_GradientDirection direction)
 Creates a multi-gradient in a 2D Character Array.
 
int Char2DBuilder_multiGradients (char **array, int x, int y, int width, int height, int numChars, char *gradient, double *percentages, enum CmdFX_GradientDirection direction)
 Creates a multi-gradient in a 2D Character Array with percentages.
 
int Char2DBuilder_gradientFull (char **array, char start, char end, enum CmdFX_GradientDirection direction)
 Creates a full gradient in a 2D Character Array.
 
int Char2DBuilder_multiGradientFull (char **array, int numChars, char *gradient, enum CmdFX_GradientDirection direction)
 Creates a multi-gradient in a 2D Character Array.
 
int Char2DBuilder_multiGradientsFull (char **array, int numChars, char *gradient, double *percentages, enum CmdFX_GradientDirection direction)
 Creates a multi-gradient in a 2D Character Array with percentages.
 
int getStringArrayWidth (char ***array)
 Gets the width of a 2D String Array.
 
int getStringArrayHeight (char ***array)
 Gets the height of a 2D String Array.
 
char *** createStringArrayCopy (char ***array)
 Creates a copy of a 2D String Array.
 
int clearStringArray (char ***array)
 Clears a 2D String Array.
 
int areStringArraysSameSize (char ***array1, char ***array2)
 Checks if two 2D String Arrays are the same size.
 
int compareStringArrays (char ***array1, char ***array2)
 Compares two 2D String Arrays.
 
int printStringArray (char ***array)
 Prints a 2D String Array.
 
char *** String2DBuilder_create (int width, int height)
 Creates a 2D String Array with a specific width and height.
 
char *** String2DBuilder_createFilled (int width, int height, char *c)
 Creates a 2D String Array with a specific width and height, filled with a specific string.
 
int String2DBuilder_setAnsi (char ***array, int x, int y, char *c)
 Sets an ANSI code in a 2D String Array.
 
int String2DBuilder_hLine (char ***array, int x, int y, int width, char *c)
 Draws a horizontal line in a 2D String Array.
 
int String2DBuilder_vLine (char ***array, int x, int y, int height, char *c)
 Draws a vertical line in a 2D String Array.
 
int String2DBuilder_rect (char ***array, int x, int y, int width, int height, char *c)
 Draws a rectangle in a 2D String Array.
 
int String2DBuilder_fillRect (char ***array, int x, int y, int width, int height, char *c)
 Fills a rectangle in a 2D String Array.
 
int String2DBuilder_fill (char ***array, char *c)
 Fills the entire 2D String Array.
 
int String2DBuilder_circle (char ***array, int x, int y, int radius, char *c)
 Draws a circle in a 2D String Array.
 
int String2DBuilder_fillCircle (char ***array, int x, int y, int radius, char *c)
 Fills a circle in a 2D String Array.
 
int String2DBuilder_ellipse (char ***array, int x, int y, int xradius, int yradius, char *c)
 Draws an ellipse in a 2D String Array.
 
int String2DBuilder_fillEllipse (char ***array, int x, int y, int xradius, int yradius, char *c)
 Fills an ellipse in a 2D String Array.
 
int String2DBuilder_line (char ***array, int x1, int y1, int x2, int y2, char *c)
 Draws a line in a 2D String Array.
 
int String2DBuilder_polygon (char ***array, int x, int y, int sides, int radius, char *c)
 Draws a polygon in a 2D String Array.
 
int String2DBuilder_fillPolygon (char ***array, int x, int y, int sides, int radius, char *c)
 Fills a polygon in a 2D String Array.
 
int String2DBuilder_rotate (char ***array, double radians)
 Rotates a 2D String Array.
 
int String2DBuilder_hFlip (char ***array)
 Flips a 2D String Array horizontally.
 
int String2DBuilder_vFlip (char ***array)
 Flips a 2D String Array vertically.
 
char *** String2DBuilder_transpose (char ***array)
 Transposes a 2D String Array.
 
int String2DBuilder_replaceAll (char ***array, char *find, char *replace)
 Replaces all instances of an ANSI code in a 2D String Array.
 
char *** String2DBuilder_scale (char ***array, double scale)
 Scales a 2D String Array.
 
int String2DBuilder_gradientForeground (char ***array, int x, int y, int width, int height, int start, int end, enum CmdFX_GradientDirection direction)
 Sets a foreground gradient in a 2D String Array.
 
int String2DBuilder_gradientBackground (char ***array, int x, int y, int width, int height, int start, int end, enum CmdFX_GradientDirection direction)
 Sets a background gradient in a 2D String Array.
 
int String2DBuilder_multiGradientForeground (char ***array, int x, int y, int width, int height, int numColors, int *colors, enum CmdFX_GradientDirection direction)
 Sets a foreground gradient in a 2D String Array.
 
int String2DBuilder_multiGradientBackground (char ***array, int x, int y, int width, int height, int numColors, int *colors, enum CmdFX_GradientDirection direction)
 Sets a background gradient in a 2D String Array.
 
int String2DBuilder_multiGradientsForeground (char ***array, int x, int y, int width, int height, int numColors, int *colors, double *percentages, enum CmdFX_GradientDirection direction)
 Sets a foreground gradient in a 2D String Array.
 
int String2DBuilder_multiGradientsBackground (char ***array, int x, int y, int width, int height, int numColors, int *colors, double *percentages, enum CmdFX_GradientDirection direction)
 Sets a background gradient in a 2D String Array.
 
int String2DBuilder_gradientForegroundFull (char ***array, int start, int end, enum CmdFX_GradientDirection direction)
 Sets a background gradient in a 2D String Array.
 
int String2DBuilder_gradientBackgroundFull (char ***array, int start, int end, enum CmdFX_GradientDirection direction)
 Sets a background gradient in a 2D String Array.
 
int String2DBuilder_multiGradientForegroundFull (char ***array, int numColors, int *colors, enum CmdFX_GradientDirection direction)
 Sets a foreground gradient in a 2D String Array.
 
int String2DBuilder_multiGradientBackgroundFull (char ***array, int numColors, int *colors, enum CmdFX_GradientDirection direction)
 Sets a background gradient in a 2D String Array.
 
int String2DBuilder_multiGradientsForegroundFull (char ***array, int numColors, int *colors, double *percentages, enum CmdFX_GradientDirection direction)
 Sets a foreground gradient in a 2D String Array.
 
int String2DBuilder_multiGradientsBackgroundFull (char ***array, int numColors, int *colors, double *percentages, enum CmdFX_GradientDirection direction)
 Sets a background gradient in a 2D String Array.
 

Detailed Description

Builder API for building 2D Character Arrays.

Author
Gregory Mitchell (me@gm.nosp@m.itch.nosp@m.215.x.nosp@m.yz)
Version
0.1.0
Date
2025-01-23

Enumeration Type Documentation

◆ CmdFX_GradientDirection

Represents a color gradient that can be applied .

A color gradient is a smooth transition between two or more colors. The gradient can be applied to the foreground or background, and can be applied in different directions.

Enumerator
GRADIENT_HORIZONTAL 

A horizontal gradient.

GRADIENT_HORIZONTAL_REVERSE 

A horizontal gradient in reverse.

GRADIENT_VERTICAL 

A vertical gradient.

GRADIENT_VERTICAL_REVERSE 

A vertical gradient in reverse.

GRADIENT_ANGLE_45 

A 45-degree gradient.

GRADIENT_ANGLE_135 

A 135-degree gradient.

GRADIENT_ANGLE_225 

A 225-degree gradient.

GRADIENT_ANGLE_315 

A 315-degree gradient.

GRADIENT_RADIAL 

A radial gradient.

GRADIENT_CONICAL 

A conical gradient.

Function Documentation

◆ areCharArraysSameSize()

int areCharArraysSameSize ( char ** array1,
char ** array2 )

Checks if two 2D Character Arrays are the same size.

This method checks if two 2D Character Arrays are the same size. If the two arrays are the same size, the method will return 1. If the two arrays are not the same size, the method will return 0.

Parameters
array1The first 2D Character Array.
array2The second 2D Character Array.
Returns
1 if the arrays are the same size, 0 if the arrays are not the same size.

◆ areStringArraysSameSize()

int areStringArraysSameSize ( char *** array1,
char *** array2 )

Checks if two 2D String Arrays are the same size.

This method checks if two 2D String Arrays are the same size. If the two arrays are the same size, the method will return 1. If the two arrays are not the same size, the method will return 0.

Parameters
array1The first 2D String Array.
array2The second 2D String Array.
Returns
1 if the arrays are the same size, 0 if the arrays are not the same size.

◆ Char2DBuilder_center()

int Char2DBuilder_center ( char ** array)

Centers a 2D Character Array.

This method centers a 2D Character Array both horizontally and vertically. It will reposition the characters depending on whether there is whitespace surrounding other characters.

Parameters
arrayThe 2D Character Array.
Returns
0 if successful, -1 if an error occurred.

◆ Char2DBuilder_circle()

int Char2DBuilder_circle ( char ** array,
int x,
int y,
int radius,
char c )

Draws a circle in a 2D Character Array.

Parameters
arrayThe character array.
xThe x coordinate.
yThe y coordinate.
radiusThe radius of the circle.
cThe character to draw the circle with.
Returns
0 if successful, -1 if an error occurred.

◆ Char2DBuilder_copy()

char ** Char2DBuilder_copy ( char ** array)

Copies a 2D Character Array.

This method creates a copy of a 2D Character Array. The new array must be freed after use.

Parameters
arrayThe 2D Character Array.
Returns
The copied 2D Character Array.

◆ Char2DBuilder_create()

char ** Char2DBuilder_create ( int width,
int height )

Creates a 2D Character Array with a specific width and height.

This method creates an array with a specific width and height. The array will be initialized with the space character.

The values at array[height] will be set to 0 for null termination. It is advised that you create a char** with this method and pass it to other functions presented in this header file, rather than create a char** and pass it to other functions, in order to avoid undefined behavior.

Parameters
widthThe width of the array.
heightThe height of the array.
Returns
The 2D Character Array.

◆ Char2DBuilder_createFilled()

char ** Char2DBuilder_createFilled ( int width,
int height,
char c )

Creates a 2D Character Array with a specific width and height, filled with a specific character.

This method creates an array with a specific width and height. The array will be initialized with the specified character.

The values at array[height] will be set to 0 for null termination. It is advised that you create a char** with this method and pass it to other functions presented in this header file, rather than create a char** and pass it to other functions, in order to avoid undefined behavior.

Parameters
widthThe width of the array.
heightThe height of the array.
cThe character to fill the array with.
Returns
The 2D Character Array.

◆ Char2DBuilder_ellipse()

int Char2DBuilder_ellipse ( char ** array,
int x,
int y,
int xradius,
int yradius,
char c )

Draws an ellipse in a 2D Character Array.

Parameters
arrayThe character array.
xThe x coordinate.
yThe y coordinate.
xradiusThe x radius of the ellipse.
yradiusThe y radius of the ellipse.
cThe character to draw the ellipse with.
Returns
0 if successful, -1 if an error occurred.

◆ Char2DBuilder_fill()

int Char2DBuilder_fill ( char ** array,
char c )

Fills the entire 2D Character Array.

Parameters
arrayThe character array.
cThe character to fill the array with.
Returns
0 if successful, -1 if an error occured.

◆ Char2DBuilder_fillCircle()

int Char2DBuilder_fillCircle ( char ** array,
int x,
int y,
int radius,
char c )

Fills a circle in a 2D Character Array.

Parameters
arrayThe character array.
xThe x coordinate.
yThe y coordinate.
radiusThe radius of the circle.
cThe character to fill the circle with.
Returns
0 if successful, -1 if an error occurred.

◆ Char2DBuilder_fillEllipse()

int Char2DBuilder_fillEllipse ( char ** array,
int x,
int y,
int xradius,
int yradius,
char c )

Fills an ellipse in a 2D Character Array.

Parameters
arrayThe character array.
xThe x coordinate.
yThe y coordinate.
xradiusThe x radius of the ellipse.
yradiusThe y radius of the ellipse.
cThe character to fill the ellipse with.
Returns
0 if successful, -1 if an error occurred.

◆ Char2DBuilder_fillPolygon()

int Char2DBuilder_fillPolygon ( char ** array,
int x,
int y,
int sides,
int radius,
char c )

Fills a polygon in a 2D Character Array.

This method fills a polygon in a 2D Character Array. If the x or y coordinate is out of bounds, the method will return -1. If the polygon goes out of bounds, the polygon will be cropped.

Parameters
arrayThe character array.
xThe x coordinate.
yThe y coordinate.
sidesThe number of sides of the polygon.
radiusThe radius of the polygon.
cThe character to fill the polygon with.
Returns
0 if successful, -1 if an error occurred.

◆ Char2DBuilder_fillRect()

int Char2DBuilder_fillRect ( char ** array,
int x,
int y,
int width,
int height,
char c )

Fills a rectangle in a 2D Character Array.

Parameters
arrayThe character array.
xThe x coordinate.
yThe y coordinate.
widthThe width of the rectangle.
heightThe height of the rectangle.
cThe character to fill the rectangle with.
Returns
0 if successful, -1 if an error occurred.

◆ Char2DBuilder_getRotationAngle()

double Char2DBuilder_getRotationAngle ( char ** array)

Gets the rotation angle of a 2D Character Array.

This method returns the rotation angle of a 2D Character Array in radians. The angle will be between -PI and PI. If the 2D Character Array is not rotated, the method will return 0. Rotation is calculated by the number of whitespace characters in the 2D Character Array, meaning this method relies on whether it is visually rotated or not.

Parameters
arrayThe 2D Character Array.
Returns
The rotation angle of the 2D Character Array in radians.

◆ Char2DBuilder_gradient()

int Char2DBuilder_gradient ( char ** array,
int x,
int y,
int width,
int height,
char start,
char end,
enum CmdFX_GradientDirection direction )

Creates a gradient in a 2D Character Array.

This method creates a gradient in a 2D Character Array. The gradient will be created from the start character to the end character. The gradient will be created in the specified direction.

This function supports a simple gradient from one character to another at 50% each.

Parameters
arrayThe 2D Character Array.
xThe x coordinate.
yThe y coordinate.
widthThe width of the gradient.
heightThe height of the gradient.
startThe start character.
endThe end character.
directionThe direction of the gradient.
Returns
0 if successful, -1 if an error occurred.

◆ Char2DBuilder_gradientFull()

int Char2DBuilder_gradientFull ( char ** array,
char start,
char end,
enum CmdFX_GradientDirection direction )

Creates a full gradient in a 2D Character Array.

This method creates a full gradient in a 2D Character Array. The gradient will be created from the start character to the end character. The gradient will be created in the specified direction.

This function supports a full gradient from one character to another.

Parameters
arrayThe 2D Character Array.
startThe start character.
endThe end character.
directionThe direction of the gradient.
Returns
0 if successful, -1 if an error occurred.

◆ Char2DBuilder_hFlip()

int Char2DBuilder_hFlip ( char ** array)

Flips a 2D Character Array horizontally.

Parameters
arrayThe 2D Character Array.
Returns
0 if successful, -1 if an error occurred.

◆ Char2DBuilder_hLine()

int Char2DBuilder_hLine ( char ** array,
int x,
int y,
int width,
char c )

Draws a horizontal line in a 2D Character Array.

This method draws a horizontal line in a 2D Character Array. If the x or y coordinate is out of bounds, the method will return -1. If the line goes out of bounds, the line will be cropped.

Parameters
arrayThe character array.
xThe x coordinate.
yThe y coordinate.
widthThe width of the line.
cThe character to draw the line with.
Returns
0 if successful, -1 if an error occurred.

◆ Char2DBuilder_line()

int Char2DBuilder_line ( char ** array,
int x1,
int y1,
int x2,
int y2,
char c )

Draws a line in a 2D Character Array.

Parameters
arrayThe character array.
x1The x coordinate of the first point.
y1The y coordinate of the first point.
x2The x coordinate of the second point.
y2The y coordinate of the second point.
cThe character to draw the line with.
Returns
0 if successful, -1 if an error occurred.

◆ Char2DBuilder_multiGradient()

int Char2DBuilder_multiGradient ( char ** array,
int x,
int y,
int width,
int height,
int numChars,
char * gradient,
enum CmdFX_GradientDirection direction )

Creates a multi-gradient in a 2D Character Array.

This method creates a multi-gradient in a 2D Character Array. The gradient will be created from the start character to the end character. The gradient will be created in the specified direction.

This function supports a multi-gradient from multiple characters at equal intervals.

Parameters
arrayThe 2D Character Array.
xThe x coordinate.
yThe y coordinate.
widthThe width of the gradient.
heightThe height of the gradient.
numCharsThe number of characters in the gradient.
gradientThe gradient characters.
directionThe direction of the gradient.
Returns
0 if successful, -1 if an error occurred.

◆ Char2DBuilder_multiGradientFull()

int Char2DBuilder_multiGradientFull ( char ** array,
int numChars,
char * gradient,
enum CmdFX_GradientDirection direction )

Creates a multi-gradient in a 2D Character Array.

This method creates a multi-gradient in a 2D Character Array. The gradient will be created from the start character to the end character. The gradient will be created in the specified direction.

This function supports a multi-gradient from multiple characters at equal intervals.

Parameters
arrayThe 2D Character Array.
numCharsThe number of characters in the gradient.
gradientThe gradient characters.
directionThe direction of the gradient.
Returns
0 if successful, -1 if an error occurred.

◆ Char2DBuilder_multiGradients()

int Char2DBuilder_multiGradients ( char ** array,
int x,
int y,
int width,
int height,
int numChars,
char * gradient,
double * percentages,
enum CmdFX_GradientDirection direction )

Creates a multi-gradient in a 2D Character Array with percentages.

This method creates a multi-gradient in a 2D Character Array. The gradient will be created from the start character to the end character. The gradient will be created in the specified direction.

This function supports a multi-gradient from multiple characters at specific percentages.

Parameters
arrayThe 2D Character Array.
xThe x coordinate.
yThe y coordinate.
widthThe width of the gradient.
heightThe height of the gradient.
numCharsThe number of characters in the gradient.
gradientThe gradient characters.
percentagesThe percentages of the gradient.
directionThe direction of the gradient.
Returns
0 if successful, -1 if an error occurred.

◆ Char2DBuilder_multiGradientsFull()

int Char2DBuilder_multiGradientsFull ( char ** array,
int numChars,
char * gradient,
double * percentages,
enum CmdFX_GradientDirection direction )

Creates a multi-gradient in a 2D Character Array with percentages.

This method creates a multi-gradient in a 2D Character Array. The gradient will be created from the start character to the end character. The gradient will be created in the specified direction.

This function supports a multi-gradient from multiple characters at specific percentages.

Parameters
arrayThe 2D Character Array.
numCharsThe number of characters in the gradient.
gradientThe gradient characters.
percentagesThe percentages of the gradient.
directionThe direction of the gradient.
Returns
0 if successful, -1 if an error occurred.

◆ Char2DBuilder_polygon()

int Char2DBuilder_polygon ( char ** array,
int x,
int y,
int sides,
int radius,
char c )

Draws a polygon in a 2D Character Array.

This method draws a polygon in a 2D Character Array. If the x or y coordinate is out of bounds, the method will return -1. If the polygon goes out of bounds, the polygon will be cropped.

Parameters
arrayThe character array.
xThe x coordinate.
yThe y coordinate.
sidesThe number of sides of the polygon.
radiusThe radius of the polygon.
cThe character to draw the polygon with.
Returns
0 if successful, -1 if an error occurred.

◆ Char2DBuilder_rect()

int Char2DBuilder_rect ( char ** array,
int x,
int y,
int width,
int height,
char c )

Draws a rectangle in a 2D Character Array.

This method draws a rectangle in a 2D Character Array. If the x or y coordinate is out of bounds, the method will return -1. If the rectangle goes out of bounds, the rectangle will be cropped.

Parameters
arrayThe character array.
xThe x coordinate.
yThe y coordinate.
widthThe width of the rectangle.
heightThe height of the rectangle.
cThe character to draw the rectangle with.
Returns
0 if successful, -1 if an error occurred.

◆ Char2DBuilder_replaceAll()

int Char2DBuilder_replaceAll ( char ** array,
char find,
char replace )

Replaces all instances of a character in a 2D Character Array.

Parameters
arrayThe 2D Character Array.
findThe character to find.
replaceThe character to replace the found character with.
Returns
The number of characters replaced, 0 if none, or -1 if an error occurred.

◆ Char2DBuilder_resize()

int Char2DBuilder_resize ( char ** array,
int width,
int height )

Resizes a 2D Character Array to a specific width and height.

This method resizes a 2D Character Array to a specific width and height. If the new width or height is smaller than the original width or height, the 2D Character Array will be cropped. If the new width or height is larger than the original width or height, the 2D Character Array will be padded with empty space.

Parameters
arrayThe 2D Character Array.
widthThe new width.
heightThe new height.
Returns
0 if successful, -1 if an error occurred.

◆ Char2DBuilder_resizeAndCenter()

int Char2DBuilder_resizeAndCenter ( char ** array,
int width,
int height )

Resizes and centers a 2D Character Array.

This method resizes and centers a 2D Character Array to a specific width and height. If the new width or height is smaller than the original width or height, the ASCII art character will be cropped. If the new width or height is larger than the original width or height, the 2D Character Array will be padded with the specified character.

Parameters
arrayThe 2D Character Array.
widthThe new width.
heightThe new height.
Returns
0 if successful, -1 if an error occurred.

◆ Char2DBuilder_resizeWithPadding()

int Char2DBuilder_resizeWithPadding ( char ** array,
int width,
int height,
char padding )

Resizes a 2D Character Array to a specific width and height with padding.

This method resizes a 2D Character Array to a specific width and height with padding. If the new width or height is smaller than the original width or height, the ASCII art character will be cropped. If the new width or height is larger than the original width or height, the 2D Character Array will be padded with the specified character.

Parameters
arrayThe 2D Character Array.
widthThe new width.
heightThe new height.
paddingThe padding character.
Returns
0 if successful, -1 if an error occurred.

◆ Char2DBuilder_rotate()

int Char2DBuilder_rotate ( char ** array,
double radians )

Rotates a 2D Character Array.

This method rotates a 2D Character Array by a specific number of radians. The rotation will be done around the center of the 2D Character Array.

Parameters
arrayThe 2D Character Array.
radiansThe number of radians to rotate.
Returns
0 if successful, -1 if an error occurred.

◆ Char2DBuilder_scale()

char ** Char2DBuilder_scale ( char ** array,
double scale )

Scales a 2D Character Array.

This method scales a 2D Character Array by a specific factor. The scaling will be done around the center of the 2D Character Array.

The original 2D Character Array will be freed.

Parameters
arrayThe 2D Character Array.
scaleThe factor to scale the 2D Character Array by.
Returns
0 if successful, -1 if an error occurred.

◆ Char2DBuilder_setChar()

int Char2DBuilder_setChar ( char ** array,
int x,
int y,
char c )

Sets a character in a 2D Character Array.

This method sets a character at the specified x and y coordinates. If the x or y coordinate is out of bounds, the method will return -1.

Parameters
arrayThe 2D Character Array.
xThe x coordinate.
yThe y coordinate
cThe character to set.
Returns
0 if successful, -1 if an error occurred.

◆ Char2DBuilder_text()

int Char2DBuilder_text ( char ** array,
int x,
int y,
char * text )

Writes text in a 2D Character Array.

If the text is too long to fit in the array, it will be wrapped to the next line. If the text is too long to fit in the array at all, the string will be truncated.

Parameters
arrayThe character array.
xThe x coordinate.
yThe y coordinate.
textThe text to draw.
Returns
0 if successful, -1 if an error occurred.

◆ Char2DBuilder_transpose()

char ** Char2DBuilder_transpose ( char ** array)

Transposes a 2D Character Array.

This method transposes a 2D Character Array, then returns the transposed 2D Character Array. The original 2D Character Array will be freed.

Parameters
arrayThe 2D Character Array.
Returns
The transposed 2D Character Array.

◆ Char2DBuilder_vFlip()

int Char2DBuilder_vFlip ( char ** array)

Flips a 2D Character Array vertically.

Parameters
arrayThe 2D Character Array.
Returns
0 if successful, -1 if an error occurred.

◆ Char2DBuilder_vLine()

int Char2DBuilder_vLine ( char ** array,
int x,
int y,
int height,
char c )

Draws a vertical line in a 2D Character Array.

This method draws a vertical line in a 2D Character Array. If the x or y coordinate is out of bounds, the method will return -1. If the line goes out of bounds, the line will be cropped.

Parameters
arrayThe character array.
xThe x coordinate.
yThe y coordinate.
heightThe height of the line.
cThe character to draw the line with.
Returns
0 if successful, -1 if an error occurred.

◆ clearStringArray()

int clearStringArray ( char *** array)

Clears a 2D String Array.

This method clears a 2D String Array. The array will be filled with the space character.

Parameters
arrayThe 2D String Array.
Returns
0 if successful, -1 if an error occurred.

◆ compareCharArrays()

int compareCharArrays ( char ** array1,
char ** array2 )

Compares two 2D Character Arrays.

This method compares two 2D Character Arrays. If the two arrays are equal, the method will return 0. If the two arrays are not equal, the method will return -1.

Parameters
array1The first 2D Character Array.
array2The second 2D Character Array.
Returns
0 if the arrays are equal, -1 if the arrays are not equal.

◆ compareStringArrays()

int compareStringArrays ( char *** array1,
char *** array2 )

Compares two 2D String Arrays.

This method compares two 2D String Arrays. If the two arrays are equal, the method will return 0. If the two arrays are not equal, the method will return -1.

Parameters
array1The first 2D String Array.
array2The second 2D String Array.
Returns
0 if the arrays are equal, -1 if the arrays are not equal.

◆ createCharArrayCopy()

char ** createCharArrayCopy ( char ** array)

Creates a copy of a 2D Character Array.

Parameters
arrayThe 2D Character Array.
Returns
A copy of the array.

◆ createStringArrayCopy()

char *** createStringArrayCopy ( char *** array)

Creates a copy of a 2D String Array.

Parameters
arrayThe 2D String Array.
Returns
A copy of the 2D Array.

◆ getCharArrayHeight()

int getCharArrayHeight ( char ** array)

Gets the height of a 2D Character Array.

Parameters
arrayThe 2D Character Array.
Returns
The height of the array.

◆ getCharArrayWidth()

int getCharArrayWidth ( char ** array)

Gets the width of a 2D Character Array.

Parameters
arrayThe 2D Character Array.
Returns
The width of the array.

◆ getStringArrayHeight()

int getStringArrayHeight ( char *** array)

Gets the height of a 2D String Array.

Parameters
arrayThe 2D String Array.
Returns
The height of the array.

◆ getStringArrayWidth()

int getStringArrayWidth ( char *** array)

Gets the width of a 2D String Array.

Parameters
arrayThe 2D String Array.
Returns
The width of the array.

◆ printCharArray()

int printCharArray ( char ** array)

Prints a 2D Character Array.

This method prints a 2D Character Array to the console.

Parameters
arrayThe 2D Character Array.
Returns
0 if successful, -1 if an error occurred.

◆ printStringArray()

int printStringArray ( char *** array)

Prints a 2D String Array.

This method prints a 2D String Array. The array will be printed to the console.

Parameters
arrayThe 2D String Array.
Returns
0 if successful, -1 if an error occurred.

◆ String2DBuilder_circle()

int String2DBuilder_circle ( char *** array,
int x,
int y,
int radius,
char * c )

Draws a circle in a 2D String Array.

Like all methods in AnsiBuilder, this does not append anything to the string. You will need to input the full ANSI code, like "\033[31m" for red text.

Parameters
arrayThe string array.
xThe x coordinate.
yThe y coordinate.
radiusThe radius of the circle.
cThe ANSI code to draw the circle with.
Returns
0 if successful, -1 if an error occurred.

◆ String2DBuilder_create()

char *** String2DBuilder_create ( int width,
int height )

Creates a 2D String Array with a specific width and height.

Like all methods in AnsiBuilder, this does not append anything to the string. You will need to input the full ANSI code, like "\033[31m" for red text.

This method creates an array with a specific width and height. The array will be initialized with the space character.

Parameters
widthThe width of the array.
heightThe height of the array.
Returns
The 2D String Array.

◆ String2DBuilder_createFilled()

char *** String2DBuilder_createFilled ( int width,
int height,
char * c )

Creates a 2D String Array with a specific width and height, filled with a specific string.

Like all methods in AnsiBuilder, this does not append anything to the string. You will need to input the full ANSI code, like "\033[31m" for red text.

This method creates an array with a specific width and height. The array will be initialized with the specified string.

Parameters
widthThe width of the array.
heightThe height of the array.
cThe string to fill the array with.
Returns
The 2D String Array.

◆ String2DBuilder_ellipse()

int String2DBuilder_ellipse ( char *** array,
int x,
int y,
int xradius,
int yradius,
char * c )

Draws an ellipse in a 2D String Array.

Like all methods in AnsiBuilder, this does not append anything to the string. You will need to input the full ANSI code, like "\033[31m" for red text.

Parameters
arrayThe string array.
xThe x coordinate.
yThe y coordinate.
xradiusThe x radius of the ellipse.
yradiusThe y radius of the ellipse.
cThe ANSI code to draw the ellipse with.
Returns
0 if successful, -1 if an error occurred.

◆ String2DBuilder_fill()

int String2DBuilder_fill ( char *** array,
char * c )

Fills the entire 2D String Array.

Like all methods in AnsiBuilder, this does not append anything to the string. You will need to input the full ANSI code, like "\033[31m" for red text.

Parameters
arrayThe string array.
cThe ANSI code to fill the array with.
Returns
0 if successful, -1 if an error occured.

◆ String2DBuilder_fillCircle()

int String2DBuilder_fillCircle ( char *** array,
int x,
int y,
int radius,
char * c )

Fills a circle in a 2D String Array.

Like all methods in AnsiBuilder, this does not append anything to the string. You will need to input the full ANSI code, like "\033[31m" for red text.

Parameters
arrayThe string array.
xThe x coordinate.
yThe y coordinate.
radiusThe radius of the circle.
cThe ANSI code to fill the circle with.
Returns
0 if successful, -1 if an error occurred.

◆ String2DBuilder_fillEllipse()

int String2DBuilder_fillEllipse ( char *** array,
int x,
int y,
int xradius,
int yradius,
char * c )

Fills an ellipse in a 2D String Array.

Like all methods in AnsiBuilder, this does not append anything to the string. You will need to input the full ANSI code, like "\033[31m" for red text.

Parameters
arrayThe string array.
xThe x coordinate.
yThe y coordinate.
xradiusThe x radius of the ellipse.
yradiusThe y radius of the ellipse.
cThe ANSI code to fill the ellipse with.
Returns
0 if successful, -1 if an error occurred.

◆ String2DBuilder_fillPolygon()

int String2DBuilder_fillPolygon ( char *** array,
int x,
int y,
int sides,
int radius,
char * c )

Fills a polygon in a 2D String Array.

Like all methods in AnsiBuilder, this does not append anything to the string. You will need to input the full ANSI code, like "\033[31m" for red text.

This method fills a polygon in a 2D String Array. If the x or y coordinate is out of bounds, the method will return -1. If the polygon goes out of bounds, the polygon will be cropped.

Parameters
arrayThe string array.
xThe x coordinate.
yThe y coordinate.
sidesThe number of sides of the polygon.
radiusThe radius of the polygon.
cThe ANSI code to fill the polygon with.
Returns
0 if successful, -1 if an error occurred.

◆ String2DBuilder_fillRect()

int String2DBuilder_fillRect ( char *** array,
int x,
int y,
int width,
int height,
char * c )

Fills a rectangle in a 2D String Array.

Like all methods in AnsiBuilder, this does not append anything to the string. You will need to input the full ANSI code, like "\033[31m" for red text.

Parameters
arrayThe string array.
xThe x coordinate.
yThe y coordinate.
widthThe width of the rectangle.
heightThe height of the rectangle.
cThe ANSI code to fill the rectangle with.
Returns
0 if successful, -1 if an error occurred.

◆ String2DBuilder_gradientBackground()

int String2DBuilder_gradientBackground ( char *** array,
int x,
int y,
int width,
int height,
int start,
int end,
enum CmdFX_GradientDirection direction )

Sets a background gradient in a 2D String Array.

This method sets a gradient in a 2D String Array. The gradient will be set from the start RGB code to the end RGB code in the specified bounds. The direction of the gradient can be specified.

This function supports a simple gradient with 2 colors at 50% each.

Parameters
arrayThe 2D String Array.
xThe x coordinate.
yThe y coordinate.
widthThe width of the gradient.
heightThe height of the gradient.
startThe start RGB code.
endThe end RGB code.
direction
Returns
0 if successful, -1 if an error occurred.

◆ String2DBuilder_gradientBackgroundFull()

int String2DBuilder_gradientBackgroundFull ( char *** array,
int start,
int end,
enum CmdFX_GradientDirection direction )

Sets a background gradient in a 2D String Array.

This method sets a gradient in a 2D String Array. The gradient will be set from the start RGB code to the end RGB code in the specified bounds. The direction of the gradient can be specified.

This function supports a full gradient with multiple colors at different intervals.

Parameters
arrayThe 2D String Array.
startThe start RGB code.
endThe end RGB code.
directionThe direction of the gradient.
Returns
0 if successful, -1 if an error occurred.

◆ String2DBuilder_gradientForeground()

int String2DBuilder_gradientForeground ( char *** array,
int x,
int y,
int width,
int height,
int start,
int end,
enum CmdFX_GradientDirection direction )

Sets a foreground gradient in a 2D String Array.

This method sets a gradient in a 2D String Array. The gradient will be set from the start RGB code to the end RGB code in the specified bounds. The direction of the gradient can be specified.

This function supports a simple gradient with 2 colors at 50% each.

Parameters
arrayThe 2D String Array.
xThe x coordinate.
yThe y coordinate.
widthThe width of the gradient.
heightThe height of the gradient.
startThe start RGB code.
endThe end RGB code.
direction
Returns
0 if successful, -1 if an error occurred.

◆ String2DBuilder_gradientForegroundFull()

int String2DBuilder_gradientForegroundFull ( char *** array,
int start,
int end,
enum CmdFX_GradientDirection direction )

Sets a background gradient in a 2D String Array.

This method sets a gradient in a 2D String Array. The gradient will be set from the start RGB code to the end RGB code in the specified bounds. The direction of the gradient can be specified.

This function supports a full gradient with multiple colors at different intervals.

Parameters
arrayThe 2D String Array.
startThe start RGB code.
endThe end RGB code.
directionThe direction of the gradient.
Returns
0 if successful, -1 if an error occurred.

◆ String2DBuilder_hFlip()

int String2DBuilder_hFlip ( char *** array)

Flips a 2D String Array horizontally.

Parameters
arrayThe 2D String Array.
Returns
0 if successful, -1 if an error occurred.

◆ String2DBuilder_hLine()

int String2DBuilder_hLine ( char *** array,
int x,
int y,
int width,
char * c )

Draws a horizontal line in a 2D String Array.

Like all methods in AnsiBuilder, this does not append anything to the string. You will need to input the full ANSI code, like "\033[31m" for red text.

Parameters
arrayThe string array.
xThe x coordinate.
yThe y coordinate.
widthThe width of the line.
cThe ANSI code to draw the line with.
Returns
0 if successful, -1 if an error occurred.

◆ String2DBuilder_line()

int String2DBuilder_line ( char *** array,
int x1,
int y1,
int x2,
int y2,
char * c )

Draws a line in a 2D String Array.

Like all methods in AnsiBuilder, this does not append anything to the string. You will need to input the full ANSI code, like "\033[31m" for red text.

Parameters
arrayThe string array.
x1The x coordinate of the first point.
y1The y coordinate of the first point.
x2The x coordinate of the second point.
y2The y coordinate of the second point.
cThe ANSI code to draw the line with.
Returns
0 if successful, -1 if an error occurred.

◆ String2DBuilder_multiGradientBackground()

int String2DBuilder_multiGradientBackground ( char *** array,
int x,
int y,
int width,
int height,
int numColors,
int * colors,
enum CmdFX_GradientDirection direction )

Sets a background gradient in a 2D String Array.

This method sets a gradient in a 2D String Array. The gradient will be set from the start RGB code to the end RGB code in the specified bounds. The direction of the gradient can be specified.

This function supports a multi-gradient with multiple colors at equal intervals.

Parameters
arrayThe 2D String Array.
xThe x coordinate.
yThe y coordinate.
widthThe width of the gradient.
heightThe height of the gradient.
numColorsThe number of colors in the gradient
colorsThe RGB colors in the gradient.
directionThe direction of the gradient.
Returns
0 if successful, -1 if an error occurred.

◆ String2DBuilder_multiGradientBackgroundFull()

int String2DBuilder_multiGradientBackgroundFull ( char *** array,
int numColors,
int * colors,
enum CmdFX_GradientDirection direction )

Sets a background gradient in a 2D String Array.

This method sets a gradient in a 2D String Array. The gradient will be set from the start RGB code to the end RGB code in the specified bounds. The direction of the gradient can be specified.

This function supports a multi-gradient with multiple colors at equal intervals.

Parameters
arrayThe 2D String Array.
numColorsThe number of colors in the gradient
colorsThe RGB colors in the gradient.
directionThe direction of the gradient.
Returns
0 if successful, -1 if an error occurred.

◆ String2DBuilder_multiGradientForeground()

int String2DBuilder_multiGradientForeground ( char *** array,
int x,
int y,
int width,
int height,
int numColors,
int * colors,
enum CmdFX_GradientDirection direction )

Sets a foreground gradient in a 2D String Array.

This method sets a gradient in a 2D String Array. The gradient will be set from the start RGB code to the end RGB code in the specified bounds. The direction of the gradient can be specified.

This function supports a multi-gradient with multiple colors at equal intervals.

Parameters
arrayThe 2D String Array.
xThe x coordinate.
yThe y coordinate.
widthThe width of the gradient.
heightThe height of the gradient.
numColorsThe number of colors in the gradient
colorsThe RGB colors in the gradient.
directionThe direction of the gradient.
Returns
0 if successful, -1 if an error occurred.

◆ String2DBuilder_multiGradientForegroundFull()

int String2DBuilder_multiGradientForegroundFull ( char *** array,
int numColors,
int * colors,
enum CmdFX_GradientDirection direction )

Sets a foreground gradient in a 2D String Array.

This method sets a gradient in a 2D String Array. The gradient will be set from the start RGB code to the end RGB code in the specified bounds. The direction of the gradient can be specified.

This function supports a multi-gradient with multiple colors at equal intervals.

Parameters
arrayThe 2D String Array.
numColorsThe number of colors in the gradient
colorsThe RGB colors in the gradient.
directionThe direction of the gradient.
Returns
0 if successful, -1 if an error occurred.

◆ String2DBuilder_multiGradientsBackground()

int String2DBuilder_multiGradientsBackground ( char *** array,
int x,
int y,
int width,
int height,
int numColors,
int * colors,
double * percentages,
enum CmdFX_GradientDirection direction )

Sets a background gradient in a 2D String Array.

This method sets a gradient in a 2D String Array. The gradient will be set from the start RGB code to the end RGB code in the specified bounds. The direction of the gradient can be specified.

This function supports a multi-gradient with multiple colors at different intervals.

Parameters
arrayThe 2D String Array.
xThe x coordinate.
yThe y coordinate.
widthThe width of the gradient.
heightThe height of the gradient.
numColorsThe number of colors in the gradient
colorsThe RGB colors in the gradient.
percentagesThe percentages of each color in the gradient.
directionThe direction of the gradient.
Returns
0 if successful, -1 if an error occurred.

◆ String2DBuilder_multiGradientsBackgroundFull()

int String2DBuilder_multiGradientsBackgroundFull ( char *** array,
int numColors,
int * colors,
double * percentages,
enum CmdFX_GradientDirection direction )

Sets a background gradient in a 2D String Array.

This method sets a gradient in a 2D String Array. The gradient will be set from the start RGB code to the end RGB code in the specified bounds. The direction of the gradient can be specified.

This function supports a multi-gradient with multiple colors at different intervals.

Parameters
arrayThe 2D String Array.
numColorsThe number of colors in the gradient
colorsThe RGB colors in the gradient.
percentagesThe percentages of each color in the gradient.
directionThe direction of the gradient.
Returns
0 if successful, -1 if an error occurred.

◆ String2DBuilder_multiGradientsForeground()

int String2DBuilder_multiGradientsForeground ( char *** array,
int x,
int y,
int width,
int height,
int numColors,
int * colors,
double * percentages,
enum CmdFX_GradientDirection direction )

Sets a foreground gradient in a 2D String Array.

This method sets a gradient in a 2D String Array. The gradient will be set from the start RGB code to the end RGB code in the specified bounds. The direction of the gradient can be specified.

This function supports a multi-gradient with multiple colors at different intervals.

Parameters
arrayThe 2D String Array.
xThe x coordinate.
yThe y coordinate.
widthThe width of the gradient.
heightThe height of the gradient.
numColorsThe number of colors in the gradient
colorsThe RGB colors in the gradient.
percentagesThe percentages of each color in the gradient.
directionThe direction of the gradient.
Returns
0 if successful, -1 if an error occurred.

◆ String2DBuilder_multiGradientsForegroundFull()

int String2DBuilder_multiGradientsForegroundFull ( char *** array,
int numColors,
int * colors,
double * percentages,
enum CmdFX_GradientDirection direction )

Sets a foreground gradient in a 2D String Array.

This method sets a gradient in a 2D String Array. The gradient will be set from the start RGB code to the end RGB code in the specified bounds. The direction of the gradient can be specified.

This function supports a multi-gradient with multiple colors at different intervals.

Parameters
arrayThe 2D String Array.
numColorsThe number of colors in the gradient
colorsThe RGB colors in the gradient.
percentagesThe percentages of each color in the gradient.
directionThe direction of the gradient.
Returns
0 if successful, -1 if an error occurred.

◆ String2DBuilder_polygon()

int String2DBuilder_polygon ( char *** array,
int x,
int y,
int sides,
int radius,
char * c )

Draws a polygon in a 2D String Array.

Like all methods in AnsiBuilder, this does not append anything to the string. You will need to input the full ANSI code, like "\033[31m" for red text.

This method draws a polygon in a 2D String Array. If the x or y coordinate is out of bounds, the method will return -1. If the polygon goes out of bounds, the polygon will be cropped.

Parameters
arrayThe string array.
xThe x coordinate.
yThe y coordinate.
sidesThe number of sides of the polygon.
radiusThe radius of the polygon.
cThe ANSI code to draw the polygon with.
Returns
0 if successful, -1 if an error occurred.

◆ String2DBuilder_rect()

int String2DBuilder_rect ( char *** array,
int x,
int y,
int width,
int height,
char * c )

Draws a rectangle in a 2D String Array.

Like all methods in AnsiBuilder, this does not append anything to the string. You will need to input the full ANSI code, like "\033[31m" for red text.

Parameters
arrayThe string array.
xThe x coordinate.
yThe y coordinate.
widthThe width of the rectangle.
heightThe height of the rectangle.
cThe ANSI code to draw the rectangle with.
Returns
0 if successful, -1 if an error occurred.

◆ String2DBuilder_replaceAll()

int String2DBuilder_replaceAll ( char *** array,
char * find,
char * replace )

Replaces all instances of an ANSI code in a 2D String Array.

Parameters
arrayThe 2D String Array.
findThe ANSI code to find.
replaceThe ANSI code to replace the found ANSI code with.
Returns
The number of ANSI codes replaced, 0 if none, or -1 if an error occurred.

◆ String2DBuilder_rotate()

int String2DBuilder_rotate ( char *** array,
double radians )

Rotates a 2D String Array.

This method rotates a 2D String Array by a specific number of radians. The rotation will be done around the center of the 2D String Array.

Parameters
arrayThe 2D String Array.
radiansThe number of radians to rotate.
Returns
0 if successful, -1 if an error occurred.

◆ String2DBuilder_scale()

char *** String2DBuilder_scale ( char *** array,
double scale )

Scales a 2D String Array.

This method scales a 2D String Array by a specific factor. The scaling will be done around the center of the 2D String Array.

The original 2D String Array will be freed.

Parameters
arrayThe 2D String Array.
scaleThe factor to scale the 2D String Array by.
Returns
0 if successful, -1 if an error occurred.

◆ String2DBuilder_setAnsi()

int String2DBuilder_setAnsi ( char *** array,
int x,
int y,
char * c )

Sets an ANSI code in a 2D String Array.

Like all methods in AnsiBuilder, this does not append anything to the string. You will need to input the full ANSI code, like "\033[31m" for red text.

This method sets an ANSI code at the specified x and y coordinates. If the x or y coordinate is out of bounds, the method will return -1.

The values at array[height] will be set to 0 for null termination. It is advised that you create a char*** with this method and pass it to other functions presented in this header file, rather than create a char*** and pass it to other functions, in order to avoid undefined behavior.

Parameters
arrayThe 2D String Array.
xThe x coordinate.
yThe y coordinate
cThe ANSI code to set.
Returns
0 if successful, -1 if an error occurred.

◆ String2DBuilder_transpose()

char *** String2DBuilder_transpose ( char *** array)

Transposes a 2D String Array.

This method transposes a 2D String Array, then returns the transposed 2D String Array. The original 2D String Array will be freed.

Parameters
arrayThe 2D String Array.
Returns
The transposed 2D String Array.

◆ String2DBuilder_vFlip()

int String2DBuilder_vFlip ( char *** array)

Flips a 2D String Array vertically.

Parameters
arrayThe 2D String Array.
Returns
0 if successful, -1 if an error occurred.

◆ String2DBuilder_vLine()

int String2DBuilder_vLine ( char *** array,
int x,
int y,
int height,
char * c )

Draws a vertical line in a 2D String Array.

Like all methods in AnsiBuilder, this does not append anything to the string. You will need to input the full ANSI code, like "\033[31m" for red text.

Parameters
arrayThe string array.
xThe x coordinate.
yThe y coordinate.
heightThe height of the line.
cThe ANSI to draw the line with.
Returns
0 if successful, -1 if an error occurred.