Pantalla#

Introducción#

The Screen blocks control how the VEX AIM Coding Robot shows text, numbers, and graphics on its screen, and how it responds to screen presses.

A continuación se muestra una lista de todos los bloques:

Impresión con cursor: Gestiona la visualización del texto mediante un sistema de cursor por filas y columnas.

Impresión XY: Imprime texto en coordenadas basadas en píxeles.

Ajustes: Personaliza el formato del texto y la visualización en pantalla.

Dibujar: crear gráficos y elementos visuales.

Tocar: Detecta las interacciones con la pantalla.

  • screen pressed — Reports whether the screen is currently being pressed.

  • screen position — Reports the selected x or y coordinate of the last screen press.

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

Cursor Imprimir#

Colocar el cursor en la fila o columna de la pantalla.#

The set cursor to row column on screen stack block moves the cursor to a specific row and column on the robot’s screen. The next print on screen block will start printing at that location. 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 on screen stack 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 stack block.

Establecer bloque de pila de cursor#
set cursor to row [1] column [1] on screen

Parámetros

Descripción

fila

The row to move the cursor to.

columna

The column to move the cursor to.

Ejemplos

Al iniciarse, mueve el cursor a la fila 3, columna 2 en la pantalla e imprime ‘Fila 3, columna 2’.#
when started
[Display text starting at Row 3 Column 2.]
set cursor to row (3) column (2) on screen
print [Row 3, Column 2] on screen ▶

Captura de pantalla de la pantalla del robot, con la fila 3, columna 2 impresa en blanco justo encima del centro de la pantalla, comenzando en la fila 3, columna 2.

when started
[Display cargo amounts in an organized list.]
set font to [proportional v] [large v] on screen
print [Sports Balls] on screen ◀ and set cursor to next row
print [Orange Barrels] on screen ◀ and set cursor to next row
print [Blue Barrels] on screen ▶
set cursor to row [1] column [11] on screen
print [2] on screen ▶
set cursor to row [2] column [11] on screen
print [3] on screen ▶
set cursor to row [3] column [11] on screen
print [3] on screen ▶

Una captura de pantalla de la pantalla del robot muestra tres líneas de texto blanco que enumeran Pelotas Deportivas 2, Barriles Naranjas 3 y Barriles Azules 3. Los números están alineados a la derecha de cada etiqueta, y la lista comienza en la parte superior de la pantalla.

when started
[Display the ID of the detected AprilTag.]
set font to [proportional v] [extra large v] on screen
forever
clear screen
print [AprilTag] on screen ▶
get [all AprilTags v] data from AI Vision
if <AI Vision object exists?> then
set cursor to row [3] column [4] on screen
print (AI Vision object [tagID v]) on screen ▶
fin
wait [0.1] seconds

Captura de pantalla de la pantalla del robot con texto blanco impreso cerca del centro, que dice AprilTag en la primera línea y 4 en la segunda línea.

Colocar el cursor en la siguiente fila de la pantalla.#

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

establece el cursor en el siguiente bloque de pila de fila#
set cursor to next row on screen

Parámetros

Descripción

Este bloque no tiene parámetros.

Ejemplo

Cuando se inicia, imprime ‘Línea 1’ en la pantalla, mueve el cursor a la siguiente fila y luego imprime ‘Línea 2’.#
when started
[Display two lines of text.]
print [Line 1] on screen ▶
set cursor to next row on screen
print [Line 2] on screen ▶

Captura de pantalla de la pantalla del robot con texto blanco. La pantalla muestra la Línea 1 en la línea superior, alineada a la izquierda, y la Línea 2 justo debajo.

Borrar fila en la pantalla#

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

Borrar bloque de pila de filas#
clear row [1] on screen

Parámetros

Descripción

fila

El número de fila a borrar.

Ejemplo

Al iniciarse, imprime texto en dos filas. La primera fila permanece, mientras que la segunda desaparece después de 3 segundos.#
when started
[Display text on two rows.]
print [This text stays] on screen ▶
set cursor to next row on screen
print [This text disappears] on screen ▶
wait [3] seconds
clear row [2] on screen

columna del cursor de la pantalla#

The screen cursor column reporter block reports the column number where text will be printed as a whole number.

