Pantalla#

Introducción#

The screen class is derived from the brain base class. It controls how the IQ (1st gen) Brain displays text and values on its built-in screen.

La pantalla cerebral IQ (1.ª generación) admite hasta 5 filas y 21 columnas de texto.

El cerebro VEX IQ (1.ª generación) con una cuadrícula numerada superpuesta (columnas 1-21 y filas 1-5). Las líneas rojas superpuestas resaltan la estructura de la cuadrícula, con flechas que etiquetan la columna 1, la columna 21, la fila 1, la fila 2 y la fila 5. La primera fila muestra los números del 1 al 21 en la parte superior.

Acceso#

The screen class can be accessed by:

Brain.Screen

Notas#

  • The screen object is provided by the Brain. It is not constructed directly.

  • Projects use a single global Brain object, so screen functions are called using Brain.Screen.

Ejemplo#

/* This constructor is required when using VS Code.
A Brain is generated automatically at the start of
VEXcode projects. */

// Create the Brain
brain Brain = brain();

// Print text to the Brain screen
Brain.Screen.print("Hello!");

Funciones de los miembros#

The screen class includes the following member functions:

  • print — Prints formatted text, numbers, or Boolean values to the Brain screen.

  • setCursor — Moves the text cursor to a specified row and column.

  • newLine — Clears the remainder of the current line and moves the cursor to the next line.

  • clearLine — Clears the remainder of the current line or clears a specified line.

  • row — Returns the row where text will be printed.

  • column — Returns the column where text will be printed.

  • getStringHeight — Returns the height of a string in pixels using the current font.

  • getStringWidth — Returns the width of a string in pixels using the current font.

  • printAt — Prints formatted text at an x, y pixel location (optionally opaque).

  • clearScreen — Clears the entire screen (optionally to a specified color).

  • setFont — Sets the font used for printing on the screen.

  • setPenWidth — Sets the thickness of drawn lines and shape outlines.

  • setPenColor — Sets the color of text, pixels, lines, and shape outlines.

  • setFillColor — Sets the fill color for drawn shapes and printed text backgrounds.

  • setOrigin — Sets the origin used for screen coordinates.

  • setClipRegion — Restricts screen output to a rectangular region.

  • drawPixel — Draws one pixel at a coordinate.

  • drawLine — Draws a line between two points.

  • drawRectangle — Draws a rectangle at an x, y location with a specified size.

  • drawCircle — Draws a circle at an x, y location with a specified radius.

  • render — Enables double buffering or renders the back buffer to the screen.

Before calling any screen member functions, a brain instance must be created, as shown below:

// Create the Brain
brain Brain = brain();

print#

Muestra texto, números o valores booleanos en la pantalla cerebral del IQ (1.ª generación).

Available Functions

1 Imprime texto formateado usando literales de cadena o cadenas de estilo C de solo lectura.

void print(
    const char* format,
    ... );

2 Imprime texto formateado utilizando matrices de caracteres modificables.

void print(
    char* format,
    ... );

Parameters

Parámetro

Tipo

Descripción

format

const char*

A format string provided as a string literal or read-only C-style string (for example, “Score: %d”).

format

char*

Una cadena de formato proporcionada como una matriz de caracteres modificable.

Uno o más valores adicionales que se insertan en la cadena de formato, separados por comas.

Return Values

Esta función no devuelve ningún valor.

Notes
  • La salida comienza en la posición actual del cursor posición en la pantalla.

  • El texto impreso utiliza la fuente de pantalla actual .

  • El texto impreso utiliza el color de pluma actual .

  • Text printed with print is always printed with a background, and the background color is determined by the current fill color.

  • Al usar una cadena de formato, el número y los tipos de valores pasados ​​deben coincidir con los especificadores de formato en la cadena.

Examples
// Display a message at the starting cursor
Brain.Screen.print("Hello, Robot!");

setCursor#

Moves the cursor to a specific row and column on the IQ (1st gen) Brain screen. The next print call will start printing at that location.

Available Functions
void setCursor(
  int32_t row, 
  int32_t col );

Parameters

Parámetro

Tipo

Descripción

row

int32_t

La fila a la que mover el cursor.

col

int32_t

La columna a la que se debe mover el cursor.

Return Values

Esta función no devuelve ningún valor.

Notes Examples
// Print at row 3 column 7
Brain.Screen.setCursor(3, 7);
Brain.Screen.print("VEXcode!");

