![]() |
VEXcode IQ C++ Unofficial documentation for version 3.0.4.1
|
Use this class to write or draw to the brain's LCD screen. More...
#include <vex_brain.h>
Public Member Functions | |
void | setCursor (int32_t row, int32_t col) |
Sets the cursor to the row and column number set in the parameters. | |
void | setPenWidth (uint32_t width) |
Sets the pen's width. | |
void | setOrigin (int32_t x, int32_t y) |
Sets the origin of the screen to the parameters defined in the function. | |
void | setAspectCompensation (bool value) |
compensate for non square pixels when drawing | |
int32_t | column () |
An integer that tracks the current cursor position's column, starting at 1. | |
int32_t | row () |
An integer that tracks the current cursor position's row, starting at 1. | |
void | setPenColor (colorType color) |
Sets the color of the pen to a specified color. | |
void | setFillColor (colorType color) |
Sets the default fill color for any subsequent draw command. | |
void | print (const char *format,...) |
Prints a number, string, or Boolean. | |
void | print (char *format,...) |
void | printAt (int32_t x, int32_t y, const char *format,...) |
Prints a number, string, or Boolean at an x, y cursor location. | |
void | clearScreen (void) |
Clears the whole Screen to white. | |
void | clearLine (int number) |
Clears the specified line. | |
void | clearLine (void) |
Clears the rest of the line from where the cursor is located. | |
void | newLine (void) |
Clears the rest of the line from where the cursor is located and then moves the cursor to the beginning of the next line. (actually not, just moves cursor at the moment as that was what the V5 does, we will address later) | |
void | drawPixel (int x, int y) |
Draws a single pixel to the screen in the specified x and y location. | |
void | drawLine (int x1, int y1, int x2, int y2) |
Draws a line connecting the two specified points in the parameters. | |
void | drawRectangle (int x, int y, int width, int height) |
Draws a rectangle using the specified points and attributes set in the parameters. Fills the rectangle with the current fill color. | |
void | drawRectangle (int x, int y, int width, int height, colorType color) |
Draws a rectangle using the specified points and attributes set in the parameters. Fills the rectangle with the color specified. | |
void | invertRectangle (int x, int y, int width, int height) |
Inverts a rectangular area of the screen using the specified points and attributes set in the parameters. | |
void | drawCircle (int x, int y, int radius) |
Draws a circle using the specified points and attributes set in the parameters. Fills the circle with the current pen and fill color. | |
void | drawCircle (int x, int y, int radius, colorType color) |
Draws a circle using the specified points and attributes set in the parameters. Fills the circle with the color specified. | |
void | invertCircle (int x, int y, int radius) |
Inverts a circular area of the screen using the specified points and attributes set in the parameters. | |
Use this class to write or draw to the brain's LCD screen.
Definition at line 94 of file vex_brain.h.
|
inline |
Definition at line 121 of file vex_brain.h.
void vex::brain::lcd::clearLine | ( | int | number | ) |
Clears the specified line.
number | The integer sets the line that is to be cleared. |
int32_t vex::brain::lcd::column | ( | ) |
An integer that tracks the current cursor position's column, starting at 1.
void vex::brain::lcd::drawCircle | ( | int | x, |
int | y, | ||
int | radius ) |
Draws a circle using the specified points and attributes set in the parameters. Fills the circle with the current pen and fill color.
x | The central x location of the circle. |
y | The central y location of the circle. |
radius | Sets the radius of the circle to be drawn on the Screen. |
void vex::brain::lcd::drawCircle | ( | int | x, |
int | y, | ||
int | radius, | ||
colorType | color ) |
Draws a circle using the specified points and attributes set in the parameters. Fills the circle with the color specified.
x | The central x location of the circle. |
y | The central y location of the circle. |
radius | Sets the radius of the circle to be drawn on the Screen. |
color | A color unit where colors can be defined as names. |
void vex::brain::lcd::drawLine | ( | int | x1, |
int | y1, | ||
int | x2, | ||
int | y2 ) |
Draws a line connecting the two specified points in the parameters.
x1 | The x location of the first point. |
y1 | The y location of the first point. |
x2 | The x location of the second point. |
y2 | The y location of the second point. |
void vex::brain::lcd::drawPixel | ( | int | x, |
int | y ) |
Draws a single pixel to the screen in the specified x and y location.
x | The x location of where to draw the pixel. |
y | The y location of where to draw the pixel. |
void vex::brain::lcd::drawRectangle | ( | int | x, |
int | y, | ||
int | width, | ||
int | height ) |
Draws a rectangle using the specified points and attributes set in the parameters. Fills the rectangle with the current fill color.
x | The x-coordinate at which the left edge of the rectangle will be drawn on the screen. |
y | The y-coordinate at which the top edge of the rectangle will be drawn on the screen. |
width | The width of the rectangle. |
height | The height of the rectangle. |
void vex::brain::lcd::drawRectangle | ( | int | x, |
int | y, | ||
int | width, | ||
int | height, | ||
colorType | color ) |
Draws a rectangle using the specified points and attributes set in the parameters. Fills the rectangle with the color specified.
x | The x-coordinate at which the left edge of the rectangle will be drawn on the screen. |
y | The y-coordinate at which the top edge of the rectangle will be drawn on the screen. |
width | The width of the rectangle. |
height | The height of the rectangle. |
color | A color unit where colors can be defined as names. |
void vex::brain::lcd::invertCircle | ( | int | x, |
int | y, | ||
int | radius ) |
Inverts a circular area of the screen using the specified points and attributes set in the parameters.
x | The central x location of the circle. |
y | The central y location of the circle. |
radius | Sets the radius of the circle to be drawn on the Screen. |
void vex::brain::lcd::invertRectangle | ( | int | x, |
int | y, | ||
int | width, | ||
int | height ) |
Inverts a rectangular area of the screen using the specified points and attributes set in the parameters.
x | The x-coordinate at which the left edge of the rectangle will be drawn on the screen. |
y | The y-coordinate at which the top edge of the rectangle will be drawn on the screen. |
width | The width of the rectangle. |
height | The height of the rectangle. |
void vex::brain::lcd::print | ( | const char * | format, |
... ) |
Prints a number, string, or Boolean.
format | This is a reference to a char format that prints the value of variables. |
... | A variable list of parameters to insert into format string. |
void vex::brain::lcd::printAt | ( | int32_t | x, |
int32_t | y, | ||
const char * | format, | ||
... ) |
Prints a number, string, or Boolean at an x, y cursor location.
x | The x-coordinate at which to print a message on the screen. |
y | The y-coordinate at which to print a message on the screen. |
format | A reference to a char format to print the value of variables. |
... | A variable list of parameters to insert into format string. @notes this uses cursor location rather than pixel location as on the V5 it's shouthand for using setCursor followed by print. |
int32_t vex::brain::lcd::row | ( | ) |
An integer that tracks the current cursor position's row, starting at 1.
void vex::brain::lcd::setAspectCompensation | ( | bool | value | ) |
compensate for non square pixels when drawing
value | true or false |
void vex::brain::lcd::setCursor | ( | int32_t | row, |
int32_t | col ) |
Sets the cursor to the row and column number set in the parameters.
row | Sets the row number for where the cursor is placed. |
col | Sets the column number for where the cursor is placed. |
void vex::brain::lcd::setFillColor | ( | colorType | color | ) |
Sets the default fill color for any subsequent draw command.
@cpp_sig{setFillColor(vex::color::red);}
color | In a color unit, colors can be defined as names. |
void vex::brain::lcd::setOrigin | ( | int32_t | x, |
int32_t | y ) |
Sets the origin of the screen to the parameters defined in the function.
x | The x location of the origin. |
y | The y location of the origin. |
void vex::brain::lcd::setPenColor | ( | colorType | color | ) |
Sets the color of the pen to a specified color.
@cpp_sig{setPenColor(vex::color::red);}
color | A color unit where colors can be defined as names. |
void vex::brain::lcd::setPenWidth | ( | uint32_t | width | ) |
Sets the pen's width.
width | This represents the width of the pen when drawing. A larger width equals a wider pen stroke. |