Screen#

Introduction#

The VEX AIR Controller’s screen provides blocks for displaying text, managing the cursor, drawing shapes, and handling touch interactions.

Below is a list of all available blocks, grouped by functionality:

Cursor Print - Manage text display using a row-and-column cursor system.

XY Print - Print text at pixel-based coordinates.

  • print at – Displays text at a specified x and y coordinate.

  • set screen origin – Changes the origin (0, 0) used for drawing and printing.

Settings - Customize text formatting and screen display.

Draw - Create graphics and visual elements.

Touch - Detect screen interactions.

  • screen pressed? – Returns whether the screen is currently being pressed.

  • screen position – Retrieves the x and y coordinates where the screen was last touched.

  • when screen event – Triggers when the screen is pressed or released.

Cursor Print#

print#

The print block displays text on the controller’s print area at the current cursor position and font.

print stack block#
    print [VEXcode] on screen ▶

Parameters

Description

value

The text, number, or variable value to display on the screen.

expanding arrow

Expand the block to read and set cursor to next row and make the cursor move to the next row after this block.

Example

Example coming soon!

set cursor to row column#

When using the set cursor to row column block, the cursor is placed at a specific row and column on the print area. How many rows and columns can comfortably fit depends on the selected font. With the default monospaced medium font, up to 11 rows and 53 columns can be displayed clearly. Text placed beyond this range may be cut off or become difficult to read.

Monospaced fonts have characters that are all the same width, making text placement consistent. In contrast, proportional fonts vary in character width, so some letters take up more space than others. However, regardless of which type is used, the set cursor to row column block positions the cursor based on row and column size, not font style. The font size can be adjusted using the set font block.

Set cursor stack block#
    set cursor to row [1] column [1] on screen

Parameters

Description

row

The row of the cursor.

column

The column of the cursor.

Examples

Example coming soon!

set cursor to next row#

The set cursor to next row block moves the cursor to column 1 on the next row on the controller’s print area.

set cursor to next row stack block#
    set cursor to next row on screen

Parameters

Description

This block has no parameters.

Example

Example coming soon!

clear row#

The clear row block clears a row of text on the controller’s print area.

Clear row stack block#
    clear row [1] on screen

Parameters

Description

row

The row number to clear.

Example

Example coming soon!

screen cursor column#

The screen cursor column returns the value of the column where text will be printed as an integer.

screen cursor column reporter block#
    (screen cursor column)

Parameters

Description

This block has no parameters.

Example

Example coming soon!

screen cursor row#

The screen cursor row block returns the value of the row where text will be printed as an integer.

screen cursor row reporter block#
    (screen cursor row)

Parameters

Description

This block has no parameters.

Example

Example coming soon!

XY Print#

set screen origin#

The set screen origin sets the origin (0, 0) used for drawing or printing on the controller’s print area. By default, drawing or printing blocks consider the top left corner of the screen as the origin. This block can reset the origin to an alternate (x, y) screen coordinate location.

set screen origin stack block#
    set screen origin x: [0] y: [0]

Parameters

Description

x

The x-coordinate in pixels to set the new origin to.

y

The y-coordinate in pixels to set the new origin to.

Example

Example coming soon!

Settings#

clear screen#

The clear screen block clears the controller’s print area of all drawings and text.

clear screen block#
    clear screen

Parameters

Description

This block has no parameters.

Example

Example coming soon!

wait for screen to render#

The wait for screen to render block prevents any following blocks from running until all previous drawing and print commands on the screen have finished rendering.

    wait for screen to render

Parameters

Description

This block has no parameters.

Example

Example coming soon!

fill screen#

The fill screen block clears the controller’s print area of all drawings and text, then changes the background to a specified color.

The fill screen block#
    fill screen with [red v]

Parameters

Description

color

The color to change the background to:

  • red
  • green
  • blue
  • black
  • white
  • yellow
  • orange
  • purple
  • cyan

Example

Example coming soon!

set font#

The set font block sets the font and size used for displaying text on the controller’s print area. This font will apply to all subsequently printed text.

set font stack block#
    set font to [monospaced v] [super small v] on screen

Parameters

Description

type

The font type:

  • monospaced
  • proportional

size

The font size (shown below):

  • super small
  • extra small
  • small
  • medium
  • large
  • extra large
  • super large

The controller screen printed numbers and letters with MONO 12 font. On the bottom of the screen, it is 90 across and 37 rows.
monospaced super small

The controller screen printed numbers and letters with MONO 15 font. On the bottom of the screen, it is 70 across and 28 rows.
monospaced extra small

The controller screen printed numbers and letters with MONO 20 font. On the bottom of the screen, it is 52 across and 22 rows.
monospaced small

The controller screen printed numbers and letters with MONO 24 font. On the bottom of the screen, it is 44 across and 18 rows.
monospaced medium

The controller screen printed numbers and letters with MONO 30 font. On the bottom of the screen, it is 34 across and 14 rows.
monospaced large

The controller screen printed numbers and letters with MONO 40 font. On the bottom of the screen, it is 25 across and 11 rows.
monospaced extra large

The controller screen printed numbers and letters with MONO 60 font. On the bottom of the screen, it is 16 across and 7 rows.
monospaced super large