Pantalla del cerebro IQ (1.ª generación) que muestra el texto centrado “VEXcode!”.

newLine#

Mueve el cursor al principio de la siguiente fila en la pantalla del cerebro.

Available Functions
void newLine();

Parameters

Esta función no acepta ningún parámetro.

Return Values

Esta función no devuelve ningún valor.

Notes
  • If the cursor is in the middle of a sentence, newLine will clear the rest of the row after the cursor before moving to the next row.

  • After calling newLine, the cursor is positioned at the first column of the next line.

  • The cursor position and row numbering are set using setCursor.

Examples
// Display two lines of text
Brain.Screen.print("First message");
Brain.Screen.newLine();
Brain.Screen.print("Second message");

Pantalla del cerebro IQ (1.ª generación) que muestra el “Primer mensaje” y el “Segundo mensaje”, mostrados en líneas separadas.

clearLine#

Borra el texto de una fila en la pantalla del IQ (1.ª generación).

Available Functions

1 Borra el resto de la línea actual desde la posición del cursor.

void clearLine();

2 Borra la fila especificada usando el color de relleno configurado actualmente.

void clearLine(
    int number );

3 Borra la fila especificada usando un objeto de color predefinido o…/Logic/Custom_color.md.

void clearLine(
    int          number,
    const color& color );

4 Borra la fila especificada utilizando un valor de color hexadecimal.

void clearLine(
    int         number,
    const char* color );

5 Borra la fila especificada usando un valor de tono.

void clearLine(
    int number,
    int hue );

Parameters

Parámetro

Tipo

Descripción

number

int

The row number to clear. Row numbering starts at 1.

color

const color&

Clears the row using a color object. Predefined colors include:

  • black
  • white
  • red
  • green
  • blue
  • yellow
  • orange
  • purple
  • cyan
  • transparent
This can also use a custom color object.

color

const char*

