Difference between revisions of "VEX2 Functions Display"

From ROBOTC API Guide
Jump to: navigation, search
Line 135: Line 135:
 
<br />
 
<br />
  
== bNxtLCDStatusDisplay ==
 
{| style="color:black;" width="100%" cellpadding="5%" cellspacing="0" border="0"
 
|-
 
| class="variableType"| <span class="bigKeywordBI">bool </span><span class="bigKeywordB">bNxtLCDStatusDisplay</span>
 
|-
 
| style="font-family:Verdana, Geneva, sans-serif; color:black; background-color:#FFFFFF; text-align:left; font-size:100%;"|([[Data_Types#dataType_bool|bool]]) Boolean variable that indicates whether the top status line display on the LCD should be present on user-drawn LCD screens.
 
|-
 
|
 
  {|
 
  |-
 
  |<syntaxhighlight lang="ROBOTC">bNxtLCDStatusDisplay = true;  // the NXT top status line WILL display on user-drawn LCD screens
 
bNxtLCDStatusDisplay = false;  // the NXT top status line WILL NOT display on user-drawn LCD screens</syntaxhighlight>
 
  |-
 
  |}
 
|-
 
|}
 
<br />
 
  
== eraseDisplay ==
 
{| style="color:black;" width="100%" cellpadding="5%" cellspacing="0" border="0"
 
|-
 
| class="functionType"| <span class="bigKeywordBI">void </span><span class="bigKeywordB">eraseDisplay</span><span class="bigCodePunc">()</span>
 
|-
 
| style="font-family:Verdana, Geneva, sans-serif; color:black; background-color:#FFFFFF; text-align:left; font-size:100%;"|([[Data_Types#dataType_void|void]]) Erases the complete NXT LCD display. 
 
|-
 
|
 
  {|
 
  |-
 
  |<syntaxhighlight lang="ROBOTC">eraseDisplay();  // erase the entire NXT LCD display</syntaxhighlight>
 
  |-
 
  |}
 
|-
 
|}
 
<br />
 
 
== nxtClearPixel ==
 
{| style="color:black;" width="100%" cellpadding="5%" cellspacing="0" border="0"
 
|-
 
| class="functionType"| <span class="bigKeywordBI">void </span><span class="bigKeywordB">nxtClearPixel</span><span class="bigCodePunc">(</span><span class="bigKeywordBI">const int </span><span class="bigCodeBasic">xPos</span><span class="bigCodePunc">, </span><span class="bigKeywordBI">const int </span><span class="bigCodeBasic">yPos</span><span class="bigCodePunc">)</span>
 
|-
 
| style="font-family:Verdana, Geneva, sans-serif; color:black; background-color:#FFFFFF; text-align:left; font-size:100%;"|([[Data_Types#dataType_void|void]]) Clears a single pixel on the NXT LCD screen.
 
|-
 
|
 
  {| class="parameterTable" cellpadding="5%" width="100%"
 
  ! width="20%" style="border-style: solid; border-width: 0px 0px 1px 0px"|Parameter
 
  ! width="60%" style="border-style: solid; border-width: 0px 0px 1px 0px"|Explanation
 
  ! width="20%" style="border-style: solid; border-width: 0px 0px 1px 0px"|Data Type
 
  |-
 
  | style="border-style: solid; border-width: 1px 0px 1px 0px"|''xPos''
 
  | style="border-style: solid; border-width: 1px 0px 1px 0px"|
 
  | style="border-style: solid; border-width: 1px 0px 1px 0px"|[[Data_Types#dataType_int|int]]
 
  |-
 
  | style="border-style: solid; border-width: 0px 0px 0px 0px"|''yPos''
 
  | style="border-style: solid; border-width: 0px 0px 0px 0px"|
 
  | style="border-style: solid; border-width: 0px 0px 0px 0px"|[[Data_Types#dataType_int|int]]
 
  |-
 
  |}
 
|-
 
|
 
  {|
 
  |-
 
  |<syntaxhighlight lang="ROBOTC">
 
int X = 50;          // create and initialize variable 'X' = 50 
 
int Y = 32;          // create and initialize variable 'Y' = 32 
 
nxtClearPixel(X, Y);  // clear a pixel at position (X, Y)</syntaxhighlight>
 
  |-
 
  |}
 
|-
 
|}
 
<br />
 
 
== nxtDisplayBigStringAt ==
 
{| style="color:black;" width="100%" cellpadding="5%" cellspacing="0" border="0"
 
|-
 
| class="functionType"| <span class="bigKeywordBI">void </span><span class="bigKeywordB">nxtDisplayBigStringAt</span><span class="bigCodePunc">(</span><span class="bigKeywordBI">const int </span><span class="bigCodeBasic">xPos</span><span class="bigCodePunc">, </span><span class="bigKeywordBI">const int </span><span class="bigCodeBasic">yPos</span><span class="bigCodePunc">, </span><span class="bigKeywordBI">string </span><span class="bigCodeBasic">sFormatString</span><span class="bigCodePunc">, </span><span class="bigCodeBasic">...</span><span class="bigCodePunc">)</span>
 
|-
 
| style="font-family:Verdana, Geneva, sans-serif; color:black; background-color:#FFFFFF; text-align:left; font-size:100%;"|([[Data_Types#dataType_void|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.
 
|-
 
|
 
  {| class="parameterTable" cellpadding="5%" width="100%"
 
  ! width="20%" style="border-style: solid; border-width: 0px 0px 1px 0px"|Parameter
 
  ! width="60%" style="border-style: solid; border-width: 0px 0px 1px 0px"|Explanation
 
  ! width="20%" style="border-style: solid; border-width: 0px 0px 1px 0px"|Data Type
 
  |-
 
  | style="border-style: solid; border-width: 1px 0px 1px 0px"|''xPos''
 
  | style="border-style: solid; border-width: 1px 0px 1px 0px"|X-coordinate of pixel to start text from
 
  | style="border-style: solid; border-width: 1px 0px 1px 0px"|[[Data_Types#dataType_int|int]]
 
  |-
 
  | style="border-style: solid; border-width: 0px 0px 1px 0px"|''yPos''
 
  | style="border-style: solid; border-width: 0px 0px 1px 0px"|Y-coordinate of pixel to start text from
 
  | style="border-style: solid; border-width: 0px 0px 1px 0px"|[[Data_Types#dataType_int|int]]
 
  |-
 
  | style="border-style: solid; border-width: 0px 0px 0px 0px"|''sFormatString''
 
  | style="border-style: solid; border-width: 0px 0px 0px 0px"|the string(s) to display<br />(can be formatted!)
 
  | style="border-style: solid; border-width: 0px 0px 0px 0px"|[[Data_Types#dataType_string|string]]
 
  |-
 
  |}
 
|-
 
|
 
  {|
 
  |-
 
  |<syntaxhighlight lang="ROBOTC">
 
int printMe = 1;                                              // create and Initialize 'printMe' = 1
 
int printMeToo = 2;                                          // create and Initialize 'printMeToo' = 2
 
nxtDisplayBigStringAt(0, 31, "%d, %d", printMe, PrintMeToo);  // displays (in large font): "1, 2"
 
                                                              // beginning at (0, 31)</syntaxhighlight>
 
  |-
 
  |}
 
|-
 
|}
 
<br />
 
 
== nxtDisplayBigTextLine ==
 
{| style="color:black;" width="100%" cellpadding="5%" cellspacing="0" border="0"
 
|-
 
| class="functionType"| <span class="bigKeywordBI">void </span><span class="bigKeywordB">nxtDisplayBigTextLine</span><span class="bigCodePunc">(</span><span class="bigKeywordBI">const int </span><span class="bigCodeBasic">nLineNumber</span><span class="bigCodePunc">, </span><span class="bigKeywordBI">string </span><span class="bigCodeBasic">sFormatString</span><span class="bigCodePunc">, </span><span class="bigCodeBasic">...</span><span class="bigCodePunc">)</span>
 
|-
 
| style="font-family:Verdana, Geneva, sans-serif; color:black; background-color:#FFFFFF; text-align:left; font-size:100%;"|([[Data_Types#dataType_void|void]]) Displays a text string on one of the 8 possible text lines. Drawing uses a large font that is 16-pixels high.
 
|-
 
|
 
  {| class="parameterTable" cellpadding="5%" width="100%"
 
  ! width="20%" style="border-style: solid; border-width: 0px 0px 1px 0px"|Parameter
 
  ! width="60%" style="border-style: solid; border-width: 0px 0px 1px 0px"|Explanation
 
  ! width="20%" style="border-style: solid; border-width: 0px 0px 1px 0px"|Data Type
 
  |-
 
  | style="border-style: solid; border-width: 1px 0px 1px 0px"|''nLineNumber''
 
  | style="border-style: solid; border-width: 1px 0px 1px 0px"|The line to print a string on<br />([top] 0 to 7 [bottom])
 
  | style="border-style: solid; border-width: 1px 0px 1px 0px"|[[Data_Types#dataType_int|int]]
 
  |-
 
  | style="border-style: solid; border-width: 0px 0px 0px 0px"|''sFormatString''
 
  | style="border-style: solid; border-width: 0px 0px 0px 0px"|the string(s) to display<br />(can be formatted!)
 
  | style="border-style: solid; border-width: 0px 0px 0px 0px"|[[Data_Types#dataType_string|string]]
 
  |-
 
  |}
 
|-
 
|
 
  {|
 
  |-
 
  |<syntaxhighlight lang="ROBOTC">
 
int printMe = 1;                                          // create and Initialize 'printMe' = 1
 
int printMeToo = 2;                                      // create and Initialize 'printMeToo' = 2
 
nxtDisplayBigTextLine(3, "%d, %d", printMe, PrintMeToo);  // displays on line 3 (large): "1, 2"</syntaxhighlight>
 
  |-
 
  |}
 
|-
 
|}
 
<br />
 
 
== nxtDisplayCenteredBigTextLine ==
 
{| style="color:black;" width="100%" cellpadding="5%" cellspacing="0" border="0"
 
|-
 
| class="functionType"| <span class="bigKeywordBI">void </span><span class="bigKeywordB">nxtDisplayCenteredBigTextLine</span><span class="bigCodePunc">(</span><span class="bigKeywordBI">const int </span><span class="bigCodeBasic">nLineNumber</span><span class="bigCodePunc">, </span><span class="bigKeywordBI">string </span><span class="bigCodeBasic">sFormatString</span><span class="bigCodePunc">, </span><span class="bigCodeBasic">...</span><span class="bigCodePunc">)</span>
 
|-
 
| style="font-family:Verdana, Geneva, sans-serif; color:black; background-color:#FFFFFF; text-align:left; font-size:100%;"|([[Data_Types#dataType_void|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.
 
|-
 
|
 
  {| class="parameterTable" cellpadding="5%" width="100%"
 
  ! width="20%" style="border-style: solid; border-width: 0px 0px 1px 0px"|Parameter
 
  ! width="60%" style="border-style: solid; border-width: 0px 0px 1px 0px"|Explanation
 
  ! width="20%" style="border-style: solid; border-width: 0px 0px 1px 0px"|Data Type
 
  |-
 
  | style="border-style: solid; border-width: 1px 0px 1px 0px"|''nLineNumber''
 
  | style="border-style: solid; border-width: 1px 0px 1px 0px"|The line to print a string on<br />([top] 0 to 7 [bottom])
 
  | style="border-style: solid; border-width: 1px 0px 1px 0px"|[[Data_Types#dataType_int|int]]
 
  |-
 
  | style="border-style: solid; border-width: 0px 0px 0px 0px"|''sFormatString''
 
  | style="border-style: solid; border-width: 0px 0px 0px 0px"|the string(s) to display<br />(can be formatted!)
 
  | style="border-style: solid; border-width: 0px 0px 0px 0px"|[[Data_Types#dataType_string|string]]
 
  |-
 
  |}
 
|-
 
|
 
  {|
 
  |-
 
  |<syntaxhighlight lang="ROBOTC">
 
int printMe = 1;                                                  // create and Initialize 'printMe' = 1
 
int printMeToo = 2;                                              // create and Initialize 'printMeToo' = 2
 
nxtDisplayCenteredBigTextLine(3, "%d, %d", printMe, PrintMeToo);  // displays on line 3 (centered and large): "1, 2"</syntaxhighlight>
 
  |-
 
  |}
 
|-
 
|}
 
<br />
 
 
== nxtDisplayCenteredTextLine ==
 
{| style="color:black;" width="100%" cellpadding="5%" cellspacing="0" border="0"
 
|-
 
| class="functionType"| <span class="bigKeywordBI">void </span><span class="bigKeywordB">nxtDisplayCenteredTextLine</span><span class="bigCodePunc">(</span><span class="bigKeywordBI">const int </span><span class="bigCodeBasic">nLineNumber</span><span class="bigCodePunc">, </span><span class="bigKeywordBI">string </span><span class="bigCodeBasic">sFormatString</span><span class="bigCodePunc">, </span><span class="bigCodeBasic">...</span><span class="bigCodePunc">)</span>
 
|-
 
| style="font-family:Verdana, Geneva, sans-serif; color:black; background-color:#FFFFFF; text-align:left; font-size:100%;"|([[Data_Types#dataType_void|void]]) Displays a text string on one of the 8 possible text lines. The text is horiztonally centered on the LCD display.
 
|-
 
|
 
  {| class="parameterTable" cellpadding="5%" width="100%"
 
  ! width="20%" style="border-style: solid; border-width: 0px 0px 1px 0px"|Parameter
 
  ! width="60%" style="border-style: solid; border-width: 0px 0px 1px 0px"|Explanation
 
  ! width="20%" style="border-style: solid; border-width: 0px 0px 1px 0px"|Data Type
 
  |-
 
  | style="border-style: solid; border-width: 1px 0px 1px 0px"|''nLineNumber''
 
  | style="border-style: solid; border-width: 1px 0px 1px 0px"|The line to print a string on<br />([top] 0 to 7 [bottom])
 
  | style="border-style: solid; border-width: 1px 0px 1px 0px"|[[Data_Types#dataType_int|int]]
 
  |-
 
  | style="border-style: solid; border-width: 0px 0px 0px 0px"|''sFormatString''
 
  | style="border-style: solid; border-width: 0px 0px 0px 0px"|the string(s) to display<br />(can be formatted!)
 
  | style="border-style: solid; border-width: 0px 0px 0px 0px"|[[Data_Types#dataType_string|string]]
 
  |-
 
  |}
 
|-
 
|
 
  {|
 
  |-
 
  |<syntaxhighlight lang="ROBOTC">
 
int printMe = 1;                                              // create and Initialize 'printMe' = 1
 
int printMeToo = 2;                                            // create and Initialize 'printMeToo' = 2
 
nxtDisplayCenteredTextLine(3, "%d, %d", printMe, PrintMeToo);  // displays on line 3 (centered): "1, 2"</syntaxhighlight>
 
  |-
 
  |}
 
|-
 
|}
 
<br />
 
 
== nxtDisplayClearTextLine ==
 
{| style="color:black;" width="100%" cellpadding="5%" cellspacing="0" border="0"
 
|-
 
| class="functionType"| <span class="bigKeywordBI">void </span><span class="bigKeywordB">nxtDisplayClearTextLine</span><span class="bigCodePunc">(</span><span class="bigKeywordBI">const int </span><span class="bigCodeBasic">nLineNumber</span><span class="bigCodePunc">)</span>
 
|-
 
| style="font-family:Verdana, Geneva, sans-serif; color:black; background-color:#FFFFFF; text-align:left; font-size:100%;"|([[Data_Types#dataType_void|void]]) Erases a line of text. <span class="codeBasic">nLineNumber</span> specifies one of the 8 possible text lines.
 
|-
 
|
 
  {| class="parameterTable" cellpadding="5%" width="100%"
 
  ! width="20%" style="border-style: solid; border-width: 0px 0px 1px 0px"|Parameter
 
  ! width="60%" style="border-style: solid; border-width: 0px 0px 1px 0px"|Explanation
 
  ! width="20%" style="border-style: solid; border-width: 0px 0px 1px 0px"|Data Type
 
  |-
 
  | style="border-style: solid; border-width: 1px 0px 0px 0px"|''nLineNumber''
 
  | style="border-style: solid; border-width: 1px 0px 0px 0px"|The line to print a string on<br />([top] 0 to 7 [bottom])
 
  | style="border-style: solid; border-width: 1px 0px 0px 0px"|[[Data_Types#dataType_int|int]]
 
  |-
 
  |}
 
|-
 
|
 
  {|
 
  |-
 
  |<syntaxhighlight lang="ROBOTC">nxtDisplayClearTextLine(3);  // clears line 3</syntaxhighlight>
 
  |-
 
  |}
 
|-
 
|}
 
<br />
 
 
== nxtDisplayRICFile ==
 
{| style="color:black;" width="100%" cellpadding="5%" cellspacing="0" border="0"
 
|-
 
| class="functionType"| <span class="bigKeywordBI">void </span><span class="bigKeywordB">nxtDisplayRICFile</span><span class="bigCodePunc">(</span><span class="bigKeywordBI">const int </span><span class="bigCodeBasic">nleft</span><span class="bigCodePunc">, </span><span class="bigKeywordBI">const int </span><span class="bigCodeBasic">nBottom</span><span class="bigCodePunc">, </span><span class="bigKeywordBI">const string </span><span class="bigCodeBasic">sFileName</span><span class="bigCodePunc">)</span>
 
|-
 
| style="font-family:Verdana, Geneva, sans-serif; color:black; background-color:#FFFFFF; text-align:left; font-size:100%;"|([[Data_Types#dataType_void|void]]) Display a RIC (i.e. "ICON" or "Picture") file on the NXT display at the specified coordinates.
 
|-
 
|
 
  {| class="parameterTable" cellpadding="5%" width="100%"
 
  ! width="20%" style="border-style: solid; border-width: 0px 0px 1px 0px"|Parameter
 
  ! width="60%" style="border-style: solid; border-width: 0px 0px 1px 0px"|Explanation
 
  ! width="20%" style="border-style: solid; border-width: 0px 0px 1px 0px"|Data Type
 
  |-
 
  | style="border-style: solid; border-width: 1px 0px 1px 0px"|''nLeft''
 
  | style="border-style: solid; border-width: 1px 0px 1px 0px"|
 
  | style="border-style: solid; border-width: 1px 0px 1px 0px"|[[Data_Types#dataType_int|int]]
 
  |-
 
  | style="border-style: solid; border-width: 0px 0px 1px 0px"|''nRight''
 
  | style="border-style: solid; border-width: 0px 0px 1px 0px"|
 
  | style="border-style: solid; border-width: 0px 0px 1px 0px"|[[Data_Types#dataType_int|int]]
 
  |-
 
  | style="border-style: solid; border-width: 0px 0px 0px 0px"|''sFileName''
 
  | style="border-style: solid; border-width: 0px 0px 0px 0px"|
 
  | style="border-style: solid; border-width: 0px 0px 0px 0px"|[[Data_Types#dataType_string|string]]
 
  |-
 
  |}
 
|-
 
|
 
  {|
 
  |-
 
  |<syntaxhighlight lang="ROBOTC">
 
while(true)                                // infinite loop:
 
{
 
  nxtDisplayRICFile(0, 0, "faceclosed.ric");  // display the .ric file, "faceclosed.ric" at pos(x,y)
 
  wait1Msec(50);                              // wait 50 milliseconds (helps refresh rate of LCD screen)
 
}</syntaxhighlight>
 
  |-
 
  |}
 
|-
 
|}
 
<br />
 
 
== nxtDisplayString ==
 
{| style="color:black;" width="100%" cellpadding="5%" cellspacing="0" border="0"
 
|-
 
| class="functionType"| <span class="bigKeywordBI">void </span><span class="bigKeywordB">nxtDisplayString</span><span class="bigCodePunc">(</span><span class="bigKeywordBI">const int </span><span class="bigCodeBasic">nLineNumber</span><span class="bigCodePunc">, </span><span class="bigKeywordBI">string </span><span class="bigCodeBasic">sFormatString</span><span class="bigCodePunc">, </span><span class="bigCodeBasic">...</span><span class="bigCodePunc">)</span>
 
|-
 
| style="font-family:Verdana, Geneva, sans-serif; color:black; background-color:#FFFFFF; text-align:left; font-size:100%;"|([[Data_Types#dataType_void|void]]) Formats a character string according the the format specified in <span class="codeBasic">sFormatString</span> using parameters <span class="codeBasic">parm1</span>, <span class="codeBasic">parm2</span>, and <span class="codeBasic">parm3</span>. Display the result on text line <span class="codeBasic">nLineNumber</span>. 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.
 
|-
 
|
 
  {| class="parameterTable" cellpadding="5%" width="100%"
 
  ! width="20%" style="border-style: solid; border-width: 0px 0px 1px 0px"|Parameter
 
  ! width="60%" style="border-style: solid; border-width: 0px 0px 1px 0px"|Explanation
 
  ! width="20%" style="border-style: solid; border-width: 0px 0px 1px 0px"|Data Type
 
  |-
 
  | style="border-style: solid; border-width: 1px 0px 1px 0px"|''nLineNumber''
 
  | style="border-style: solid; border-width: 1px 0px 1px 0px"|The line to print a string on<br />([top] 0 to 7 [bottom])
 
  | style="border-style: solid; border-width: 1px 0px 1px 0px"|[[Data_Types#dataType_int|int]]
 
  |-
 
  | style="border-style: solid; border-width: 0px 0px 0px 0px"|''sFormatString''
 
  | style="border-style: solid; border-width: 0px 0px 0px 0px"|the string(s) to display<br />(can be formatted!)
 
  | style="border-style: solid; border-width: 0px 0px 0px 0px"|[[Data_Types#dataType_string|string]]
 
  |-
 
  |}
 
|-
 
|
 
  {|
 
  |-
 
  |<syntaxhighlight lang="ROBOTC">
 
while(true)                    // infinite loop:
 
{
 
  string s1 = "Theory";          // create the string named s1, "Theory"
 
  nxtDisplayString(3, "%s", s1);  // display the string, 's1' on line 3
 
  wait1Msec(50);                  // wait 50 milliseconds (helps refresh rate of LCD screen)
 
}</syntaxhighlight>
 
  |-
 
  |}
 
|-
 
|}
 
<br />
 
 
== nxtDisplayStringAt ==
 
{| style="color:black;" width="100%" cellpadding="5%" cellspacing="0" border="0"
 
|-
 
| class="functionType"| <span class="bigKeywordBI">void </span><span class="bigKeywordB">nxtDisplayStringAt</span><span class="bigCodePunc">(</span><span class="bigKeywordBI">const int </span><span class="bigCodeBasic">xPos</span><span class="bigCodePunc">, </span><span class="bigKeywordBI">const int </span><span class="bigCodeBasic">yPos</span><span class="bigCodePunc">, </span><span class="bigKeywordBI">string </span><span class="bigCodeBasic">sFormatString</span><span class="bigCodePunc">, </span><span class="bigCodeBasic">...</span><span class="bigCodePunc">)</span>
 
|-
 
| style="font-family:Verdana, Geneva, sans-serif; color:black; background-color:#FFFFFF; text-align:left; font-size:100%;"|([[Data_Types#dataType_void|void]]) Displays a text string  at (X,Y) coordinate on the LCD display.
 
|-
 
|
 
  {| class="parameterTable" cellpadding="5%" width="100%"
 
  ! width="20%" style="border-style: solid; border-width: 0px 0px 1px 0px"|Parameter
 
  ! width="60%" style="border-style: solid; border-width: 0px 0px 1px 0px"|Explanation
 
  ! width="20%" style="border-style: solid; border-width: 0px 0px 1px 0px"|Data Type
 
  |-
 
  | style="border-style: solid; border-width: 1px 0px 1px 0px"|''xPos''
 
  | style="border-style: solid; border-width: 1px 0px 1px 0px"|X-coordinate of pixel to start text from
 
  | style="border-style: solid; border-width: 1px 0px 1px 0px"|[[Data_Types#dataType_int|int]]
 
  |-
 
  | style="border-style: solid; border-width: 0px 0px 1px 0px"|''yPos''
 
  | style="border-style: solid; border-width: 0px 0px 1px 0px"|Y-coordinate of pixel to start text from
 
  | style="border-style: solid; border-width: 0px 0px 1px 0px"|[[Data_Types#dataType_int|int]]
 
  |-
 
  | style="border-style: solid; border-width: 0px 0px 0px 0px"|''sFormatString''
 
  | style="border-style: solid; border-width: 0px 0px 0px 0px"|the string(s) to display<br />(can be formatted!)
 
  | style="border-style: solid; border-width: 0px 0px 0px 0px"|[[Data_Types#dataType_string|string]]
 
  |-
 
  |}
 
|-
 
|
 
  {|
 
  |-
 
  |<syntaxhighlight lang="ROBOTC">
 
while(true)                          // infinite loop:
 
{
 
  nxtDisplayStringAt(0, 0, "Theory");  // display the string, "Theory" at position (x, y)
 
  wait1Msec(50);                      // wait 50 milliseconds (helps refresh rate of LCD screen)
 
}</syntaxhighlight>
 
  |-
 
  |}
 
|-
 
|}
 
<br />
 
 
== nxtDisplayTextLine ==
 
{| style="color:black;" width="100%" cellpadding="5%" cellspacing="0" border="0"
 
|-
 
| class="functionType"| <span class="bigKeywordBI">void </span><span class="bigKeywordB">nxtDisplayTextLine</span><span class="bigCodePunc">(</span><span class="bigKeywordBI">const int </span><span class="bigCodeBasic">nLineNumber</span><span class="bigCodePunc">, </span><span class="bigKeywordBI">string </span><span class="bigCodeBasic">sFormatString</span><span class="bigCodePunc">, </span><span class="bigCodeBasic">...</span><span class="bigCodePunc">)</span>
 
|-
 
| style="font-family:Verdana, Geneva, sans-serif; color:black; background-color:#FFFFFF; text-align:left; font-size:100%;"|([[Data_Types#dataType_void|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.
 
|-
 
|
 
  {| class="parameterTable" cellpadding="5%" width="100%"
 
  ! width="20%" style="border-style: solid; border-width: 0px 0px 1px 0px"|Parameter
 
  ! width="60%" style="border-style: solid; border-width: 0px 0px 1px 0px"|Explanation
 
  ! width="20%" style="border-style: solid; border-width: 0px 0px 1px 0px"|Data Type
 
  |-
 
  | style="border-style: solid; border-width: 1px 0px 1px 0px"|''nLineNumber''
 
  | style="border-style: solid; border-width: 1px 0px 1px 0px"|The line to print a string on<br />([top] 0 to 7 [bottom])
 
  | style="border-style: solid; border-width: 1px 0px 1px 0px"|[[Data_Types#dataType_int|int]]
 
  |-
 
  | style="border-style: solid; border-width: 0px 0px 0px 0px"|''sFormatString''
 
  | style="border-style: solid; border-width: 0px 0px 0px 0px"|the string(s) to display<br />(can be formatted!)
 
  | style="border-style: solid; border-width: 0px 0px 0px 0px"|[[Data_Types#dataType_string|string]]
 
  |-
 
  |}
 
|-
 
|
 
  {|
 
  |-
 
  |<syntaxhighlight lang="ROBOTC">
 
while(true)                      // infinite loop:
 
{
 
  string s1 = "Theory";            // create the string named s1, "Theory"
 
  nxtDisplayTextLine(3, "%s", s1);  // display the string, 's1' on line 3
 
  wait1Msec(50);                    // wait 50 milliseconds (helps refresh rate of LCD screen)
 
}</syntaxhighlight>
 
  |-
 
  |}
 
|-
 
|}
 
<br />
 
 
== nxtDrawCircle ==
 
{| style="color:black;" width="100%" cellpadding="5%" cellspacing="0" border="0"
 
|-
 
| class="functionType"| <span class="bigKeywordBI">void </span><span class="bigKeywordB">nxtDrawCircle</span><span class="bigCodePunc">(</span><span class="bigKeywordBI">const int </span><span class="bigCodeBasic">Left</span><span class="bigCodePunc">, </span><span class="bigKeywordBI">const int </span><span class="bigCodeBasic">Top</span><span class="bigCodePunc">, </span><span class="bigKeywordBI">const int </span><span class="bigCodeBasic">Diameter</span><span class="bigCodePunc">)</span>
 
|-
 
| style="font-family:Verdana, Geneva, sans-serif; color:black; background-color:#FFFFFF; text-align:left; font-size:100%;"|([[Data_Types#dataType_void|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.
 
[[File:drawCircle_2.jpg]]
 
|-
 
|
 
  {| class="parameterTable" cellpadding="5%" width="100%"
 
  ! width="20%" style="border-style: solid; border-width: 0px 0px 1px 0px"|Parameter
 
  ! width="60%" style="border-style: solid; border-width: 0px 0px 1px 0px"|Explanation
 
  ! width="20%" style="border-style: solid; border-width: 0px 0px 1px 0px"|Data Type
 
  |-
 
  | style="border-style: solid; border-width: 1px 0px 1px 0px"|''Left''
 
  | style="border-style: solid; border-width: 1px 0px 1px 0px"|The x-coordinate of the upper left corner of the square with side length equal to diameter of circle
 
  | style="border-style: solid; border-width: 1px 0px 1px 0px"|[[Data_Types#dataType_int|int]]
 
  |-
 
  | style="border-style: solid; border-width: 0px 0px 1px 0px"|''Top''
 
  | style="border-style: solid; border-width: 0px 0px 1px 0px"|The y-coordinate of the upper left corner of the square with side length equal to diameter of circle
 
  | style="border-style: solid; border-width: 0px 0px 1px 0px"|[[Data_Types#dataType_int|int]]
 
  |-
 
  | style="border-style: solid; border-width: 0px 0px 0px 0px"|''Diameter''
 
  | style="border-style: solid; border-width: 0px 0px 0px 0px"|The diameter of the circle
 
  | style="border-style: solid; border-width: 0px 0px 0px 0px"|[[Data_Types#dataType_int|int]]
 
  |-
 
  |}
 
|-
 
|
 
  {|
 
  |-
 
  |<syntaxhighlight lang="ROBOTC">nxtDrawCircle(20, 50, 25);  // display a circle; left border at 20, top border at 50, diameter of 25</syntaxhighlight>
 
  |-
 
  |}
 
|-
 
|}
 
<br />
 
 
== nxtDrawEllipse ==
 
{| style="color:black;" width="100%" cellpadding="5%" cellspacing="0" border="0"
 
|-
 
| class="functionType"| <span class="bigKeywordBI">void </span><span class="bigKeywordB">nxtDrawEllipse</span><span class="bigCodePunc">(</span><span class="bigKeywordBI">const int </span><span class="bigCodeBasic">Left</span><span class="bigCodePunc">, </span><span class="bigKeywordBI">const int </span><span class="bigCodeBasic">Top</span><span class="bigCodePunc">, </span><span class="bigKeywordBI">const int </span><span class="bigCodeBasic">Right</span><span class="bigCodePunc">, </span><span class="bigKeywordBI">const int </span><span class="bigCodeBasic">Bottom</span><span class="bigCodePunc">)</span>
 
|-
 
| style="font-family:Verdana, Geneva, sans-serif; color:black; background-color:#FFFFFF; text-align:left; font-size:100%;"|([[Data_Types#dataType_void|void]]) Draws outline of the ellipse with the specified coordinates.
 
|-
 
|
 
  {| class="parameterTable" cellpadding="5%" width="100%"
 
  ! width="20%" style="border-style: solid; border-width: 0px 0px 1px 0px"|Parameter
 
  ! width="60%" style="border-style: solid; border-width: 0px 0px 1px 0px"|Explanation
 
  ! width="20%" style="border-style: solid; border-width: 0px 0px 1px 0px"|Data Type
 
  |-
 
  | style="border-style: solid; border-width: 1px 0px 1px 0px"|''Left''
 
  | style="border-style: solid; border-width: 1px 0px 1px 0px"|The left-most point of the ellipse
 
  | style="border-style: solid; border-width: 1px 0px 1px 0px"|[[Data_Types#dataType_int|int]]
 
  |-
 
  | style="border-style: solid; border-width: 0px 0px 1px 0px"|''Top''
 
  | style="border-style: solid; border-width: 0px 0px 1px 0px"|The top-most point of the ellipse
 
  | style="border-style: solid; border-width: 0px 0px 1px 0px"|[[Data_Types#dataType_int|int]]
 
  |-
 
  | style="border-style: solid; border-width: 0px 0px 1px 0px"|''Right''
 
  | style="border-style: solid; border-width: 0px 0px 1px 0px"|The right-most point of the ellipse
 
  | style="border-style: solid; border-width: 0px 0px 1px 0px"|[[Data_Types#dataType_int|int]]
 
  |-
 
  | style="border-style: solid; border-width: 0px 0px 0px 0px"|''Bottom''
 
  | style="border-style: solid; border-width: 0px 0px 0px 0px"|The bottom-most point of the ellipse
 
  | style="border-style: solid; border-width: 0px 0px 0px 0px"|[[Data_Types#dataType_int|int]]
 
  |-
 
  |}
 
|-
 
|
 
  {|
 
  |-
 
  |<syntaxhighlight lang="ROBOTC">
 
nxtDrawEllipse(20, 50, 60, 25);  // display an ellipse; left border at 20, top border at 50,
 
                                // right border at 60, bottom border at 25</syntaxhighlight>
 
  |-
 
  |}
 
|-
 
|}
 
<br />
 
 
== nxtDrawLine ==
 
{| style="color:black;" width="100%" cellpadding="5%" cellspacing="0" border="0"
 
|-
 
| class="functionType"| <span class="bigKeywordBI">void </span><span class="bigKeywordB">nxtDrawLine</span><span class="bigCodePunc">(</span><span class="bigKeywordBI">const int </span><span class="bigCodeBasic">xPos</span><span class="bigCodePunc">, </span><span class="bigKeywordBI">const int </span><span class="bigCodeBasic">yPos</span><span class="bigCodePunc">, </span><span class="bigKeywordBI">const int </span><span class="bigCodeBasic">xPosTo</span><span class="bigCodePunc">, </span><span class="bigKeywordBI">const int </span><span class="bigCodeBasic">yPosTo</span><span class="bigCodePunc">)</span>
 
|-
 
| style="font-family:Verdana, Geneva, sans-serif; color:black; background-color:#FFFFFF; text-align:left; font-size:100%;"|([[Data_Types#dataType_void|void]]) Draws a line between two points.
 
|-
 
|
 
  {| class="parameterTable" cellpadding="5%" width="100%"
 
  ! width="20%" style="border-style: solid; border-width: 0px 0px 1px 0px"|Parameter
 
  ! width="60%" style="border-style: solid; border-width: 0px 0px 1px 0px"|Explanation
 
  ! width="20%" style="border-style: solid; border-width: 0px 0px 1px 0px"|Data Type
 
  |-
 
  | style="border-style: solid; border-width: 1px 0px 1px 0px"|''xPos''
 
  | style="border-style: solid; border-width: 1px 0px 1px 0px"|The X-coordinate of the first point
 
  | style="border-style: solid; border-width: 1px 0px 1px 0px"|[[Data_Types#dataType_int|int]]
 
  |-
 
  | style="border-style: solid; border-width: 0px 0px 1px 0px"|''yPos''
 
  | style="border-style: solid; border-width: 0px 0px 1px 0px"|The Y-coordinate of the first point
 
  | style="border-style: solid; border-width: 0px 0px 1px 0px"|[[Data_Types#dataType_int|int]]
 
  |-
 
  | style="border-style: solid; border-width: 0px 0px 1px 0px"|''xPosTo''
 
  | style="border-style: solid; border-width: 0px 0px 1px 0px"|The X-coordinate of the second point
 
  | style="border-style: solid; border-width: 0px 0px 1px 0px"|[[Data_Types#dataType_int|int]]
 
  |-
 
  | style="border-style: solid; border-width: 0px 0px 0px 0px"|''yPosTo''
 
  | style="border-style: solid; border-width: 0px 0px 0px 0px"|The Y-coordinate of the second point
 
  | style="border-style: solid; border-width: 0px 0px 0px 0px"|[[Data_Types#dataType_int|int]]
 
  |-
 
  |}
 
|-
 
|
 
  {|
 
  |-
 
  |<syntaxhighlight lang="ROBOTC">nxtDrawLine(20, 50, 60, 25);  // display a line between the points (20,50) and (60,25)</syntaxhighlight>
 
  |-
 
  |}
 
|-
 
|}
 
<br />
 
 
== nxtDrawRect ==
 
{| style="color:black;" width="100%" cellpadding="5%" cellspacing="0" border="0"
 
|-
 
| class="functionType"| <span class="bigKeywordBI">void </span><span class="bigKeywordB">nxtDrawRect</span><span class="bigCodePunc">(</span><span class="bigKeywordBI">const int </span><span class="bigCodeBasic">Left</span><span class="bigCodePunc">, </span><span class="bigKeywordBI">const int </span><span class="bigCodeBasic">Top</span><span class="bigCodePunc">, </span><span class="bigKeywordBI">const int </span><span class="bigCodeBasic">Right</span><span class="bigCodePunc">, </span><span class="bigKeywordBI">const int </span><span class="bigCodeBasic">Bottom</span><span class="bigCodePunc">)</span>
 
|-
 
| style="font-family:Verdana, Geneva, sans-serif; color:black; background-color:#FFFFFF; text-align:left; font-size:100%;"|([[Data_Types#dataType_void|void]]) Draws outline of the rectangle with the specified coordinates.
 
|-
 
|
 
  {| class="parameterTable" cellpadding="5%" width="100%"
 
  ! width="20%" style="border-style: solid; border-width: 0px 0px 1px 0px"|Parameter
 
  ! width="60%" style="border-style: solid; border-width: 0px 0px 1px 0px"|Explanation
 
  ! width="20%" style="border-style: solid; border-width: 0px 0px 1px 0px"|Data Type
 
  |-
 
  | style="border-style: solid; border-width: 1px 0px 1px 0px"|''Left''
 
  | style="border-style: solid; border-width: 1px 0px 1px 0px"|The left-most point of the rectangle
 
  | style="border-style: solid; border-width: 1px 0px 1px 0px"|[[Data_Types#dataType_int|int]]
 
  |-
 
  | style="border-style: solid; border-width: 0px 0px 1px 0px"|''Top''
 
  | style="border-style: solid; border-width: 0px 0px 1px 0px"|The top-most point of the rectangle
 
  | style="border-style: solid; border-width: 0px 0px 1px 0px"|[[Data_Types#dataType_int|int]]
 
  |-
 
  | style="border-style: solid; border-width: 0px 0px 1px 0px"|''Right''
 
  | style="border-style: solid; border-width: 0px 0px 1px 0px"|The right-most point of the rectangle
 
  | style="border-style: solid; border-width: 0px 0px 1px 0px"|[[Data_Types#dataType_int|int]]
 
  |-
 
  | style="border-style: solid; border-width: 0px 0px 0px 0px"|''Bottom''
 
  | style="border-style: solid; border-width: 0px 0px 0px 0px"|The bottom-most point of the rectangle
 
  | style="border-style: solid; border-width: 0px 0px 0px 0px"|[[Data_Types#dataType_int|int]]
 
  |-
 
  |}
 
|-
 
|
 
  {|
 
  |-
 
  |<syntaxhighlight lang="ROBOTC">nxtDrawRect(20, 50, 60, 25);  // display a rectangle; left border at 20, top border at 50,
 
                              // right border at 60, bottom border at 25</syntaxhighlight>
 
  |-
 
  |}
 
|-
 
|}
 
<br />
 
 
== nxtEraseEllipse ==
 
{| style="color:black;" width="100%" cellpadding="5%" cellspacing="0" border="0"
 
|-
 
| class="functionType"| <span class="bigKeywordBI">void </span><span class="bigKeywordB">nxtEraseEllipse</span><span class="bigCodePunc">(</span><span class="bigKeywordBI">const int </span><span class="bigCodeBasic">Left</span><span class="bigCodePunc">, </span><span class="bigKeywordBI">const int </span><span class="bigCodeBasic">Top</span><span class="bigCodePunc">, </span><span class="bigKeywordBI">const int </span><span class="bigCodeBasic">Right</span><span class="bigCodePunc">, </span><span class="bigKeywordBI">const int </span><span class="bigCodeBasic">Bottom</span><span class="bigCodePunc">)</span>
 
|-
 
| style="font-family:Verdana, Geneva, sans-serif; color:black; background-color:#FFFFFF; text-align:left; font-size:100%;"|([[Data_Types#dataType_void|void]]) Erases (i.e. clears all pixels) the ellipse with the specified coordinates.
 
|-
 
|
 
  {| class="parameterTable" cellpadding="5%" width="100%"
 
  ! width="20%" style="border-style: solid; border-width: 0px 0px 1px 0px"|Parameter
 
  ! width="60%" style="border-style: solid; border-width: 0px 0px 1px 0px"|Explanation
 
  ! width="20%" style="border-style: solid; border-width: 0px 0px 1px 0px"|Data Type
 
  |-
 
  | style="border-style: solid; border-width: 1px 0px 1px 0px"|''Left''
 
  | style="border-style: solid; border-width: 1px 0px 1px 0px"|The left-most point of the ellipse
 
  | style="border-style: solid; border-width: 1px 0px 1px 0px"|[[Data_Types#dataType_int|int]]
 
  |-
 
  | style="border-style: solid; border-width: 0px 0px 1px 0px"|''Top''
 
  | style="border-style: solid; border-width: 0px 0px 1px 0px"|The top-most point of the ellipse
 
  | style="border-style: solid; border-width: 0px 0px 1px 0px"|[[Data_Types#dataType_int|int]]
 
  |-
 
  | style="border-style: solid; border-width: 0px 0px 1px 0px"|''Right''
 
  | style="border-style: solid; border-width: 0px 0px 1px 0px"|The right-most point of the ellipse
 
  | style="border-style: solid; border-width: 0px 0px 1px 0px"|[[Data_Types#dataType_int|int]]
 
  |-
 
  | style="border-style: solid; border-width: 0px 0px 0px 0px"|''Bottom''
 
  | style="border-style: solid; border-width: 0px 0px 0px 0px"|The bottom-most point of the ellipse
 
  | style="border-style: solid; border-width: 0px 0px 0px 0px"|[[Data_Types#dataType_int|int]]
 
  |-
 
  |}
 
|-
 
|
 
  {|
 
  |-
 
  |<syntaxhighlight lang="ROBOTC">nxtEraseEllipse(20, 50, 60, 25);  // erases an ellipse; left border at 20, top border at 50,
 
                                  // right border at 60, bottom border at 25</syntaxhighlight>
 
  |-
 
  |}
 
|-
 
|}
 
<br />
 
 
== nxtEraseLine ==
 
{| style="color:black;" width="100%" cellpadding="5%" cellspacing="0" border="0"
 
|-
 
| class="functionType"| <span class="bigKeywordBI">void </span><span class="bigKeywordB">nxtEraseLine</span><span class="bigCodePunc">(</span><span class="bigKeywordBI">const int </span><span class="bigCodeBasic">xPos</span><span class="bigCodePunc">, </span><span class="bigKeywordBI">const int </span><span class="bigCodeBasic">yPos</span><span class="bigCodePunc">, </span><span class="bigKeywordBI">const int </span><span class="bigCodeBasic">xPosTo</span><span class="bigCodePunc">, </span><span class="bigKeywordBI">const int </span><span class="bigCodeBasic">yPosTo</span><span class="bigCodePunc">)</span>
 
|-
 
| style="font-family:Verdana, Geneva, sans-serif; color:black; background-color:#FFFFFF; text-align:left; font-size:100%;"|([[Data_Types#dataType_void|void]]) Erases (i.e. clears) the pixels for the line between the specified pair of points.
 
|-
 
|
 
  {| class="parameterTable" cellpadding="5%" width="100%"
 
  ! width="20%" style="border-style: solid; border-width: 0px 0px 1px 0px"|Parameter
 
  ! width="60%" style="border-style: solid; border-width: 0px 0px 1px 0px"|Explanation
 
  ! width="20%" style="border-style: solid; border-width: 0px 0px 1px 0px"|Data Type
 
  |-
 
  | style="border-style: solid; border-width: 1px 0px 1px 0px"|''xPos''
 
  | style="border-style: solid; border-width: 1px 0px 1px 0px"|The X-coordinate of the first point
 
  | style="border-style: solid; border-width: 1px 0px 1px 0px"|[[Data_Types#dataType_int|int]]
 
  |-
 
  | style="border-style: solid; border-width: 0px 0px 1px 0px"|''yPos''
 
  | style="border-style: solid; border-width: 0px 0px 1px 0px"|The Y-coordinate of the first point
 
  | style="border-style: solid; border-width: 0px 0px 1px 0px"|[[Data_Types#dataType_int|int]]
 
  |-
 
  | style="border-style: solid; border-width: 0px 0px 1px 0px"|''xPosTo''
 
  | style="border-style: solid; border-width: 0px 0px 1px 0px"|The X-coordinate of the second point
 
  | style="border-style: solid; border-width: 0px 0px 1px 0px"|[[Data_Types#dataType_int|int]]
 
  |-
 
  | style="border-style: solid; border-width: 0px 0px 0px 0px"|''yPosTo''
 
  | style="border-style: solid; border-width: 0px 0px 0px 0px"|The Y-coordinate of the second point
 
  | style="border-style: solid; border-width: 0px 0px 0px 0px"|[[Data_Types#dataType_int|int]]
 
  |-
 
  |}
 
|-
 
|
 
  {|
 
  |-
 
  |<syntaxhighlight lang="ROBOTC">nxtEraseLine(20, 50, 60, 25);  // erase a line between the points (20,50) and (60,25)</syntaxhighlight>
 
  |-
 
  |}
 
|-
 
|}
 
<br />
 
 
== nxtEraseRect ==
 
{| style="color:black;" width="100%" cellpadding="5%" cellspacing="0" border="0"
 
|-
 
| class="functionType"| <span class="bigKeywordBI">void </span><span class="bigKeywordB">nxtEraseRect</span><span class="bigCodePunc">(</span><span class="bigKeywordBI">const int </span><span class="bigCodeBasic">Left</span><span class="bigCodePunc">, </span><span class="bigKeywordBI">const int </span><span class="bigCodeBasic">Top</span><span class="bigCodePunc">, </span><span class="bigKeywordBI">const int </span><span class="bigCodeBasic">Right</span><span class="bigCodePunc">, </span><span class="bigKeywordBI">const int </span><span class="bigCodeBasic">Bottom</span><span class="bigCodePunc">)</span>
 
|-
 
| style="font-family:Verdana, Geneva, sans-serif; color:black; background-color:#FFFFFF; text-align:left; font-size:100%;"|([[Data_Types#dataType_void|void]]) Erases (i.e. clears all pixels) the rectangle with the specified coordinates.
 
|-
 
|
 
  {| class="parameterTable" cellpadding="5%" width="100%"
 
  ! width="20%" style="border-style: solid; border-width: 0px 0px 1px 0px"|Parameter
 
  ! width="60%" style="border-style: solid; border-width: 0px 0px 1px 0px"|Explanation
 
  ! width="20%" style="border-style: solid; border-width: 0px 0px 1px 0px"|Data Type
 
  |-
 
  | style="border-style: solid; border-width: 1px 0px 1px 0px"|''Left''
 
  | style="border-style: solid; border-width: 1px 0px 1px 0px"|The left-most point of the rectangle
 
  | style="border-style: solid; border-width: 1px 0px 1px 0px"|[[Data_Types#dataType_int|int]]
 
  |-
 
  | style="border-style: solid; border-width: 0px 0px 1px 0px"|''Top''
 
  | style="border-style: solid; border-width: 0px 0px 1px 0px"|The top-most point of the rectangle
 
  | style="border-style: solid; border-width: 0px 0px 1px 0px"|[[Data_Types#dataType_int|int]]
 
  |-
 
  | style="border-style: solid; border-width: 0px 0px 1px 0px"|''Right''
 
  | style="border-style: solid; border-width: 0px 0px 1px 0px"|The right-most point of the rectangle
 
  | style="border-style: solid; border-width: 0px 0px 1px 0px"|[[Data_Types#dataType_int|int]]
 
  |-
 
  | style="border-style: solid; border-width: 0px 0px 0px 0px"|''Bottom''
 
  | style="border-style: solid; border-width: 0px 0px 0px 0px"|The bottom-most point of the rectangle
 
  | style="border-style: solid; border-width: 0px 0px 0px 0px"|[[Data_Types#dataType_int|int]]
 
  |-
 
  |}
 
|-
 
|
 
  {|
 
  |-
 
  |<syntaxhighlight lang="ROBOTC">nxtEraseRect(20, 50, 60, 25);  // erase a rectangle; left border at 20, top border at 50,
 
                              // right border at 60, bottom border at 25</syntaxhighlight>
 
  |-
 
  |}
 
|-
 
|}
 
<br />
 
 
== nxtFillEllipse ==
 
{| style="color:black;" width="100%" cellpadding="5%" cellspacing="0" border="0"
 
|-
 
| class="functionType"| <span class="bigKeywordBI">void </span><span class="bigKeywordB">nxtFillEllipse</span><span class="bigCodePunc">(</span><span class="bigKeywordBI">const int </span><span class="bigCodeBasic">Left</span><span class="bigCodePunc">, </span><span class="bigKeywordBI">const int </span><span class="bigCodeBasic">Top</span><span class="bigCodePunc">, </span><span class="bigKeywordBI">const int </span><span class="bigCodeBasic">Right</span><span class="bigCodePunc">, </span><span class="bigKeywordBI">const int </span><span class="bigCodeBasic">Bottom</span><span class="bigCodePunc">)</span>
 
|-
 
| style="font-family:Verdana, Geneva, sans-serif; color:black; background-color:#FFFFFF; text-align:left; font-size:100%;"|([[Data_Types#dataType_void|void]]) Fills (i.e. all pixels black) the ellipse with the specified coordinates.
 
|-
 
|
 
  {| class="parameterTable" cellpadding="5%" width="100%"
 
  ! width="20%" style="border-style: solid; border-width: 0px 0px 1px 0px"|Parameter
 
  ! width="60%" style="border-style: solid; border-width: 0px 0px 1px 0px"|Explanation
 
  ! width="20%" style="border-style: solid; border-width: 0px 0px 1px 0px"|Data Type
 
  |-
 
  | style="border-style: solid; border-width: 1px 0px 1px 0px"|''Left''
 
  | style="border-style: solid; border-width: 1px 0px 1px 0px"|The left-most point of the ellipse
 
  | style="border-style: solid; border-width: 1px 0px 1px 0px"|[[Data_Types#dataType_int|int]]
 
  |-
 
  | style="border-style: solid; border-width: 0px 0px 1px 0px"|''Top''
 
  | style="border-style: solid; border-width: 0px 0px 1px 0px"|The top-most point of the ellipse
 
  | style="border-style: solid; border-width: 0px 0px 1px 0px"|[[Data_Types#dataType_int|int]]
 
  |-
 
  | style="border-style: solid; border-width: 0px 0px 1px 0px"|''Right''
 
  | style="border-style: solid; border-width: 0px 0px 1px 0px"|The right-most point of the ellipse
 
  | style="border-style: solid; border-width: 0px 0px 1px 0px"|[[Data_Types#dataType_int|int]]
 
  |-
 
  | style="border-style: solid; border-width: 0px 0px 0px 0px"|''Bottom''
 
  | style="border-style: solid; border-width: 0px 0px 0px 0px"|The bottom-most point of the ellipse
 
  | style="border-style: solid; border-width: 0px 0px 0px 0px"|[[Data_Types#dataType_int|int]]
 
  |-
 
  |}
 
|-
 
|
 
  {|
 
  |-
 
  |<syntaxhighlight lang="ROBOTC">
 
nxtFillEllipse(20, 50, 60, 25);  // display a solid ellipse; left border at 20, top border at 50,
 
                                // right border at 60, bottom border at 25</syntaxhighlight>
 
  |-
 
  |}
 
|-
 
|}
 
<br />
 
 
== nxtFillRect ==
 
{| style="color:black;" width="100%" cellpadding="5%" cellspacing="0" border="0"
 
|-
 
| class="functionType"| <span class="bigKeywordBI">void </span><span class="bigKeywordB">nxtFillRect</span><span class="bigCodePunc">(</span><span class="bigKeywordBI">const int </span><span class="bigCodeBasic">Left</span><span class="bigCodePunc">, </span><span class="bigKeywordBI">const int </span><span class="bigCodeBasic">Top</span><span class="bigCodePunc">, </span><span class="bigKeywordBI">const int </span><span class="bigCodeBasic">Right</span><span class="bigCodePunc">, </span><span class="bigKeywordBI">const int </span><span class="bigCodeBasic">Bottom</span><span class="bigCodePunc">)</span>
 
|-
 
| style="font-family:Verdana, Geneva, sans-serif; color:black; background-color:#FFFFFF; text-align:left; font-size:100%;"|([[Data_Types#dataType_void|void]]) Fills (i.e. all pixels black) the rectangle with the specified coordinates.
 
|-
 
|
 
  {| class="parameterTable" cellpadding="5%" width="100%"
 
  ! width="20%" style="border-style: solid; border-width: 0px 0px 1px 0px"|Parameter
 
  ! width="60%" style="border-style: solid; border-width: 0px 0px 1px 0px"|Explanation
 
  ! width="20%" style="border-style: solid; border-width: 0px 0px 1px 0px"|Data Type
 
  |-
 
  | style="border-style: solid; border-width: 1px 0px 1px 0px"|''Left''
 
  | style="border-style: solid; border-width: 1px 0px 1px 0px"|The left-most point of the rectangle
 
  | style="border-style: solid; border-width: 1px 0px 1px 0px"|[[Data_Types#dataType_int|int]]
 
  |-
 
  | style="border-style: solid; border-width: 0px 0px 1px 0px"|''Top''
 
  | style="border-style: solid; border-width: 0px 0px 1px 0px"|The top-most point of the rectangle
 
  | style="border-style: solid; border-width: 0px 0px 1px 0px"|[[Data_Types#dataType_int|int]]
 
  |-
 
  | style="border-style: solid; border-width: 0px 0px 1px 0px"|''Right''
 
  | style="border-style: solid; border-width: 0px 0px 1px 0px"|The right-most point of the rectangle
 
  | style="border-style: solid; border-width: 0px 0px 1px 0px"|[[Data_Types#dataType_int|int]]
 
  |-
 
  | style="border-style: solid; border-width: 0px 0px 0px 0px"|''Bottom''
 
  | style="border-style: solid; border-width: 0px 0px 0px 0px"|The bottom-most point of the rectangle
 
  | style="border-style: solid; border-width: 0px 0px 0px 0px"|[[Data_Types#dataType_int|int]]
 
  |-
 
  |}
 
|-
 
|
 
  {|
 
  |-
 
  |<syntaxhighlight lang="ROBOTC">nxtFillRect(20, 50, 60, 25);  // display a solid rectangle; left border at 20, top border at 50,
 
                              // right border at 60, bottom border at 25</syntaxhighlight>
 
  |-
 
  |}
 
|-
 
|}
 
<br />
 
 
== nxtInvertLine ==
 
{| style="color:black;" width="100%" cellpadding="5%" cellspacing="0" border="0"
 
|-
 
| class="functionType"| <span class="bigKeywordBI">void </span><span class="bigKeywordB">nxtInvertLine</span><span class="bigCodePunc">(</span><span class="bigKeywordBI">const int </span><span class="bigCodeBasic">xPos</span><span class="bigCodePunc">, </span><span class="bigKeywordBI">const int </span><span class="bigCodeBasic">yPos</span><span class="bigCodePunc">, </span><span class="bigKeywordBI">const int </span><span class="bigCodeBasic">xPosTo</span><span class="bigCodePunc">, </span><span class="bigKeywordBI">const int </span><span class="bigCodeBasic">yPosTo</span><span class="bigCodePunc">)</span>
 
|-
 
| style="font-family:Verdana, Geneva, sans-serif; color:black; background-color:#FFFFFF; text-align:left; font-size:100%;"|([[Data_Types#dataType_void|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.
 
|-
 
|
 
  {| class="parameterTable" cellpadding="5%" width="100%"
 
  ! width="20%" style="border-style: solid; border-width: 0px 0px 1px 0px"|Parameter
 
  ! width="60%" style="border-style: solid; border-width: 0px 0px 1px 0px"|Explanation
 
  ! width="20%" style="border-style: solid; border-width: 0px 0px 1px 0px"|Data Type
 
  |-
 
  | style="border-style: solid; border-width: 1px 0px 1px 0px"|''xPos''
 
  | style="border-style: solid; border-width: 1px 0px 1px 0px"|The X-coordinate of the first point
 
  | style="border-style: solid; border-width: 1px 0px 1px 0px"|[[Data_Types#dataType_int|int]]
 
  |-
 
  | style="border-style: solid; border-width: 0px 0px 1px 0px"|''yPos''
 
  | style="border-style: solid; border-width: 0px 0px 1px 0px"|The Y-coordinate of the first point
 
  | style="border-style: solid; border-width: 0px 0px 1px 0px"|[[Data_Types#dataType_int|int]]
 
  |-
 
  | style="border-style: solid; border-width: 0px 0px 1px 0px"|''xPosTo''
 
  | style="border-style: solid; border-width: 0px 0px 1px 0px"|The X-coordinate of the second point
 
  | style="border-style: solid; border-width: 0px 0px 1px 0px"|[[Data_Types#dataType_int|int]]
 
  |-
 
  | style="border-style: solid; border-width: 0px 0px 0px 0px"|''yPosTo''
 
  | style="border-style: solid; border-width: 0px 0px 0px 0px"|The Y-coordinate of the second point
 
  | style="border-style: solid; border-width: 0px 0px 0px 0px"|[[Data_Types#dataType_int|int]]
 
  |-
 
  |}
 
|-
 
|
 
  {|
 
  |-
 
  |<syntaxhighlight lang="ROBOTC">nxtInvertLine(20, 50, 60, 25);  // invert the pixels on the line from (20,50) to (60,25)</syntaxhighlight>
 
  |-
 
  |}
 
|-
 
|}
 
<br />
 
 
== nxtScrollText ==
 
{| style="color:black;" width="100%" cellpadding="5%" cellspacing="0" border="0"
 
|-
 
| class="functionType"| <span class="bigKeywordBI">void </span><span class="bigKeywordB">nxtScrollText</span><span class="bigCodePunc">(</span><span class="bigKeywordBI">string </span><span class="bigCodeBasic">sFormatString</span><span class="bigCodePunc">, </span><span class="bigCodeBasic">...</span><span class="bigCodePunc">)</span>
 
|-
 
| style="font-family:Verdana, Geneva, sans-serif; color:black; background-color:#FFFFFF; text-align:left; font-size:100%;"|([[Data_Types#dataType_void|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.
 
|-
 
|
 
  {| class="parameterTable" cellpadding="5%" width="100%"
 
  ! width="20%" style="border-style: solid; border-width: 0px 0px 1px 0px"|Parameter
 
  ! width="60%" style="border-style: solid; border-width: 0px 0px 1px 0px"|Explanation
 
  ! width="20%" style="border-style: solid; border-width: 0px 0px 1px 0px"|Data Type
 
  |-
 
  | style="border-style: solid; border-width: 1px 0px 0px 0px"|''sFormatString''
 
  | style="border-style: solid; border-width: 1px 0px 0px 0px"|the string(s) to display<br />(can be formatted!)
 
  | style="border-style: solid; border-width: 1px 0px 0px 0px"|[[Data_Types#dataType_int|int]]
 
  |-
 
  |}
 
|-
 
|
 
  {|
 
  |-
 
  |<syntaxhighlight lang="ROBOTC">
 
for(i=0; i<1000; ++i)            // for Loop from 0 to 999 incrimenting 'i' by 1 each time:
 
{
 
  nxtScrollText("Scroll #%d.", i);  // display "Scroll #i." (%d is replaced with variable 'i' at runtime)
 
  wait1Msec(250);                  // wait 520 milliseconds between each iteration of the For Loop
 
}</syntaxhighlight>
 
  |-
 
  |}
 
|-
 
|}
 
<br />
 
  
 
== nxtSetPixel ==
 
== nxtSetPixel ==

Revision as of 19:57, 10 February 2012

Main >> CORTEX >> Functions and Variables >> Display


For information about ROBOTC string, please see the article: Strings.


Color Key
Function:
Variable:


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 bottom left corner is point (0, 0) and the top right corner of the display is point (99, 63).
  • There are eight text lines numbers 0 to 7. 0 is the top line and 7 is the bottom line of the display.
Specifier Output Example Code Example Output
%d or %i Signed decimal integer "%d" 4246
%e Scientific notation (mantise/exponent) using e character "%e" 3.9265e+2
%E Scientific notation (mantise/exponent) using E character "%E" 3.9265E+2
%f Decimal floating point number "%f" 3.14159
%o Signed octal "%o" 157
%s String of characters "%s" ROBOTC
%x Unsigned hexadecimal integer "%x" 7fa
%X Unsigned hexadecimal integer (capital letters) "%X" 7FA
%c Character "%c" b


NOTE on Displaying Digits: When displaying floats, for example, you can tell ROBOTC how many decimals places to display. This is standard across all 'C' - like programing languages. For example, if your float is PI (3.14159265), but you only want to dispay "3.14", your string should contain, "%1.2f".

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.


The tag can also contain flags, width, .precision and modifiers sub-specifiers, which are optional and follow these specifications:

Specifier Description Example Output
%d Prints a decimial integer 50
%6d Prints a decimal integer, at least 6 characters wide _ _ _ _ 50
%f Prints a floating point number 50.5
%6f Prints a floating point number, at least 6 characters wide _ _ _ 50.5
%.2f Prints a floating point number, with at least 2 decimal places 50.50
%6.2f Prints a floating point number, with at least 6 characters wide and 2 decimal places __ 50.50

Note: Underscore ( _ ) character denotes a space.



nxtSetPixel

void nxtSetPixel(const int xPos, const int yPos)
(void) Sets a single pixel on the NXT LCD screen.
Parameter Explanation Data Type
xPos X-coordinate of pixel int
yPos Y-coordinate of pixel int
nxtSetPixel(42, 46);  // "set" a pixel (make it black) at position (42,46)