The controller screen printed numbers and letters with PROP 20 font. On the bottom of the screen, it is 58 across and 22 rows.
proportional small

The controller screen printed numbers and letters with PROP 24 font. On the bottom of the screen, it is 45 across and 18 rows.
proportional medium

The controller screen printed numbers and letters with PROP 30 font. On the bottom of the screen, it is 37 across and 14 rows.
proportional large

The controller screen printed numbers and letters with PROP 40 font. On the bottom of the screen, it is 28 across and 11 rows.
proportional extra large

The controller screen printed numbers and letters with PROP 60 font. On the bottom of the screen, it is 19 across and 7 rows.
proportional super large

Example

Example coming soon!

set print precision#

The set print precision block sets the precision formatting used for displaying numbers on the controller’s print area. This print precision will apply to all subsequently printed numbers.

Documentation Coming Soon

set pen width#

The set pen width block sets the pen width used for drawing lines and shapes.

set pen width block#
    set pen width to [10] on screen

Parameters

Description

width

The pen width in pixels.

Example

Example coming soon!

set pen / font color#

The set pen / font color block sets the pen color used for drawing lines, shapes, and text on the controller’s print area.

set pen font color#
    set pen / font color to [red v] on screen

Example

Parameters

Description

color

Sets the pen color to:

  • red
  • green
  • blue
  • black
  • white
  • yellow
  • orange
  • purple
  • cyan
  • transparent

Example coming soon!

set fill color#

The set fill color block sets the fill color used when shapes are drawn.

set fill color stack block#
    set fill color to [red v] on screen

Parameters

Description

color

Sets the fill color to:

  • red
  • green
  • blue
  • black
  • white
  • yellow
  • orange
  • purple
  • cyan
  • transparent

Examples

Example coming soon!

Draw#

show image file#

The show image file block draws a custom user-uploaded image on the controller’s print area.

show user image stack block#
    show image file [1 v]

Parameters

Description

image slot number

The custom image to use, number 1 to 10. The image number aligns with the number shown in the AIR control panel.

Example

Example coming soon!

draw pixel#

The draw pixel block draws a pixel at the specified (x, y) screen coordinate in the current pen color.

draw pixel stack block#
    draw pixel [0] [0] on screen

Parameters

Description

x

The x-coordinate to draw the pixel, ranging from 0 to 640.

y

The y-coordinate to draw the pixel, ranging from 0 to 480.

Example

Example coming soon!

draw line#

The draw line block draws a line from the first specified screen coordinate (x1, y1) to the second specified screen coordinate (x2, y2) using the current pen width and pen color.

draw line stack block#
    draw line [0] [0] [10] [10] on screen

Parameters

Description

x1

The x-coordinate in pixels of the start of the line, ranging from 0 to 640.

y1

The y-coordinate in pixels of the start of the line, ranging from 0 to 480.

x2

The x-coordinate in pixels of the end of the line, ranging from 0 to 640.

y2

The y-coordinate in pixels of the end of the line, ranging from 0 to 480.

Example

Example coming soon!

draw rectangle#

The draw rectangle block draws a rectangle using the current pen width, pen color, and fill colors.

draw rectangle block#
    draw rectangle [0] [0] [10] [10] on screen

Example

Parameters

Description

x

The x-coordinate in pixels of the top-left corner of the rectangle, ranging from 0 to 640.

y

The y-coordinate in pixels of the top-left corner of the rectangle, ranging from 0 to 480.

width

The width of the rectangle in pixels, ranging from 0 to 640.

height

The height of the rectangle in pixels, ranging from 0 to 480.

Example coming soon!

draw circle#

The draw circle block draws a circle using the current pen width, pen color, and fill colors.

draw circle stack block#
    draw circle [0] [0] [10] on screen

Parameters

Description

x

The x-coordinate in pixels of the center of the circle, ranging from 0 to 640.

y

The y-coordinate in pixels of the center of the circle, ranging from 0 to 480.

radius

The radius of the circle in pixels, ranging from 0 to 480.

Example

Example coming soon!

Touch#

screen pressed?#

The screen pressed? block reports if the controller’s screen is currently being pressed or not pressed. This block returns a Boolean value:

  • True - Screen is currently being pressed

  • False - Screen is not being pressed

screen pressed boolean block#
    <screen pressed?>

Parameters

Description

This block has no parameters.

Example

Example coming soon!

screen position#

The screen position block returns an integer showing the x- and y-coordinate (in pixels) where the screen was pressed. The return value for x is between 0 (left) and 640 (right). The return value for y is between 0 (top) and 480 (bottom).

A VEX AIR Controller is turned on and facing forward. The dimensions of the screen are listed on the edges of a highlighted red box on the border of the screen. The top left is (0, 0), the top right is (640, 0), the bottom left is (0, 480), the bottom right is (640, 480), and the center is (320, 240).

screen position reporter block#
    (screen [x v] position)

Parameters

Description

coordinate

The coordinate of the last screen press in pixels:

  • x - The horizontal position
  • y - The vertical position

Example

Example coming soon!

when screen event#

The when screen event block is to be called when the controller’s screen is pressed or is no longer being pressed.

When screen event hat block#
    when screen [pressed v] :: hat events

Parameters

Description

action

Determines when the attached stack of blocks will execute:

  • pressed
  • released

Example

Example coming soon!