cmdfx 0.1.0
Lightweight game engine for your terminal
|
Represents a sprite that can be drawn to the terminal. More...
#include <sprites.h>
Public Attributes | |
int | x |
The X position of the sprite. | |
int | y |
The Y position of the sprite. | |
int | width |
The width of the sprite. | |
int | height |
The height of the sprite. | |
char ** | data |
The text data for the sprite. | |
char *** | ansi |
The ANSI data for the sprite. | |
int | z |
The Z-index of the sprite. | |
int | id |
The unique ID of the sprite. | |
Represents a sprite that can be drawn to the terminal.
A sprite is a 2D image that can be drawn to the terminal. It consists of a 2D array of characters that represent the sprite, as well as a Z-index that determines the order in which sprites are drawn. Sprites are useful for keeping track of complex images or animations that need to be drawn to the terminal.
char*** CmdFX_Sprite::ansi |
The ANSI data for the sprite.
This is a 2D array of strings that represent the ANSI codes for the sprite. Each row should be the same length, and the number of rows should be equal to the height of the sprite. The sprite will be drawn starting at the X and Y position, with the top-left corner of the sprite at the X and Y position. The number of columns should be equal to the width of the sprite.
char** CmdFX_Sprite::data |
The text data for the sprite.
This is a 2D array of characters that represent the sprite. Each row should be the same length, and the number of rows should be equal to the height of the sprite. The sprite will be drawn starting at the X and Y position, with the top-left corner of the sprite at the X and Y position. The number of columns should be equal to the width of the sprite.
int CmdFX_Sprite::id |
The unique ID of the sprite.
This is assigned once the sprite is drawn on the screen. It is used to identify the sprite when editing or removing it. If the sprite is not drawn, this value will be 0.
int CmdFX_Sprite::z |
The Z-index of the sprite.
This value determines the order in which sprites are drawn. Sprites with a higher Z-index will be drawn on top of sprites with a lower Z-index. If two sprites have the same Z-index, the order in which they are drawn is undefined.