Screen#

Introduction#

The Screen blocks control the V5 Brain’s touchscreen, allowing your robot to show text, numbers, and graphics, and respond to touch input.

By default, the font for printing to the Brain is monospaced small which has 12 rows and 48 columns.

For drawing, the Brain’s resolution is 479 x 239 pixels.

A labeled grid diagram of the VEX Brain screen showing rows, columns, pixel dimensions, and coordinates, with red lines outlining the grid.

Below is a list of available blocks:

Cursor Print – Display text and manage the print cursor.

Settings – Change the appearance of text and graphics.

Draw – Create shapes, lines, and graphics on the Brain screen.

Touch – Detect touch input on the Brain’s screen.

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

  • screen position – Reports the X coordinate of a touch.

  • when screen – Runs attached blocks when the screen is pressed or released.

Cursor Print#

set cursor to row column on screen#

When using the set cursor to row column on screen block, the cursor is placed at a specific row and column on the screen. How many rows and columns can comfortably fit depends on the selected font. With the default monospaced medium font, up to 8 rows and 13 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 on screen block.

Set cursor stack block#
Coloque el cursor en la fila [1] columna [1] en la pantalla

Parameters

Description

row

The row of the cursor.

column

The column of the cursor.

Example

When started, moves the cursor to row 3, column 2 on the screen and prints ‘Row 3, Column 2’.#
cuando empezó
[Display text starting at Row 3 Column 12.]
Coloque el cursor en la fila [3] columna [12] en la pantalla
imprimir [Row 3, Column 12] en la pantalla ▶

A screenshot of the V5 Brain showing "Row 3 Column 12" printed on the screen.

set cursor to next row on screen#

The set cursor to next row on screen block moves the cursor to column 1 on the next row on the robot’s screen.

set cursor to next row stack block#
Colocar el cursor en la siguiente fila de la pantalla

Parameters

Description

This block has no parameters.

Example

When started, prints ‘Line 1’ on the screen, moves the cursor to the next row, and then prints ‘Line 2’.#
cuando empezó
[Display two lines of text.]
imprimir [Line 1] en la pantalla ▶
Colocar el cursor en la siguiente fila de la pantalla
imprimir [Line 2] en la pantalla ▶

A screenshot of the V5 Brain showing the text "Line 1" printed above "Line 2".

clear row on screen#

The clear row on screen block clears a row of text on the robot’s screen.

Clear row stack block#
Limpiar la fila [1] de la pantalla

Parameters

Description

row

The row number to clear.

Example

When started, prints text on two rows. The first row remains, while the second row disappears after 3 seconds.#
cuando empezó
[Display text on two rows.]
imprimir [This text stays] en la pantalla ▶
Colocar el cursor en la siguiente fila de la pantalla
imprimir [This text disappears] en la pantalla ▶
esperar [3] segundos
Limpiar la fila [2] de la pantalla

screen cursor column#

The screen cursor column block returns the column number where text will be printed as an integer.

screen cursor column reporter block#
(columna del cursor de la pantalla)

Parameters

Description

This block has no parameters.

Example

