Pantalla#

Introducción#

The Screen category includes blocks that allow your IQ (2nd gen) Brain’s Screen to display text, values, and graphics on the brain’s built-in screen. These blocks can be used to print sensor data, create custom interfaces, or draw visual elements like lines, shapes, and text with adjustable styles and colors.

Below is a list of all blocks:

Print — Display text and values on the brain.

Settings — Configure screen display properties.

Draw — Create shapes and graphics on the brain’s screen.

Imprimir#

imprimir#

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

imprimir [VEXcode] en la pantalla ▶

Parámetros

Descripción

valor

El texto, número o valor de variable que se mostrará.

flecha expansiva

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

Ejemplo

cuando empezó
[Display a message at the starting cursor position.]
imprimir [Hello, Robot!] en la pantalla ◀ y coloque el cursor en la siguiente fila

A screenshot of the VEX IQ Brain screen reads Hello, Robot! in white text on the first line.

establecer el cursor en la fila columna#

When using the set cursor to row column block, the cursor is placed at a specific row and column on the brain’s screen. How many rows and columns can comfortably fit depends on the selected font.

Las fuentes monoespaciadas tienen caracteres del mismo ancho, lo que garantiza una colocación uniforme del texto. En cambio, las fuentes proporcionales varían en el ancho de los caracteres, por lo que algunas letras ocupan más espacio que otras. Sin embargo, independientemente del tipo utilizado, el bloque establecer cursor en fila y columna posiciona el cursor según el tamaño de fila y columna, no el estilo de fuente. El tamaño de fuente se puede ajustar mediante el bloque establecer fuente.

Establecer bloque de pila de cursor#
Coloque el cursor en la fila [1] columna [1] en la pantalla

Parámetros

Descripción

fila

The row of the cursor as an integer.

columna

The column of the cursor as an integer.

Ejemplo

cuando empezó
[Repeatedly print the current timer at Row 1 Column 1]
para siempre
imprimir (temporizador en segundos) en la pantalla ◀ y coloque el cursor en la siguiente fila
esperar (1) segundos
pantalla clara
Coloque el cursor en la fila (1) columna (1) en la pantalla

A screenshot of the VEX IQ Brain screen reads 25 in white text in the upper left corner.

colocar el cursor en la siguiente fila#

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

Colocar el cursor en la siguiente fila de la pantalla

Parámetros

Descripción

This block has no parameters.

Ejemplo

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 ◀ y coloque el cursor en la siguiente fila

A screenshot of the IQ Brain screen reads Line 1 in white text in the upper left corner, and Line 2 directly below it.

fila despejada#

The clear row block is used to clear a single row on the brain’s screen.

Limpiar la fila (1) de la pantalla

Parámetros

Descripción

fila

The row number to clear as an integer.

Ejemplo

cuando empezó
[Display text on two rows, but only keep one.]
imprimir [This text stays] en la pantalla ◀ y coloque el cursor en la siguiente fila
imprimir [This disappears] en la pantalla ◀ y coloque el cursor en la siguiente fila
esperar (3) segundos
Limpiar la fila (2) de la pantalla

columna del cursor#

El bloque columna del cursor devuelve el número de columna donde se imprimirá el texto como un entero.

bloque de reportero de columna de cursor#
(columna del cursor)

Parámetros

Descripción

This block has no parameters.

Ejemplo

