Drawing#

Introduction#

The VR Robot uses a pen to draw on a playground as it moves. The robot’s pen can change width, color, and fill enclosed area.

Below is a list of all available blocks:

  • move pen – Raise or lower the robot’s pen.

  • set pen to width – Set the width of the robot’s pen.

  • set pen to color – Set the color of the robot’s pen from a list.

  • set pen color – Set the color of the robot’s pen with red, green, and blue values.

  • fill area – Fill a playground or an enclosed area with a specified color.

move pen#

The move pen block raises or lowers the robot’s pen, allowing it to start or stop drawing.

mover pluma [abajo v]

Parameters

Description

state

The state of the robot’s pen:

  • down
  • up

Example

cuando empezó :: hat events
[Draw a square.]
mover pluma [abajo v]
repetir (4)
unidad [adelante v] para [150] [mm v] ▶
girar [derecha v] por [90] grado ▶

set pen to width#

The set pen to width block sets how thick the drawn lines from the pen appear.

A top-down view of the VEXcode VR Art Canvas + playground, with five different black lines drawn side-by-side. Each line is a different width, increasing in size as it moves to the right.

establecer el lápiz con ancho [thin v]

Parameters

Description

width

The width of the robot’s pen:

  • extra thin
  • thin (default)
  • medium
  • wide
  • extra wide

Example

cuando empezó :: hat events
[Draw an extra wide square.]
establecer el lápiz con ancho [extra wide v]
mover pluma [abajo v]
repetir (4)
unidad [adelante v] para [150] [mm v] ▶
girar [derecha v] por [90] grado ▶

set pen to color#

The set pen to color block sets the color of the pen from a preset list.

Poner el lápiz en color [negro v]

Parameters

Description

color

The color of the robot’s pen:

  • black
  • red
  • green
  • blue

Example

cuando empezó :: hat events
[Draw a blue square.]
Poner el lápiz en color [azul v]
mover pluma [abajo v]
repetir (4)
unidad [adelante v] para [150] [mm v] ▶
girar [derecha v] por [90] grado ▶

set pen color#

The set pen color block sets the color of the pen by manually providing red, green, blue, and opacity values. Adjust the different values by using the sliders that appear when clicking the color in the set pen color block.

establecer el color del bolígrafo (::#000000)

Parameters

Description

red

The red value of the color from 0 to 255.

green

The green value of the color from 0 to 255.

blue

The blue value of the color from 0 to 255.

opacity

How transparent the color is as a percentage from 0 to 100.

Example

cuando empezó :: hat events
[Draw a pink square.]
establecer el color del bolígrafo (::#D900D9)
mover pluma [abajo v]
repetir (4)
unidad [adelante v] para [150] [mm v] ▶
girar [derecha v] por [90] grado ▶

fill area#

The fill area block fills a playground or enclosed area with a specified color by manually providing red, green, blue, and opacity values. Adjust the different values by using the sliders that appear when clicking the color in the fill area block.

rellenar el área con el color (::#000000)

Parameters

Description

red

The red value of the color from 0 to 255.

green

The green value of the color from 0 to 255.

blue

The blue value of the color from 0 to 255.

opacity

How transparent the color is as a percentage from 0 to 100.

Example

cuando empezó :: hat events
[Fill the playground with pink.]
mover pluma [abajo v]
rellenar el área con el color (::#D900D9)