VEXcode IQ C++ Unofficial documentation for version 3.0.4.1
Loading...
Searching...
No Matches
vex::brain::lcd Class Reference

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.
 

Detailed Description

Use this class to write or draw to the brain's LCD screen.

Definition at line 94 of file vex_brain.h.

Constructor & Destructor Documentation

◆ ~lcd()

vex::brain::lcd::~lcd ( )
inline

Definition at line 121 of file vex_brain.h.

Member Function Documentation

◆ clearLine()

void vex::brain::lcd::clearLine ( int number)

Clears the specified line.

Parameters
numberThe integer sets the line that is to be cleared.

◆ column()

int32_t vex::brain::lcd::column ( )

An integer that tracks the current cursor position's column, starting at 1.

Returns
Returns an integer that tracks the current cursor position's column, starting at 1.

◆ drawCircle() [1/2]

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.

Parameters
xThe central x location of the circle.
yThe central y location of the circle.
radiusSets the radius of the circle to be drawn on the Screen.

◆ drawCircle() [2/2]

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.

Parameters
xThe central x location of the circle.
yThe central y location of the circle.
radiusSets the radius of the circle to be drawn on the Screen.
colorA color unit where colors can be defined as names.

◆ drawLine()

void vex::brain::lcd::drawLine ( int x1,
int y1,
int x2,
int y2 )

Draws a line connecting the two specified points in the parameters.

Parameters
x1The x location of the first point.
y1The y location of the first point.
x2The x location of the second point.
y2The y location of the second point.

◆ drawPixel()

void vex::brain::lcd::drawPixel ( int x,
int y )

Draws a single pixel to the screen in the specified x and y location.

Parameters
xThe x location of where to draw the pixel.
yThe y location of where to draw the pixel.

◆ drawRectangle() [1/2]

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.

Parameters
xThe x-coordinate at which the left edge of the rectangle will be drawn on the screen.
yThe y-coordinate at which the top edge of the rectangle will be drawn on the screen.
widthThe width of the rectangle.
heightThe height of the rectangle.

◆ drawRectangle() [2/2]

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.

Parameters
xThe x-coordinate at which the left edge of the rectangle will be drawn on the screen.
yThe y-coordinate at which the top edge of the rectangle will be drawn on the screen.
widthThe width of the rectangle.
heightThe height of the rectangle.
colorA color unit where colors can be defined as names.

◆ invertCircle()

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.

Parameters
xThe central x location of the circle.
yThe central y location of the circle.
radiusSets the radius of the circle to be drawn on the Screen.

◆ invertRectangle()

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.

Parameters
xThe x-coordinate at which the left edge of the rectangle will be drawn on the screen.
yThe y-coordinate at which the top edge of the rectangle will be drawn on the screen.
widthThe width of the rectangle.
heightThe height of the rectangle.

◆ print()

void vex::brain::lcd::print ( const char * format,
... )

Prints a number, string, or Boolean.

Parameters
formatThis is a reference to a char format that prints the value of variables.
...A variable list of parameters to insert into format string.

◆ printAt()

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.

Parameters
xThe x-coordinate at which to print a message on the screen.
yThe y-coordinate at which to print a message on the screen.
formatA 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.

◆ row()

int32_t vex::brain::lcd::row ( )

An integer that tracks the current cursor position's row, starting at 1.

Returns
Returns an integer that tracks the current cursor position's row, starting at 1.

◆ setAspectCompensation()

void vex::brain::lcd::setAspectCompensation ( bool value)

compensate for non square pixels when drawing

Parameters
valuetrue or false

◆ setCursor()

void vex::brain::lcd::setCursor ( int32_t row,
int32_t col )

Sets the cursor to the row and column number set in the parameters.

Parameters
rowSets the row number for where the cursor is placed.
colSets the column number for where the cursor is placed.

◆ setFillColor()

void vex::brain::lcd::setFillColor ( colorType color)

Sets the default fill color for any subsequent draw command.

@cpp_sig{setFillColor(vex::color::red);}

Parameters
colorIn a color unit, colors can be defined as names.

◆ setOrigin()

void vex::brain::lcd::setOrigin ( int32_t x,
int32_t y )

Sets the origin of the screen to the parameters defined in the function.

Parameters
xThe x location of the origin.
yThe y location of the origin.

◆ setPenColor()

void vex::brain::lcd::setPenColor ( colorType color)

Sets the color of the pen to a specified color.

@cpp_sig{setPenColor(vex::color::red);}

Parameters
colorA color unit where colors can be defined as names.

◆ setPenWidth()

void vex::brain::lcd::setPenWidth ( uint32_t width)

Sets the pen's width.

Parameters
widthThis represents the width of the pen when drawing. A larger width equals a wider pen stroke.

The documentation for this class was generated from the following file: