cmdfx 0.1.0
Lightweight game engine for your terminal
|
Animation Extensions for canvas.h. More...
#include "cmdfx/canvas.h"
Go to the source code of this file.
Functions | |
void | Canvas_hLine_anim (int x, int y, int width, char c, double time) |
Draws a horizontal line at the specified position over time. | |
void | Canvas_hLine_anim_reverse (int x, int y, int width, char c, double time) |
Draws a horizontal line at the specified position over time, then reverses the animation. | |
void | Canvas_vLine_anim (int x, int y, int height, char c, double time) |
Draws a vertical line at the specified position over time. | |
void | Canvas_vLine_anim_reverse (int x, int y, int height, char c, double time) |
Draws a vertical line at the specified position over time, then reverses the animation. | |
void | Canvas_rect_anim (int x, int y, int width, int height, char c, double time) |
Draws a hollow rectangle at the specified position over time. | |
void | Canvas_fillRect_anim (int x, int y, int width, int height, char c, double time) |
Fills a rectangle at the specified position over time. | |
void | Canvas_line_anim (int x0, int y0, int x1, int y1, char c, double time) |
Draws a line at the specified position over time. | |
void | Canvas_line_anim_reverse (int x0, int y0, int x1, int y1, char c, double time) |
Draws a line at the specified position over time, then reverses the animation. | |
void | Canvas_drawText_anim (int x, int y, const char *text, double time) |
Draws text at the specified position over time. | |
void | Canvas_drawText_anim_reverse (int x, int y, const char *text, double time) |
Draws text at the specified position over time, then reverses the animation. | |
void | Canvas_drawAsciiText_anim (int x, int y, char character, const char *text, double time) |
Draws an ASCII character at the specified position over time. | |
Animation Extensions for canvas.h.
void Canvas_drawAsciiText_anim | ( | int | x, |
int | y, | ||
char | character, | ||
const char * | text, | ||
double | time ) |
Draws an ASCII character at the specified position over time.
This method draws an ASCII character at the specified position over time. The character is linearly interpolated from the starting position to the ending position over the specified amount of time.
x | The X position of the character. |
y | The Y position of the character. |
character | The character to use when drawing the text. |
text | The text to draw. |
time | The amount of time, in seconds, to draw the character. |
void Canvas_drawText_anim | ( | int | x, |
int | y, | ||
const char * | text, | ||
double | time ) |
Draws text at the specified position over time.
This method draws text at the specified position over time. The text is linearly interpolated from the starting position to the ending position over the specified amount of time.
x | The X position of the text. |
y | The Y position of the text. |
text | The text to draw. |
time | The amount of time, in seconds, to draw the text. |
void Canvas_drawText_anim_reverse | ( | int | x, |
int | y, | ||
const char * | text, | ||
double | time ) |
Draws text at the specified position over time, then reverses the animation.
This method draws text at the specified position over time. The text is linearly interpolated from the starting position to the ending position over the specified amount of time. After the animation is complete, the text is then reversed back to the starting position.
This method will draw the text in reverse, starting from the last character and moving to the first character.
x | The X position of the text. |
y | The Y position of the text. |
text | The text to draw. |
time | The amount of time, in seconds, to draw the text. |
void Canvas_fillRect_anim | ( | int | x, |
int | y, | ||
int | width, | ||
int | height, | ||
char | c, | ||
double | time ) |
Fills a rectangle at the specified position over time.
This method fills a rectangle at the specified position over time. The rectangle is linearly interpolated from the starting position to the ending position over the specified amount of time, using the specified character.
The animation begins by filling the top row of the rectangle, then the second row, and so on until the entire rectangle is filled.
x | The X position of the rectangle. |
y | The Y position of the rectangle. |
width | The width of the rectangle. |
height | The height of the rectangle. |
c | The character to use when filling the rectangle. |
time | The amount of time, in seconds, to fill the rectangle. |
void Canvas_hLine_anim | ( | int | x, |
int | y, | ||
int | width, | ||
char | c, | ||
double | time ) |
Draws a horizontal line at the specified position over time.
This method draws a horizontal line at the specified position over time. The line is linearly interpolated from the starting position to the ending position over the specified amount of time, using the specified character.
x | The X position of the line. |
y | The Y position of the line. |
width | The width of the line. |
c | The character to use when drawing the line. |
time | The amount of time, in seconds, to draw the line. |
void Canvas_hLine_anim_reverse | ( | int | x, |
int | y, | ||
int | width, | ||
char | c, | ||
double | time ) |
Draws a horizontal line at the specified position over time, then reverses the animation.
This method draws a horizontal line at the specified position over time. The line is linearly interpolated from the starting position to the ending position over the specified amount of time, using the specified character. After the animation is complete, the line is then reversed back to the starting position.
This method will draw the line in reverse, starting from the right side of the line and moving to the left side.
x | The X position of the line. |
y | The Y position of the line. |
width | The width of the line. |
c | The character to use when drawing the line. |
time | The amount of time, in seconds, to draw the line. |
void Canvas_line_anim | ( | int | x0, |
int | y0, | ||
int | x1, | ||
int | y1, | ||
char | c, | ||
double | time ) |
Draws a line at the specified position over time.
This method draws a line at the specified position over time. The line is linearly interpolated from the starting position to the ending position over the specified amount of time, using the specified character.
x0 | The X position of the starting point. |
y0 | The Y position of the starting point. |
x1 | The X position of the ending point. |
y1 | The Y position of the ending point. |
c | The character to use when drawing the line. |
time | The amount of time, in seconds, to draw the line. |
void Canvas_line_anim_reverse | ( | int | x0, |
int | y0, | ||
int | x1, | ||
int | y1, | ||
char | c, | ||
double | time ) |
Draws a line at the specified position over time, then reverses the animation.
This method draws a line at the specified position over time. The line is linearly interpolated from the starting position to the ending position over the specified amount of time, using the specified character. After the animation is complete, the line is then reversed back to the starting position.
This method will draw the line in reverse, starting from the ending point and moving to the starting point.
x0 | The X position of the starting point. |
y0 | The Y position of the starting point. |
x1 | The X position of the ending point. |
y1 | The Y position of the ending point. |
c | The character to use when drawing the line. |
time | The amount of time, in seconds, to draw the line. |
void Canvas_rect_anim | ( | int | x, |
int | y, | ||
int | width, | ||
int | height, | ||
char | c, | ||
double | time ) |
Draws a hollow rectangle at the specified position over time.
This method draws a hollow rectangle at the specified position over time. The rectangle is linearly interpolated from the starting position to the ending position over the specified amount of time, using the specified character.
The animation will start on the left, then draw the top, right, and bottom sides of the rectangle.
x | The X position of the rectangle. |
y | The Y position of the rectangle. |
width | The width of the rectangle. |
height | The height of the rectangle. |
c | The character to use when drawing the rectangle. |
time | The amount of time, in seconds, to draw the rectangle. |
void Canvas_vLine_anim | ( | int | x, |
int | y, | ||
int | height, | ||
char | c, | ||
double | time ) |
Draws a vertical line at the specified position over time.
This method draws a vertical line at the specified position over time. The line is linearly interpolated from the starting position to the ending position over the specified amount of time, using the specified character.
x | The X position of the line. |
y | The Y position of the line. |
height | The height of the line. |
c | The character to use when drawing the line. |
time | The amount of time, in seconds, to draw the line. |
void Canvas_vLine_anim_reverse | ( | int | x, |
int | y, | ||
int | height, | ||
char | c, | ||
double | time ) |
Draws a vertical line at the specified position over time, then reverses the animation.
This method draws a vertical line at the specified position over time. The line is linearly interpolated from the starting position to the ending position over the specified amount of time, using the specified character. After the animation is complete, the line is then reversed back to the starting position.
This method will draw the line in reverse, starting from the bottom side of the line and moving to the top side.
x | The X position of the line. |
y | The Y position of the line. |
height | The height of the line. |
c | The character to use when drawing the line. |
time | The amount of time, in seconds, to draw the line. |