When started, moves the cursor to row 3, column 2 on the screen and prints the current cursor column number.#
cuando empezó
[Display the cursor's current column.]
Coloque el cursor en la fila [3] columna [15] en la pantalla
imprimir (columna del cursor de la pantalla) en la pantalla ▶

A screenshot of the V5 Brain showing the text "15" on column 15.

screen cursor row#

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

screen cursor row reporter block#
(fila del cursor de la pantalla)

Parameters

Description

This block has no parameters.

Example

When started, moves the cursor to row 6, column 2 on the screen and prints the current cursor row number.#
cuando empezó
[Display the cursor's current row.]
Coloque el cursor en la fila [3] columna [2] en la pantalla
imprimir (fila del cursor de la pantalla) en la pantalla ▶

A screenshot of the V5 Brain showing the text "3" on row 3.

Settings#

clear screen#

The clear screen block clears all drawings and text from the robot’s screen.

clear screen block#
pantalla clara

Parameters

Description

This block has no parameters.

Example

When started, draws a circle with center (120,120) and radius 40 pixels. After 2 seconds, the screen is cleared.#
cuando empezó
[Draw a circle, and clear it after 2 seconds.]
dibuja el círculo [120] [120] [40] en la pantalla
esperar [2] segundos
pantalla clara

set font on screen#

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

set font stack block#
Establezca la fuente en [monoespaciado v] [medio v] en la pantalla

Parameters

Description

style

The font style:

  • monospaced
  • proportional

size

The font size (examples below):

  • extra small
  • small
  • medium
  • large
  • extra large
  • super large
Note: Extra small and small sizes are not available for proportional fonts.

The robot screen printed numbers and letters with MONO 12 font. It shows A-Z. On the bottom of the screen, it is 26 across and 15 rows.
monospaced extra small

The robot screen printed numbers and letters with MONO 15 font. It shows A-T. On the bottom of the screen, it is 20 across and 12 rows.
monospaced small

The robot screen printed numbers and letters with MONO 20 font. It shows A-P. On the bottom of the screen, it is 16 across and 9 rows.
monospaced medium

The robot screen printed numbers and letters with MONO 30 font. It shows A-K. On the bottom of the screen, it is 11 across and 6 rows.
monospaced large

The robot screen printed numbers and letters with MONO 40 font. It shows A-K. On the bottom of the screen, it is 8 across and 5 rows.
monospaced extra large

The robot screen printed numbers and letters with MONO 60 font. It shows 1-6. On the bottom of the screen, it is 3 rows.
monospaced super large

The robot screen printed numbers and letters with PROP 20 font. It shows A-S. On the bottom of the screen, it is 8 across and 9 rows.
proportional medium

The robot screen printed numbers and letters with PROP 30 font. It shows A-M. On the bottom of the screen, it is 15 across and 6 rows.
proportional large

The robot screen printed numbers and letters with PROP 40 font. It shows A-M. On the bottom of the screen, it is 15 across and 6 rows.
proportional extra large

The robot screen printed numbers and letters with PROP 60 font. It shows 1-7. On the bottom of the screen, it is 7 across and 3 rows.
proportional super large

Example

When started, sets the font to ‘monospaced extra large’ and prints ‘VEX’ on the screen.#
cuando empezó
[Display text using a larger font]
Establezca la fuente en [monoespaciado v] [extra grande v] en la pantalla
imprimir [VEX] en la pantalla ▶

A screenshot of the V5 Brain showing the text "VEX" in larger font than the default.

set print precision on screen#

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

set print precision stack block#
Establezca la precisión de impresión en [0.1 v] en la pantalla

Parameters

Description

precision

Sets the print precision to:

  • 1
  • 0.1
  • 0.01
  • 0.001
  • All Digits

Example

When started, sets print precision to two decimal places and prints 1/3 as 0.33 on the screen.#
cuando empezó
[Print 1/3 as 0.33.]
Establezca la precisión de impresión en [0.01 v] en la pantalla
imprimir ([1] [math_division v] [3]) en la pantalla ▶

A screenshot of the V5 Brain showing the text "0.33".

set pen width on screen#

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

set pen width block#
Establezca el ancho del lápiz en [10] en la pantalla

Parameters

Description

width

The pen width in pixels in a range from 0 to 32.

Example

When started, sets the pen width to 10 pixels and draws a rectangle with the top-left corner at (50,50), width 130 pixels, and height 60 pixels.#
cuando empezó
[Draw a rectangle with a pen width of 10.]
Establezca el ancho del lápiz en [10] en la pantalla
dibuja el rectángulo [50] [50] [130] [60] en la pantalla

A screenshot of the V5 Brain showing a rectangle with thick borders.

set pen / font color on screen#

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

set pen font color#
Establezca el color del lápiz/fuente en [rojo v] en la pantalla

Parameters

Description

color

Sets the pen color to:

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

Example

When started, sets the pen color to orange and draws a rectangle with the top-left corner at (50, 50), width 130 pixels, and height 60 pixels.#
cuando empezó
[Draw a rectangle with orange borders.]
Establezca el color del lápiz/fuente en [naranja v] en la pantalla
dibuja el rectángulo [50] [50] [130] [60] en la pantalla

A screenshot of the V5 Brain showing a rectangle with orange borders.

set fill color on screen#

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

set fill color stack block#
Establezca el color de relleno en [rojo v] en la pantalla

Parameters

Description

color

Sets the fill color to:

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

Examples

When started, sets the fill color to purple and draws a rectangle. It is at (50, 130) with a width of 100 pixels and a height of 60 pixels.#
cuando empezó
[Draw a purple rectangle.]
Establezca el color de relleno en [púrpura v] en la pantalla
dibuja el rectángulo [50] [130] [100] [60] en la pantalla

A screenshot of the V5 Brain showing a rectangle filled with purple.

Draw#

draw pixel on screen#

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

draw pixel stack block#
Dibuja el píxel [0] [0] en la pantalla

Parameters

Description

x

The x-coordinate to draw the pixel from 0 to 479.

y

The y-coordinate to draw the pixel from 0 to 239.

Example

When started, draws a pixel at the center of the screen at coordinates (120, 120).#
cuando empezó
[Draw the pixels marking the corners of a square.]
Dibuja el píxel [250] [100] en la pantalla
Dibuja el píxel [275] [100] en la pantalla
Dibuja el píxel [250] [125] en la pantalla
Dibuja el píxel [275] [125] en la pantalla

A screenshot of the V5 Brain showing an assortment of pixels showing the corners of a square.

draw line on screen#

The draw line on screen 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#
dibuja la línea [0] [0] [10] [10] en la pantalla

Parameters

Description

x1

The x-coordinate in pixels of the start of the line from 0 to 479.

y1

The y-coordinate in pixels of the start of the line from 0 to 239.

x2

The x-coordinate in pixels of the end of the line from 0 to 479.

y2

The y-coordinate in pixels of the end of the line from 0 to 239.

Example

When started, draws a diagonal line from the top-left corner (0,0) to the bottom-right corner (240,240) of the screen.#
cuando empezó
[Draw a line from the top left to bottom right of the screen.]
dibuja la línea [0] [0] [479] [239] en la pantalla

The screen shows a thin diagonal line across the center, from the upper left corner to the lower right corner.

draw rectangle on screen#

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

draw rectangle block#
dibuja el rectángulo [0] [0] [10] [10] en la pantalla

Parameters

Description

x

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

y

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

width

The width of the rectangle in pixels.

height

The height of the rectangle in pixels.

Example

When started, draws a rectangle on the screen with the top-left corner at (50,50), width of 130 pixels, and height of 60 pixels.#
cuando empezó
[Draw a rectangle on the screen.]
dibuja el rectángulo [50] [50] [130] [60] en la pantalla

The robot’s screen shows a rectangle with a thin white border on the screen.

draw circle on screen#

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

draw circle stack block#
dibuja el círculo [0] [0] [10] en la pantalla

Parameters

Description

x

The x-coordinate in pixels of the center of the circle from 0 to 479.

y

The y-coordinate in pixels of the center of the circle from 0 to 239.

radius

The radius of the circle in pixels.

Example

When started, draws a circle on the screen with the center at (120,120) and a radius of 40 pixels.#
cuando empezó
[Draw a circle on the screen.]
dibuja el círculo [120] [120] [40] en la pantalla

The robot’s screen shows a circle with a thin white border drawn in the center.

Touch#

screen pressed?#

The screen pressed? block returns a Boolean indicating whether the Brain’s touchscreen is currently being pressed.

  • True – The screen is being pressed.

  • False – The screen is not being pressed.

draw circle stack block#
<¿pantalla presionada?>

Parameters

Description

This block has no parameters.

When started, draws a circle on the screen with the center at (120,120) and a radius of 40 pixels.#
cuando empezó
[Change the screen's color after it's pressed.]
esperar hasta <¿pantalla presionada?>
Establezca el color de relleno en [verde v] en la pantalla
dibuja el rectángulo [0] [0] [479] [239] en la pantalla

screen position#

The screen position block returns the x or y coordinate of the location where the Brain’s touchscreen was last pressed.

draw circle stack block#
(posición de pantalla [incógnita v])

Parameters

Description

axis

Which axis to return the position of:

  • x – 0 to 479
  • y – 0 to 239

When started, draws a circle on the screen with the center at (120,120) and a radius of 40 pixels.#
cuando empezó
[Display a circle where the screen is pressed.]
esperar hasta <¿pantalla presionada?>
Establezca el color de relleno en [blanco v] en la pantalla
dibuja el círculo (posición de pantalla [incógnita v]) (posición de pantalla [y v]) [20] en la pantalla

when screen#

The when screen block runs the attached stack of blocks when the Brain screen is pressed or released.

draw circle stack block#
cuando la pantalla cerebral [presionado v] :: hat events

Parameters

Description

state

When to run the attached stack of blocks:

  • pressed
  • released

When started, draws a circle on the screen with the center at (120,120) and a radius of 40 pixels.#
cuando la pantalla cerebral [presionado v] :: hat events
[Color the screen with polka dots by pressing it repeatedly.]
Establezca el color de relleno en [rojo v] en la pantalla
dibuja el círculo (posición de pantalla [incógnita v]) (posición de pantalla [y v]) [20] en la pantalla