Cuando se inicia, mueve el cursor a la fila 3, columna 2 en la pantalla e imprime el número de columna del cursor actual.#
cuando empezó
[Display the cursor's current column.]
Coloque el cursor en la fila [3] columna [2] en la pantalla
imprimir (columna del cursor) en la pantalla ▶

fila del cursor#

El bloque fila del cursor devuelve el número de fila donde se imprimirá el texto como un entero.

bloque de reportero de fila de cursor#
(fila del cursor)

Parámetros

Descripción

This block has no parameters.

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.#
cuando empezó
[Display the cursor's current row.]
Coloque el cursor en la fila [3] columna [2] en la pantalla
imprimir (fila del cursor) en la pantalla ▶

Ajustes#

pantalla clara#

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

pantalla clara

Parámetros

Descripción

This block has no parameters.

Ejemplo

cuando empezó
[Fill the screen, then clear it after 2 seconds.]
repetir (5)
imprimir [Line] en la pantalla ◀ y coloque el cursor en la siguiente fila
fin
esperar (3) segundos
pantalla clara

establecer fuente#

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

Establezca la fuente en [monoespaciado v] [medio v] en la pantalla

Parámetros

Descripción

fuente

La fuente a utilizar:

  • monoespaciada
  • proporcional

tamaño

Tamaño a utilizar:

  • extra pequeño
  • pequeño
  • mediano
  • grande
  • extra grande
  • súper grande

A screenshot of the VEX IQ Brain screen with a series of numbers and letters in Mono 12 font. The letter A-Z are on one line, spanning the width of the screen. The lower left corner indicates 26 characters across and 9 rows.
Mono Extra Small

The same screenshot as the one previous, now with Mono 15 font. The letters A-T are on one line, spanning the width of the screen. The lower left corner indicates 20 characters across and 7 rows.
Mono Small

The same screenshot as the one previous, now with Mono 20 font. The letters A-P are on one line, spanning the width of the screen. The lower left corner indicates 16 characters across and 5 rows.
Mono Medium

The same screenshot as the one previous, now with Mono 30 font. The numbers 1 through 9 and an extra 0 are on one line, spanning the width of the screen. The lower left corner indicates 3 rows.
Mono Large

The same screenshot as the one previous, now with Mono 40 font. The numbers 1 through 8 are on the second line, spanning the width of the screen.
Mono Extra Large

The same screenshot as the one previous, now with Mono 60 font. The screen shows MN 60 in large font, taking up nearly the whole top half of the screen.
Mono Super Large

The same screenshot as the one previous, now with Prop 20 font. The letters A-W are on one line, spanning the width of the screen. The lower left corner indicates 26 characters across and 5 rows.
Prop Medium

The same screenshot as the one previous, now with Prop 30 font. The numbers 1-9 are repeated twice on one line, spanning the width of the screen. The lower left corner indicates 18 characters across and 3 rows.
Prop Large

The same screenshot as the one previous, now with Prop 40 font. The screen reads Prop 40 on the top line and 14 by 2 on the second.
Prop Extra Large

The same screenshot as the one previous, now with Prop 60 font. The screen reads PROP 60 in large font, taking up nearly the whole top half of the screen.
Prop Super Large

Ejemplo

cuando empezó
[Display two different fonts on separate lines.]
Establezca la fuente en [monoespaciado v] [medio v] en la pantalla
imprimir [Mono Medium] en la pantalla ◀ y coloque el cursor en la siguiente fila
Establezca la fuente en [proporcional v] [medio v] en la pantalla
imprimir [Prop Medium] en la pantalla ◀ y coloque el cursor en la siguiente fila

A screenshot of the IQ Brain screen with white text on two lines in the upper left corner. The first line reads Mono Medium and the second line directly below reads Prop Medium in a smaller font.

set print precision on screen#

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

Establezca la precisión de impresión en [0.1 v] en la pantalla

Parámetros

Descripción

precisión

Establece la precisión de impresión en:

  • 1
  • 0,1
  • 0,01
  • 0,001
  • Todos los dígitos

Ejemplo

cuando empezó
[Print 1/3 as 0.33.]
Establezca la precisión de impresión en [0.01 v] en la pantalla
imprimir ([1] / [3]) en la pantalla ◀ y coloque el cursor en la siguiente fila

A screenshot of the IQ Brain screen with white text reading 0.33 in the upper left corner.

establecer el ancho del lápiz#

El bloque establecer ancho de lápiz establece el ancho de lápiz utilizado para dibujar líneas y formas.

Establezca el ancho del lápiz en [10] en la pantalla

Parámetros

Descripción

ancho

El ancho del lápiz en píxeles en un rango de 0 a 32.

Ejemplo

cuando empezó
[Draw two circles with different pen widths.]
dibuja el círculo (40) (70) (20) en la pantalla
Establezca el ancho del lápiz en (5) en la pantalla
dibuja el círculo (100) (70) (20) en la pantalla

A screenshot of the IQ Brain screen with two white circles printed on the lower half of the screen. The circle on the left is drawn with a narrower border than the one the right.

establecer el color del bolígrafo#

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

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

Parámetros

Descripción

color

Establece el color del lápiz a:

  • rojo
  • verde
  • azul
  • blanco
  • amarillo
  • naranja
  • morado
  • rojo violeta
  • violeta
  • azul violeta
  • azul verde
  • amarillo verde
  • amarillo naranja
  • rojo naranja

Ejemplo

cuando empezó
[Draw two rectangles with different colors.]
dibuja el rectángulo (100) (50) (10) (20) en la pantalla
Establezca el color del lápiz/fuente en [azul v] en la pantalla
dibuja el rectángulo (50) (50) (10) (20) en la pantalla

A screenshot of the IQ Brain screen with two small rectangles drawn on the lower half of the screen. The rectangle on the left is blue, and the one on the right is white.

establecer color de relleno#

El bloque establecer color de relleno establece el color de relleno utilizado cuando se dibujan formas.

Establezca el color de relleno en [rojo v] en la pantalla

Parámetros

Descripción

color

Establece el color de relleno a:

  • rojo
  • verde
  • azul
  • blanco
  • amarillo
  • naranja
  • púrpura
  • rojo violeta
  • violeta
  • azul violeta
  • azul verde
  • amarillo verde
  • amarillo naranja
  • rojo naranja

Ejemplo

cuando empezó
[Draw a yellow circle.]
Establezca el color de relleno en [amarillo v] en la pantalla
dibuja el círculo (50) (50) (20) en la pantalla

A screenshot of the IQ Brain screen with a bright yellow circle with a thin white border drawn on the left half of the screen.

Dibujar#

dibujar píxeles#

El bloque dibujar píxel dibuja un píxel en la coordenada de pantalla especificada (x, y) en el color de lápiz actual.

Dibuja el píxel [0] [0] en la pantalla

Parámetros

Descripción

incógnita

La coordenada x para dibujar el píxel.

y

La coordenada y para dibujar el píxel.

Ejemplo

cuando empezó
[Draw one pixel at the center of the screen.]
Dibuja el píxel (80) (50) en la pantalla

A screenshot of the IQ Brain screen with a tiny white dot in the center of the screen.

dibujar una línea#

El bloque dibujar línea dibuja una línea desde la primera coordenada de pantalla especificada (x1, y1) hasta la segunda coordenada de pantalla especificada (x2, y2) utilizando el ancho del lápiz y el color del lápiz actuales.

dibuja la línea [0] [0] [159] [107] en la pantalla

Parámetros

Descripción

x1

La coordenada x en píxeles del inicio de la línea.

año1

La coordenada y en píxeles del inicio de la línea.

x2

La coordenada x en píxeles del final de la línea.

Año 2

La coordenada y en píxeles del final de la línea.

Ejemplo

cuando empezó
[Draw a line from the top left to bottom right of the screen.]
dibuja la línea (0) (0) (159) (107) en la pantalla

A screenshot of the IQ Brain screen with a white diagonal line drawn from the upper left corner to the lower right corner.

dibujar rectángulo#

El bloque dibujar rectángulo dibuja un rectángulo utilizando el ancho del lápiz, el color del lápiz y los colores de relleno actuales.

dibuja el rectángulo [0] [0] [10] [10] en la pantalla

Parámetros

Descripción

incógnita

La coordenada x en píxeles de la esquina superior izquierda del rectángulo.

y

La coordenada y en píxeles de la esquina superior izquierda del rectángulo.

ancho

El ancho del rectángulo en píxeles.

altura

La altura del rectángulo en píxeles.

Ejemplo

cuando empezó
[Draw a rectangle on the screen.]
dibuja el rectángulo (25) (25) (100) (50) en la pantalla

A screenshot of the IQ Brain screen with a large white rectangle drawn nearly centered on the screen.

dibujar un círculo#

El bloque dibujar círculo dibuja un círculo utilizando el ancho del lápiz, el color del lápiz y los colores de relleno actuales.

dibuja el círculo [0] [0] [10] en la pantalla

Parámetros

Descripción

incógnita

La coordenada x en píxeles del centro del círculo.

y

La coordenada y en píxeles del centro del círculo.

radio

El radio del círculo en píxeles.

Ejemplo

cuando empezó
[Draw a circle on the screen.]
dibuja el círculo (80) (50) (20) en la pantalla

A screenshot of the IQ Brain screen with a white circle drawn centered on the screen.