bloque de reportero de columna de cursor de pantalla#
(screen cursor column)

Parámetros

Descripción

Este bloque no tiene parámetros.

Ejemplo

Cuando se inicia, mueve el cursor a la fila 3, columna 2 de la pantalla e imprime el número de columna del cursor actual.#
when started
[Display the cursor's current column.]
set cursor to row [3] column [2] on screen
print (screen cursor column) on screen ▶

Captura de pantalla de la pantalla del robot, con un 2 blanco impreso cerca del centro del cuadrante superior izquierdo, en la fila 3, columna 2.

fila del cursor de la pantalla#

The screen cursor row reporter block reports the row number where text will be printed as a whole number.

bloque de reportero de filas del cursor de pantalla#
(screen cursor row)

Parámetros

Descripción

Este bloque no tiene parámetros.

Ejemplo

Cuando se inicia, mueve el cursor a la fila 6, columna 2 de la pantalla e imprime el número de fila actual del cursor.#
when started
[Display the cursor's current row.]
set cursor to row [3] column [2] on screen
print (screen cursor row) on screen ▶

Captura de pantalla de la pantalla del robot, con un 3 blanco impreso cerca del centro del cuadrante superior izquierdo, en la fila 3, columna 2.

Impresión XY#

establecer el origen de la pantalla#

The set screen origin stack block changes the origin (0, 0) used for drawing or printing on the robot’s screen. By default, the origin is the top-left corner of the screen. This block can reset the origin to an alternate (x, y) screen coordinate location.

Establecer bloque de pila de origen de pantalla#
set screen origin x:[0] y:[0]

Parámetros

Descripción

incógnita

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

y

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

Ejemplo

Cuando se inicia, establece el origen de la pantalla en (120, 120) y dibuja un rectángulo en el nuevo origen con la esquina superior izquierda en (0,0), ancho de 80 píxeles y alto de 40 píxeles.#
when started
[Set the origin to the center of the screen.]
set screen origin x:[120] y:[120]
[Draw a rectangle at the new origin.]
draw rectangle [0] [0] [80] [40] on screen

Captura de pantalla de la pantalla del robot con un rectángulo blanco dibujado en el cuadrante inferior izquierdo. La esquina superior izquierda del rectángulo es el centro de la pantalla.

Ajustes#

pantalla clara#

The clear screen stack block clears all drawings and text from the robot’s screen and resets the cursor position to row 1, column 1.

clear screen stack block#
clear screen

Parámetros

Descripción

Este bloque no tiene parámetros.

Ejemplo

Al iniciarse, dibuja un círculo con centro (120,120) y radio de 40 píxeles. Después de 2 segundos, la pantalla se borra.#
when started
[Draw a circle, and clear it after 2 seconds.]
draw circle [120] [120] [40] on screen
wait [2] seconds
clear screen

llenar la pantalla#

The fill screen stack block clears all drawings and text from the robot’s screen, then changes the background to a specified color.

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

Parámetros

Descripción

color

The background color to use:

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

Ejemplo

when started
[Say "Hello" then turn screen yellow.]
print [Hello] on screen ▶
wait [2] seconds
fill screen with [yellow v]

establecer fuente en pantalla#

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

establecer bloque de pila de fuentes#
set font to [monospaced v] [super small v] on screen

Parámetros

Descripción

tipo

The font type: monospaced or proportional

tamaño

The font size (shown below):

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

Captura de pantalla de la pantalla del robot que muestra una muestra de números y letras impresos en fuente Mono 12. El alfabeto ocupa 1 fila de texto. En la parte inferior se leen 26 caracteres de ancho y 15 filas.
monoespaciado súper pequeño

La misma imagen que la anterior, con fuente Mono 15. Las letras AT abarcan 1 fila de texto. La parte inferior muestra 20 caracteres de ancho y 12 filas.
monoespaciada extra pequeña

La misma imagen que la anterior, con fuente Mono 20. Las letras AP abarcan 1 fila de texto. En la parte inferior se leen 16 caracteres de ancho y 9 filas.
monoespaciada pequeña

La misma imagen que la anterior, con fuente Mono 24. Las letras AM abarcan 1 fila de texto. En la parte inferior se leen 13 caracteres de ancho y 8 filas.
monoespaciado medio

Misma imagen que la anterior, con fuente Mono 30. Las letras AK abarcan 1 fila de texto. La parte inferior muestra 11 caracteres de ancho y 6 filas.
monoespaciada grande

Misma imagen que la anterior, con fuente Mono 40. Las letras AH abarcan 1 fila de texto. La parte inferior muestra 8 caracteres de ancho y 5 filas.
monoespaciada extra grande

Misma imagen que la anterior, con fuente Mono 60. Los números del 1 al 6 abarcan 1 fila de texto. En la parte inferior se leen 3 filas.
monoespaciada súper grande

Misma imagen que la anterior, con fuente Prop 20. Las letras A abarcan 1 fila de texto. En la parte inferior se leen 20 caracteres de ancho y 9 filas.
proporcional pequeño

Misma imagen que la anterior, con la fuente Prop 30. Las letras AM abarcan 1 fila de texto. La parte inferior muestra 15 caracteres de ancho y 6 filas.
proporcional grande

Misma imagen que la anterior, con la fuente Prop 40. Las letras AJ abarcan 1 fila de texto. En la parte inferior se leen 11 caracteres de ancho y 5 filas.
extra grande proporcional

Captura de pantalla de la pantalla del robot que muestra una muestra de números impresos en la fuente Prop 60. Los números del 1 al 7 abarcan 1 fila de texto. En la parte inferior se lee 7 por 3.
proporcional súper grande

Ejemplo

Cuando se inicia, establece la fuente en ‘monoespaciado extra grande’ e imprime ‘VEX’ en la pantalla.#
when started
[Display text using a larger font]
set font to [monospaced v] [extra large v] on screen
print [VEX] on screen ▶

Una captura de pantalla de la pantalla del robot muestra la palabra VEX en fuente Mono 40 impresa en blanco en la esquina superior izquierda.

Ajustar la precisión de impresión en pantalla#

The set print precision on screen stack block sets how many decimal places to show when printing numbers on the robot’s screen. This print precision will apply to all subsequently printed numbers.

Establecer bloque de pila de precisión de impresión#
set print precision to [0.1 v] on screen

Parámetros

Descripción

precisión

The print precision to use:

  • 1
  • 0.1
  • 0.01
  • 0.001
  • All Digits

Ejemplo

Cuando se inicia, establece la precisión de impresión en dos decimales e imprime 1/3 como 0,33 en la pantalla.#
when started
[Print 1/3 as 0.33.]
set print precision to [0.01 v] on screen
print ([1] [math_division v] [3]) on screen ▶

Una captura de pantalla de la pantalla del robot muestra 0.33 en blanco en la esquina superior izquierda.

Ajustar el ancho del lápiz en la pantalla#

The set pen width on screen stack block sets the thickness of drawn lines and shape outlines.

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

Parámetros

Descripción

ancho

The pen width, in pixels, from 0 to 32.

Ejemplo

Cuando se inicia, establece el ancho del lápiz en 10 píxeles y dibuja un rectángulo con la esquina superior izquierda en (50,50), ancho de 130 píxeles y alto de 60 píxeles.#
when started
[Draw a rectangle with a pen width of 10.]
set pen width to [10] on screen
draw rectangle [50] [50] [130] [60] on screen

Captura de pantalla de la pantalla del robot con un grueso rectángulo blanco dibujado en la mitad superior.

Configurar el color del lápiz/fuente en la pantalla#

The set pen / font color on screen stack block sets the color of text, pixels, lines, and shape outlines.

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

Parámetros

Descripción

color

The pen and font color to use:

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

Ejemplo

Cuando se inicia, establece el color del lápiz en rojo y dibuja un rectángulo con la esquina superior izquierda en (50, 50), ancho 130 píxeles y alto 60 píxeles.#
when started
[Draw a rectangle with a red pen.]
set pen / font color to [red v] on screen
draw rectangle [50] [50] [130] [60] on screen

Captura de pantalla de la pantalla del robot con un rectángulo rojo con un borde delgado dibujado en la mitad superior.

establecer color de relleno en la pantalla#

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

Establecer bloque de pila de color de relleno#
set fill color to [red v] on screen

Parámetros

Descripción

color

The fill color to use:

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

Ejemplos

Al iniciarse, establece el color de relleno en naranja y dibuja dos rectángulos. El primero está en (50, 50) y el segundo en (50, 130), ambos con 100 píxeles de ancho y 60 de alto.#
when started
[Draw two orange rectangles.]
set fill color to [orange v] on screen
draw rectangle [50] [50] [100] [60] on screen
draw rectangle [50] [130] [100] [60] on screen

Captura de pantalla de la pantalla del robot con dos rectángulos naranjas paralelos con finos contornos blancos situados en el centro izquierdo de la pantalla.


Cuando se inicia, establece el color de relleno de fondo en violeta e imprime “Resaltar” en la pantalla.#
when started
[Display text with a purple background.]
set fill color to [purple v] on screen
print [Highlight] on screen ▶

Una captura de pantalla de la pantalla del robot muestra la palabra "Resaltar" en texto blanco con un resaltado morado a su alrededor, comenzando en la esquina superior izquierda.

Dibujar#

Mostrar archivo de imagen en pantalla#

The show image file on screen stack block draws a custom user-uploaded image on the robot’s screen.

mostrar bloque de pila de imágenes de usuario#
show image file [1 v]

Parámetros

Descripción

número de ranura de imagen

La imagen personalizada a utilizar, número del 1 al 10. El número de la imagen se alinea con el número que se muestra en el panel de control de AIM.

Ejemplo

when started
[Draw uploaded Image 1.]
show image file [1 v]

dibujar píxeles en la pantalla#

The draw pixel on screen stack block draws one pixel at the selected x and y coordinate using the current pen color.

By default, the origin is located at the top-left corner of the screen at (0, 0). On the x-axis, 0 is on the left side of the screen, and 240 is on the right side. On the y-axis, 0 is at the top of the screen, and 240 is at the bottom. You can use the set screen origin block to move the origin to a different location. When the origin is changed, the x- and y-coordinate ranges will also change.

For example, if the origin is set to (120, 120), the x and y range will be from -120 to 120 for the x and y coordinates.

dibujar bloque de pila de píxeles#
draw pixel [0] [0] on screen

Parámetros

Descripción

incógnita

The x-coordinate to draw the pixel, from 0 to 240 with the default origin.

y

The y-coordinate to draw the pixel, from 0 to 240 with the default origin.

Ejemplo

Cuando se inicia, dibuja un píxel en el centro de la pantalla en las coordenadas (120, 120).#
when started
[Draw a pixel at the center of the screen.]
draw pixel [120] [120] on screen

Captura de pantalla de la pantalla del robot con un solo píxel blanco en el centro.

dibujar una línea en la pantalla#

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

By default, the origin is located at the top-left corner of the screen at (0, 0). On the x-axis, 0 is on the left side of the screen, and 240 is on the right side. On the y-axis, 0 is at the top of the screen, and 240 is at the bottom. You can use the set screen origin block to move the origin to a different location. When the origin is changed, the x- and y-coordinate ranges will also change.

For example, if the origin is set to (120, 120), the x and y range will be from -120 to 120 for the x and y coordinates.

bloque de pila de línea de dibujo#
draw line [0] [0] [10] [10] on screen

Parámetros

Descripción

x1

The x-coordinate in pixels of the start of the line, from 0 to 240 with the default origin.

año1

The y-coordinate in pixels of the start of the line, from 0 to 240 with the default origin.

x2

The x-coordinate in pixels of the end of the line, from 0 to 240 with the default origin.

Año 2

The y-coordinate in pixels of the end of the line, from 0 to 240 with the default origin.

Ejemplo

Al iniciarse, dibuja una línea diagonal desde la esquina superior izquierda (0,0) hasta la esquina inferior derecha (240,240) de la pantalla.#
when started
[Draw a line from the top left to bottom right of the screen.]
draw line [0] [0] [240] [240] on screen

Captura de pantalla de la pantalla del robot con una fina línea diagonal blanca dibujada desde la esquina superior izquierda hasta la esquina inferior derecha.

Dibujar un rectángulo en la pantalla#

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

By default, the origin is located at the top-left corner of the screen at (0, 0). On the x-axis, 0 is on the left side of the screen, and 240 is on the right side. On the y-axis, 0 is at the top of the screen, and 240 is at the bottom. You can use the set screen origin block to move the origin to a different location. When the origin is changed, the x- and y-coordinate ranges will also change.

For example, if the origin is set to (120, 120), the x and y range will be from -120 to 120 for the x and y coordinates.

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

Parámetros

Descripción

incógnita

The x-coordinate in pixels of the top-left corner of the rectangle, from 0 to 240 with the default origin.

y

The y-coordinate in pixels of the top-left corner of the rectangle, from 0 to 240 with the default origin.

ancho

El ancho del rectángulo en píxeles.

altura

La altura del rectángulo en píxeles.

Ejemplo

Cuando se inicia, dibuja un rectángulo en la pantalla con la esquina superior izquierda en (50,50), ancho de 130 píxeles y alto de 60 píxeles.#
when started
[Draw a rectangle on the screen.]
draw rectangle [50] [50] [130] [60] on screen

Captura de pantalla de la pantalla del robot con un rectángulo blanco dibujado en la mitad superior.

dibujar un círculo en la pantalla#

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

By default, the origin is located at the top-left corner of the screen at (0, 0). On the x-axis, 0 is on the left side of the screen, and 240 is on the right side. On the y-axis, 0 is at the top of the screen, and 240 is at the bottom. You can use the set screen origin block to move the origin to a different location. When the origin is changed, the x- and y-coordinate ranges will also change.

For example, if the origin is set to (120, 120), the x and y range will be from -120 to 120 for the x and y coordinates.

Dibujar bloque de pila circular#
draw circle [0] [0] [10] on screen

Parámetros

Descripción

incógnita

The x-coordinate in pixels of the center of the circle, from 0 to 240 with the default origin.

y

The y-coordinate in pixels of the center of the circle, from 0 to 240 with the default origin.

radio

El radio del círculo en píxeles.

Ejemplo

Al iniciarse, dibuja un círculo en la pantalla con el centro en (120,120) y un radio de 40 píxeles.#
when started
[Draw a circle on the screen.]
draw circle [120] [120] [40] on screen

Captura de pantalla de la pantalla del robot con un círculo blanco dibujado en el centro.

Tocar#

screen pressed#

The screen pressed Boolean block reports whether the robot’s screen is currently being pressed.

  • True — The screen is being pressed.

  • False — The screen is not being pressed.

screen pressed Boolean block#
<screen pressed?>

Parámetros

Descripción

Este bloque no tiene parámetros.

Ejemplo

Al iniciarse, comprueba continuamente si la pantalla está presionada. Si se presiona, todos los LED se vuelven blancos; de lo contrario, permanecen apagados.#
when started
[Turn LEDs white only when the screen is pressed.]
forever
if <screen pressed?> then
set [lightall v] LED color to [white v]
else
set [lightall v] LED color to [off v]
fin
fin

posición de la pantalla#

The screen position reporter block reports the selected coordinate of the last screen press. The x-coordinate is from 0 (left) to 240 (right). The y-coordinate is from 0 (top) to 240 (bottom).

bloque de reportero de posición de pantalla#
(screen [x v] position)

Parámetros

Descripción

coordinar

The coordinate of the last screen press to report: x reports the horizontal position, and y reports the vertical position.

Ejemplo

Al iniciarse, verifica continuamente si se pulsa la pantalla. Si se pulsa, borra la pantalla e imprime las coordenadas x e y de la posición táctil.#
when started
[Display the x and y coordinate of where the screen is pressed.]
forever
if <screen pressed?> then
clear screen
print (screen [x v] position) on screen ▶
set cursor to next row on screen
print (screen [y v] position) on screen ▶
fin
fin

cuando el evento de pantalla#

The when screen event hat block runs the attached stack of blocks when the robot’s screen is pressed or released.

when screen event hat block#
when screen [pressed v]

Parámetros

Descripción

acción

When to run the attached stack of blocks: pressed runs when the screen is pressed, and released runs when the screen is released.

Ejemplo

Cuando se presiona la pantalla, todos los LED se vuelven verdes.#
when screen [pressed v]
[Set the LEDs to green when the screen is pressed.]
set [lightall v] LED color to [green v]