Clears the row using a hexadecimal color value (for example, “#000000”).

hue

int

Clears the row using an integer hue value in the range 0359, representing degrees around a color wheel.

Return Values

Esta función no devuelve ningún valor.

Notes
  • Borrar una línea no cambia la posición actual del cursor.

  • The cursor position and row numbering are set using setCursor.

  • La pantalla del sistema IQ (1.ª generación) es monocromática, por lo que los colores especificados no aparecerán en ella.

Examples
// Display text on two rows
Brain.Screen.print("This text stays");
Brain.Screen.newLine();
Brain.Screen.print("This disappears");

// Wait 3 seconds before clearing row 2
wait(3, seconds);
Brain.Screen.clearLine(2);

row#

Devuelve la posición actual del cursor en la fila de la pantalla del cerebro IQ (1.ª generación).

Available Functions
int32_t row();

Parameters

Esta función no acepta ningún parámetro.

Return Values

Returns an int32_t representing the row where text will be printed.

La numeración de las filas comienza en el 1.

Notes
  • La posición del cursor se basa en la fuente de pantalla actual .

  • El valor devuelto indica dónde aparecerá la siguiente impresión.

  • The row value changes when text is printed or when setCursor is called.

Examples
// Display the cursor's current row
Brain.Screen.setCursor(3, 12);
Brain.Screen.print("row: ", Brain.Screen.row());

column#

Devuelve la columna donde se imprimirá el texto en la pantalla del IQ (1.ª generación).

Available Functions
int32_t column();

Parameters

Esta función no acepta ningún parámetro.

Return Values

Returns an int32_t representing the column where text will be printed.

La numeración de las columnas comienza en 1.

Notes
  • La posición del cursor se basa en la fuente de pantalla actual .

  • El valor devuelto indica dónde aparecerá la siguiente impresión.

  • The column value changes when text is printed or when setCursor is called.

Examples
// Display the cursor's current column
Brain.Screen.print("column: ", Brain.Screen.column());

getStringHeight#

Devuelve la altura, en píxeles, de una cadena cuando se muestra en la pantalla del procesador IQ (1.ª generación).

Available Functions
int32_t getStringHeight( 
    const char* cstr );

Parameters

Parámetro

Tipo

Descripción

cstr

const char*

The text to be measured, provided as a C-style string (for example, “Hello”).

Return Values

Returns an int32_t representing the height of the string in pixels when rendered on the Brain screen.

Notes
  • La altura devuelta depende de la fuente de pantalla seleccionada actualmente .

  • Esta función mide la cadena sin dibujarla en la pantalla.

  • La altura devuelta refleja cómo se vería la cadena al imprimirse.

getStringWidth#

Devuelve el ancho, en píxeles, de una cadena cuando se muestra en la pantalla del procesador IQ (1.ª generación).

Available Functions
int32_t getStringWidth( 
    const char* cstr );

Parameters

Parámetro

Tipo

Descripción

cstr

const char*

The text to be measured, provided as a C-style string (for example, “Hello”).

Return Values

Returns an int32_t representing the width of the string in pixels when rendered on the Brain screen.

Notes
  • El ancho devuelto depende de la fuente de pantalla seleccionada actualmente .

  • Esta función mide la cadena sin dibujarla en la pantalla.

  • El ancho devuelto refleja cómo se vería la cadena al imprimirse.

printAt#

Imprime texto, números o valores booleanos en una coordenada específica de la pantalla cerebral IQ (1.ª generación).

Available Functions

1 Imprime la salida formateada en la ubicación de píxeles especificada.

void printAt(
    int32_t    x,
    int32_t    y,
    const char* format,
    ... );

2 Imprime la salida formateada en la ubicación de píxeles especificada y establece si el fondo del texto es opaco o transparente.

void printAt(
    int32_t    x,
    int32_t    y,
    bool       bOpaque,
    const char* format,
    ... );

Parameters

Parámetro

Tipo

Descripción

x

int32_t

La posición x en la que se imprimirá, con respecto al origen de la pantalla.

y

int32_t

La posición Y en la que se imprimirá, con respecto al origen de la pantalla.

bOpaque

bool

Controls whether the printed text is drawn opaquely or transparently:

  • true — The background of the printed text is filled using the current fill color.
  • false — The text is drawn transparently and the background is not filled.

format

const char*

A format string that controls what is printed on the screen (for example, “Score: %d”).

Uno o más valores adicionales que se insertan en la cadena de formato, separados por comas.

Return Values

Esta función no devuelve ningún valor.

Notes
  • The x and y coordinates are relative to the current screen origin, which can be changed using setOrigin.

  • El texto impreso utiliza la fuente de pantalla actual .

  • El texto impreso utiliza el color de pluma actual .

  • Al usar una cadena de formato, el número y los tipos de valores pasados ​​deben coincidir con los especificadores de formato en la cadena.

Examples
// Print the number 1 at pixel (100, 40)
Brain.Screen.printAt(100, 40, 1);

clearScreen#

Borra todos los dibujos y textos de la pantalla del Cerebro.

Available Functions

1 Borra la pantalla y la deja en negro.

void clearScreen();

2 Borra la pantalla usando un objeto de color predefinido o color personalizado.

void clearScreen(
    const color& color );

3 Borra la pantalla usando un valor de color hexadecimal.

void clearScreen(
    const char* color );

4 Borra la pantalla usando un valor de tono.

void clearScreen(
    int hue );

Parameters

Parámetro

Tipo

Descripción

color

const color&

Clears the screen using a color object. Predefined colors include:

  • black
  • white
  • red
  • green
  • blue
  • yellow
  • orange
  • purple
  • cyan
  • transparent
This can also use a custom color object.

color

const char

Clears the screen using a hexadecimal color value represented as a string (for example, “#000000”).

hue

int

Clears the screen using an integer hue value in the range 0359, representing degrees around a color wheel.

Return Values

Esta función no devuelve ningún valor.

Notes
  • La pantalla del sistema IQ (1.ª generación) es monocromática, por lo que los colores especificados no aparecerán en ella.

Examples
// Clear screen after 2 seconds
Brain.Screen.print("VEXcode");
wait(2, seconds);
Brain.Screen.clearScreen();


// Clear screen to blue after 2 seconds
Brain.Screen.print("VEXcode");
wait(2, seconds);
Brain.Screen.clearScreen(red);

setFont#

Establece la fuente utilizada para el texto que se muestra en la pantalla del cerebro IQ (1.ª generación).

This controls the font applied to subsequent text output when using screen text functions such as print.

Available Functions
void setFont(
  fontType font );

Parameters

Parámetro

Tipo

Descripción

font

fontType

Sets the font to one of the following:

  • mono12
  • mono15
  • mono20
  • mono30
  • mono40
  • mono60
  • prop20
  • prop30
  • prop40
  • prop60
These options are shown below.

Return Values

Esta función no devuelve ningún valor.

Examples
// Display two different fonts on
// two separate lines
Brain.Screen.setFont(mono20);
Brain.Screen.print("Mono Medium");
Brain.Screen.newLine();
Brain.Screen.setFont(prop20);
Brain.Screen.print("Prop Medium");

setPenWidth#

Establece el grosor de las líneas dibujadas y los contornos de las formas.

Available Functions
void setPenWidth(
  uint32_t width );

Parameters

Parámetro

Tipo

Descripción

width

uint32_t

El ancho del lápiz, en píxeles, va de 0 a 32.

Return Values

Esta función no devuelve ningún valor.

Notes Examples
// Draw a circle with a pen width of 5
Brain.Screen.drawCircle(40, 70, 20);
Brain.Screen.setPenWidth(5);
Brain.Screen.drawCircle(100, 70, 20);

setPenColor#

Establece el color del texto, los píxeles, las líneas y los contornos de las formas.

Available Functions

1 Establece el color del lápiz usando un objeto predefinido o color personalizado.

void setPenColor(
    const color& color );

2 Establece el color del lápiz usando un valor de color hexadecimal.

void setPenColor(
    const char* color );

3 Establece el color del lápiz usando un valor de tono.

void setPenColor(
    int hue );

Parameters

Parámetro

Tipo

Descripción

color

const color&

Sets the pen color using a color object. Predefined colors include:

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

color

const char*

Sets the pen color using a hexadecimal color value represented as a string (for example, “#FF0000”).

hue

int

Sets the pen color using an integer hue value in the range 0359, representing degrees around a color wheel (for example, 0 is red, 120 is green, and 240 is blue).

Return Values

Esta función no devuelve ningún valor.

Notes
  • La pantalla del sistema IQ (1.ª generación) es monocromática, por lo que los colores especificados no aparecerán en ella.

Examples
```cpp
Brain.Screen.drawRectangle(100, 50, 10, 20);
Brain.Screen.setPenColor(blue);
Brain.Screen.drawRectangle(50, 50, 10, 20);

setFillColor#

Establece el color de relleno que se utiliza al dibujar las formas.

Available Functions

1 Establece el color de relleno usando un objeto predefinido o color personalizado.

void setFillColor(
    const color& color );

2 Establece el color de relleno utilizando un valor de color hexadecimal.

void setFillColor(
    const char* color );

3 Establece el color de relleno usando un valor de tono.

void setFillColor(
    int hue );

Parameters

Parámetro

Tipo

Descripción

color

const color&

Sets the fill color using a color object. Predefined colors include:

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

color

const char

Sets the fill color using a hexadecimal color value represented as a string (for example, “#00FF00”).

hue

int

Sets the fill color using an integer hue value in the range 0359, representing degrees around a color wheel (for example, 0 is red, 120 is green, and 240 is blue).

Return Values

Esta función no devuelve ningún valor.

Notes
  • La pantalla del sistema IQ (1.ª generación) es monocromática, por lo que los colores especificados no aparecerán en ella.

Examples
// Draw a circle filled with yellow
Brain.Screen.setFillColor(yellow);
Brain.Screen.drawCircle(50, 50, 20);

setOrigin#

Establece el origen utilizado para dibujar gráficos en la pantalla del cerebro.

Available Functions
void setOrigin(
  int32_t x,
  int32_t y );

Parameters

Parámetro

Tipo

Descripción

x

int32_t

La posición x del origen en relación con la esquina superior izquierda de la pantalla del Cerebro, de 0 a 159.

y

int32_t

La posición y del origen en relación con la esquina superior izquierda de la pantalla del Cerebro, de 0 a 107.

Return Values

Esta función no devuelve ningún valor.

Notes
  • El origen predeterminado es la esquina superior izquierda de la pantalla en la coordenada (0, 0).

  • The origin applies to coordinate functions such as drawLine, drawRectangle, drawCircle, and printAt.

  • El origen permanece vigente hasta que se modifique de nuevo o se reinicie el proyecto.

setClipRegion#

Define un área rectangular en la pantalla donde se mostrarán todos los dibujos y el texto. Cualquier contenido fuera de esta región no se mostrará.

Available Functions
void setClipRegion(
  int x,
  int y,
  int width,
  int height );

Parameters

Parámetro

Tipo

Descripción

x

int

La coordenada x de la esquina superior izquierda de la región de recorte, dada como un número entero entre 0 y 159.

y

int

La coordenada y de la esquina superior izquierda de la región de recorte, dada como un número entero de 0 a 107.

width

int

El ancho de la región de recorte en píxeles, expresado como un número entero entre 0 y 159.

height

int

La altura de la región de recorte en píxeles, expresada como un número entero entre 0 y 107.

Return Values

Esta función no devuelve ningún valor.

Notes
  • Las funciones de dibujo se siguen ejecutando aunque queden fuera de la región de recorte, pero solo se ve la parte que está dentro de dicha región.

  • The x and y coordinates are relative to the current screen origin, which can be changed using setOrigin.

  • La región de recorte se aplica únicamente al hilo actual.

  • Al establecer una nueva región de recorte, se reemplaza cualquier región de recorte establecida previamente para el hilo actual.

Examples
// Restrict text and drawings to a specific region
Brain.Screen.setClipRegion(0, 0, 120, 120);
Brain.Screen.drawRectangle(60, 60, 100, 100, red);
Brain.Screen.printAt(60, 60, "Cut off!");

drawPixel#

Dibuja un único píxel en la pantalla del IQ (1.ª generación) Brain en la ubicación de píxeles x e y especificada.

Available Functions
void drawPixel(
  int x,
  int y );

Parameters

Parámetro

Tipo

Descripción

x

int

La coordenada x donde se dibujará el píxel, dada como un número entero del 0 al 159.

y

int

La coordenada y donde se dibujará el píxel, dada como un número entero del 0 al 107.

Return Values

Esta función no devuelve ningún valor.

Notes
  • La pantalla del sistema IQ (1.ª generación) es monocromática, por lo que los colores especificados no aparecerán en ella.

  • The x and y coordinates are relative to the current screen origin, which can be set using setOrigin.

  • Si la ubicación del píxel especificada está fuera de los límites de la pantalla, el píxel no se dibuja.

Examples
// Draw one pixel at the center 
// of the screen
Brain.Screen.drawPixel(80, 50);

drawLine#

Dibuja una línea recta que conecta dos puntos en la pantalla cerebral de CI (1.ª generación).

Available Functions
void drawLine(
  int x1,
  int y1,
  int x2,
  int y2 );

Parameters

Parámetro

Tipo

Descripción

x1

int

La coordenada x inicial de la línea, dada como un número entero entre 0 y 159.

y1

int

La coordenada y inicial de la línea, dada como un número entero entre 0 y 107.

x2

int

La coordenada x final de la línea, dada como un número entero entre 0 y 159.

y2

int

La coordenada y final de la línea, dada como un número entero entre 0 y 107.

Return Values

Esta función no devuelve ningún valor.

Notes
  • La pantalla del sistema IQ (1.ª generación) es monocromática, por lo que los colores especificados no aparecerán en ella.

  • The width of the line is determined by the current pen width set with setPenWidth.

  • The x and y coordinates are relative to the current screen origin, which can be set using setOrigin.

  • Si alguna parte de la línea queda fuera de los límites de la pantalla, solo se dibuja la parte visible.

Examples
// Draw a line from the top left to 
// bottom right of the screen
Brain.Screen.drawLine(0, 0, 159, 107);

drawRectangle#

Dibuja un rectángulo en la pantalla del cerebro IQ (1.ª generación) en la posición y el tamaño especificados.

Available Functions

1 Dibuja y rellena un rectángulo usando el color de relleno configurado actualmente.

void drawRectangle(
    int x,
    int y,
    int width,
    int height );

2 Dibuja y rellena un rectángulo usando un objeto de color predefinido o color personalizado.

void drawRectangle(
    int           x,
    int           y,
    int           width,
    int           height,
    const color&  color );

3 Dibuja y rellena un rectángulo utilizando un valor de color hexadecimal.

void drawRectangle(
    int           x,
    int           y,
    int           width,
    int           height,
    const char*   color );

4 Dibuja y rellena un rectángulo usando un valor de tono.

void drawRectangle(
    int x,
    int y,
    int width,
    int height,
    int hue );

Parameters

Parámetro

Tipo

Descripción

x

int

La coordenada x de la esquina superior izquierda del rectángulo, dada como un número entero entre 0 y 159.

y

int

La coordenada y de la esquina superior izquierda del rectángulo, dada como un número entero entre 0 y 107.

width

int

El ancho del rectángulo, dado como un número entero de 0 a 159.

height

int

La altura del rectángulo, dada como un número entero de 0 a 107.

color

const color&

Fills the rectangle using a color object. Predefined colors include:

  • black
  • white
  • red
  • green
  • blue
  • yellow
  • orange
  • purple
  • cyan
  • transparent
This can also use a custom color object.

color

const char*

Fills the rectangle using a hexadecimal color value (for example, “#FF0000”).

hue

int

Fills the rectangle using a hue value in the range 0359.

Return Values

Esta función no devuelve ningún valor.

Notes
  • La pantalla del sistema IQ (1.ª generación) es monocromática, por lo que los colores especificados no aparecerán en ella.

  • The outline thickness is determined by the current pen width set with setPenWidth.

  • The x and y coordinates are relative to the current screen origin, which can be changed using setOrigin.

  • Si alguna parte del rectángulo queda fuera de los límites de la pantalla, solo se dibujará la parte visible.

Examples
// Draw a red rectangle on the screen
Brain.Screen.drawRectangle(25, 25, 100, 50, red);

drawCircle#

Dibuja un círculo en la pantalla del sensor IQ (1.ª generación) en la posición y el radio especificados.

Available Functions

1 Dibuja y rellena un círculo usando el color de relleno configurado actualmente.

void drawCircle(
    int x,
    int y,
    int radius );

2 Dibuja y rellena un círculo usando un objeto de color predefinido o color personalizado.

void drawCircle(
    int           x,
    int           y,
    int           radius,
    const color&  color );

3 Dibuja y rellena un círculo utilizando un valor de color hexadecimal.

void drawCircle(
    int           x,
    int           y,
    int           radius,
    const char*   color );

4 Dibuja y rellena un círculo usando un valor de tono.

void drawCircle(
    int x,
    int y,
    int radius,
    int hue );

Parameters

Parámetro

Tipo

Descripción

x

int

La coordenada x del centro del círculo, dada como un número entero entre 0 y 159.

y

int

La coordenada y del centro del círculo, dada como un número entero entre 0 y 107.

radius

int

El radio del círculo, expresado como un número entero entre 0 y 107 píxeles.

color

const color&

Fills the circle using a color object. Predefined colors include:

  • black
  • white
  • red
  • green
  • blue
  • yellow
  • orange
  • purple
  • cyan
  • transparent
This can also use a custom color object.

color

const char*

Fills the circle using a hexadecimal color value (for example, “#FF0000”).

hue

int

Fills the circle using a hue value in the range 0359.

Return Values

Esta función no devuelve ningún valor.

Notes
  • La pantalla del sistema IQ (1.ª generación) es monocromática, por lo que los colores especificados no aparecerán en ella.

  • The outline thickness is determined by the current pen width set with setPenWidth.

  • The x and y coordinates are relative to the current screen origin, which can be changed using setOrigin.

Examples
// Draw a green circle on the screen
Brain.Screen.drawCircle(80, 50, 20, green);

render#

Enables double buffering for the Brain’s screen. Once called, any drawing functions (like text or shapes) will no longer appear immediately for the rest of the project. Instead, updates will only be shown when render is used again. This allows for smoother and more controlled screen updates, but means nothing will be visible until render is used.

Available Functions

1 Habilita el doble búfer o renderiza el búfer de respaldo en la pantalla.

bool render();

2 Renderiza el búfer de fondo en la pantalla con control sobre el comportamiento de sincronización vertical y ejecución del programador opcional.

bool render(
    bool bVsyncWait,
    bool bRunScheduler = true );

Parameters

Parámetro

Tipo

Descripción

bVsyncWait

bool

  • true — Wait for the screen’s vertical refresh before rendering to reduce visual tearing.
  • false — Do not wait for the screen’s vertical refresh before rendering.

bRunScheduler

bool

Optional.

  • true (default) — Allow background tasks to run while waiting to render.
  • false — Do not allow background tasks to run while waiting to render.

Return Values

Returns a Boolean indicating whether the saved drawings in the buffer were successfully rendered to the screen:

  • true — The drawings were successfully rendered on the screen.
  • false — The drawings could not be rendered on the screen.
  • Notes
    • Calling render will require render to be used for the rest of the project.

    Examples
    Brain.Screen.render();
    
    // Draw text to the back buffer
    Brain.Screen.print("Render later...");
    
    // Wait for a screen press to render drawings
    while (!Brain.Screen.pressing()) {
      wait(20, msec);
    }
    Brain.Screen.render();