VEX2 Functions Display
|
Main >> CORTEX >> Functions and Variables >> Display |
| For information about ROBOTC string, please see the article: Strings. |
Information
ROBOTC has a rich set of functionality for drawing text and shapes on the LCD screen. The NXT is equipped with a 100 wide by 64 pixels high display.
The number before the decimal is how many digits before the decimal you wish to display, while the number after the decimal is how many digits after the decimal you wish to display. So "%1.2f" tells us to display one digit before the decimal and two digits after the decimal, with "3.14" as the final result.
Note: Underscore ( _ ) character denotes a space. |
bNxtLCDStatusDisplay
| bool bNxtLCDStatusDisplay | |
| (bool) Boolean variable that indicates whether the top status line display on the LCD should be present on user-drawn LCD screens. | |
|
eraseDisplay
| void eraseDisplay() | |
| (void) Erases the complete NXT LCD display. | |
|
nxtClearPixel
| void nxtClearPixel(const int xPos, const int yPos) | |||||||||
| (void) Clears a single pixel on the NXT LCD screen. | |||||||||
| |||||||||
|
nxtDisplayBigStringAt
| void nxtDisplayBigStringAt(const int xPos, const int yPos, string sFormatString, ...) | ||||||||||||
| (void) Formats a text string and displays it at any (X,Y) coordinate on the LCD display. Drawing uses a large font that is 16-pixels high. | ||||||||||||
| ||||||||||||
|
nxtDisplayBigTextLine
| void nxtDisplayBigTextLine(const int nLineNumber, string sFormatString, ...) | |||||||||
| (void) Displays a text string on one of the 8 possible text lines. Drawing uses a large font that is 16-pixels high. | |||||||||
| |||||||||
|
nxtDisplayCenteredBigTextLine
| void nxtDisplayCenteredBigTextLine(const int nLineNumber, string sFormatString, ...) | |||||||||
| (void) Displays a text string on one of the 8 possible text lines. The text is horiztonally centered on the LCD display. Drawing uses a large font that is 16-pixels high. | |||||||||
| |||||||||
|
nxtDisplayCenteredTextLine
| void nxtDisplayCenteredTextLine(const int nLineNumber, string sFormatString, ...) | |||||||||
| (void) Displays a text string on one of the 8 possible text lines. The text is horiztonally centered on the LCD display. | |||||||||
| |||||||||
|
nxtDisplayClearTextLine
| void nxtDisplayClearTextLine(const int nLineNumber) | ||||||
| (void) Erases a line of text. nLineNumber specifies one of the 8 possible text lines. | ||||||
| ||||||
|
nxtDisplayRICFile
| void nxtDisplayRICFile(const int nleft, const int nBottom, const string sFileName) | ||||||||||||
| (void) Display a RIC (i.e. "ICON" or "Picture") file on the NXT display at the specified coordinates. | ||||||||||||
| ||||||||||||
|
nxtDisplayString
| void nxtDisplayString(const int nLineNumber, string sFormatString, ...) | |||||||||
| (void) Formats a character string according the the format specified in sFormatString using parameters parm1, parm2, and parm3. Display the result on text line nLineNumber. The remainder of the line is not altered; so that if the result string is 8 characters only the first eight characters of the text line are updated. The contents of the remaining characters on the line are not changed. | |||||||||
| |||||||||
|
nxtDisplayStringAt
| void nxtDisplayStringAt(const int xPos, const int yPos, string sFormatString, ...) | ||||||||||||
| (void) Displays a text string at (X,Y) coordinate on the LCD display. | ||||||||||||
| ||||||||||||
|
nxtDisplayTextLine
| void nxtDisplayTextLine(const int nLineNumber, string sFormatString, ...) | |||||||||
| (void) Formats a text string and displays it on one of the 8 possible text lines. The remainder of the line is padded with blanks. | |||||||||
| |||||||||
|
nxtDrawCircle
| void nxtDrawCircle(const int Left, const int Top, const int Diameter) | ||||||||||||
| (void) Draws outline of the circle with the specified coordinates. Note that the point (Left, Top) is where the upper-left corner of a square with side length equal to "Diameter" would be if it were positioned exactly on top of our circle. | ||||||||||||
| ||||||||||||
|
nxtDrawEllipse
| void nxtDrawEllipse(const int Left, const int Top, const int Right, const int Bottom) | |||||||||||||||
| (void) Draws outline of the ellipse with the specified coordinates. | |||||||||||||||
| |||||||||||||||
|
nxtDrawLine
| void nxtDrawLine(const int xPos, const int yPos, const int xPosTo, const int yPosTo) | |||||||||||||||
| (void) Draws a line between two points. | |||||||||||||||
| |||||||||||||||
|
nxtDrawRect
| void nxtDrawRect(const int Left, const int Top, const int Right, const int Bottom) | |||||||||||||||
| (void) Draws outline of the rectangle with the specified coordinates. | |||||||||||||||
| |||||||||||||||
|
nxtEraseEllipse
| void nxtEraseEllipse(const int Left, const int Top, const int Right, const int Bottom) | |||||||||||||||
| (void) Erases (i.e. clears all pixels) the ellipse with the specified coordinates. | |||||||||||||||
| |||||||||||||||
|
nxtEraseLine
| void nxtEraseLine(const int xPos, const int yPos, const int xPosTo, const int yPosTo) | |||||||||||||||
| (void) Erases (i.e. clears) the pixels for the line between the specified pair of points. | |||||||||||||||
| |||||||||||||||
|
nxtEraseRect
| void nxtEraseRect(const int Left, const int Top, const int Right, const int Bottom) | |||||||||||||||
| (void) Erases (i.e. clears all pixels) the rectangle with the specified coordinates. | |||||||||||||||
| |||||||||||||||
|
nxtFillEllipse
| void nxtFillEllipse(const int Left, const int Top, const int Right, const int Bottom) | |||||||||||||||
| (void) Fills (i.e. all pixels black) the ellipse with the specified coordinates. | |||||||||||||||
| |||||||||||||||
|
nxtFillRect
| void nxtFillRect(const int Left, const int Top, const int Right, const int Bottom) | |||||||||||||||
| (void) Fills (i.e. all pixels black) the rectangle with the specified coordinates. | |||||||||||||||
| |||||||||||||||
|
nxtInvertLine
| void nxtInvertLine(const int xPos, const int yPos, const int xPosTo, const int yPosTo) | |||||||||||||||
| (void) Inverts the pixels for the given line. This function is very useful for functions like drawing a "clock face", a "compass" or a gauge on the LCD screen when you want to "erase" the previous dial pointer and redraw it at a new position. If you use "invert line" for the original drawing and for the "erase" drawing the two calls will cancel each other out! And it work well if the line overdraws some existing pixels -- e.g. some text on the LCD. | |||||||||||||||
| |||||||||||||||
|
nxtScrollText
| void nxtScrollText(string sFormatString, ...) | ||||||
| (void) Shift the LCD image up one line. Thenit formats a text string and displays it on the bottom line of the LCD text screen. | ||||||
| ||||||
|
nxtSetPixel
| void nxtSetPixel(const int xPos, const int yPos) | |||||||||
| (void) Sets a single pixel on the NXT LCD screen. | |||||||||
| |||||||||
|
