屏幕#
介绍#
The Screen blocks control the VEX AIR Drone Controller’s screen, allowing your controller to show text, numbers, graphics, and images, and respond to touch input.
**注意:**如果 VEX AIR 无人机已与控制器配对,则打印屏幕顶部将显示一个计时器,指示当前项目的已用时间。任何文本或绘图都将显示在计时器后面。
Below is a list of available blocks:
Cursor Print - Display text and manage the print cursor.
print on screen — Prints text, numbers, or variable values on the controller screen.
将光标设置到屏幕上的行列 — 将光标移动到指定的行和列。
将光标移至屏幕上的下一行 — 将光标移至下一行的第 1 列。
清除屏幕上的行 — 清除指定的一行文本。
screen cursor column — Reports the column number where text will be printed.
screen cursor row — Reports the row number where text will be printed.
XY 打印 - 在基于像素的坐标处打印文本。
print at coordinate on screen — Prints text, numbers, or variable values at a specific x and y coordinate.
set screen origin — Changes the origin (0, 0) used for coordinate-based printing and drawing.
Settings - Change the appearance of text, graphics, and screen display.
clear screen — Erases all text, drawings, and images from the screen.
wait for screen to render — Switches screen drawing to render-later behavior.
fill screen — Erases all text, drawings, and images from the screen, then sets the screen’s background color.
设置屏幕字体 — 更改文本显示的字体类型和大小。
set print precision on screen — Sets how many decimal places to show when printing numbers.
set pen width on screen — Sets the thickness of drawn lines and shape outlines.
set pen / font color on screen — Sets the color of text, pixels, lines, and shape outlines.
set text fill color on screen – Sets the fill color behind printed text.
set draw fill color on screen — Sets the fill color for drawn shapes.
绘制——创建图形和视觉元素。
在屏幕上显示图像文件 — 在屏幕上显示用户上传的图像。
draw pixel on screen — Draws one pixel at a specified coordinate.
在屏幕上绘制线条 — 在两点之间绘制一条线。
在屏幕上绘制矩形 — 绘制一个具有指定尺寸的矩形。
在屏幕上绘制圆 — 绘制一个具有给定半径的圆。
触摸 - 检测屏幕交互。
screen pressed — Reports whether the screen is currently being pressed.
screen position — Reports the x- or y-coordinate of the last screen press.
when screen event — Runs when the screen is pressed or released.
光标打印#
屏幕打印#
The print on screen stack block prints text, numbers, or variable values on the controller screen at the current cursor position and font.
在屏幕上打印 [VEXcode]▶
参数 |
描述 |
|---|---|
价值 |
The text, number, or variable value to print on the screen. |
and set cursor to next row |
Select the arrow ( ▶ ) to expand the block to say and set cursor to next row, so the cursor moves to column 1 of the next row after printing. |
例子
当开始
[Display a message at the starting cursor position.]
在屏幕上打印 [Time to fly!]▶

将光标设置到屏幕上的行列#
The set cursor to row column on screen stack block moves the cursor to a specific row and column on the controller screen. The next print on screen block will start printing at that location.
The number of characters that can fit on the screen depends on the selected font. With the default monospaced medium font, up to 18 rows and 53 columns can be displayed clearly. Text placed beyond this range may be cut off or become difficult to read.
在屏幕上设定光标至 [1] 行 [1] 列
参数 |
描述 |
|---|---|
排 |
The row to move the cursor to. |
柱子 |
The column to move the cursor to. |
示例
当开始
[Display text starting at Row 7 Column 25.]
在屏幕上设定光标至 [7] 行 [25] 列
在屏幕上打印 [Row 7, Column 25]▶

将光标移至屏幕上的下一行#
The set cursor to next row on screen stack block moves the cursor to column 1 on the next row on the controller screen.
在屏幕上设定光标至下一行
参数 |
描述 |
|---|---|
该块没有参数。 |
例子
当开始
[Display two lines of text.]
在屏幕上打印 [Line 1]▶
在屏幕上设定光标至下一行
在屏幕上打印 [Line 2]▶

屏幕上的清除行#
The clear row on screen stack block clears a row of text on the controller screen.
清除屏幕第 [1] 行
参数 |
描述 |
|---|---|
排 |
要清除的行号。 |
例子
当开始
[Clear only the second row of text.]
在屏幕上打印 [This text stays]▶
在屏幕上设定光标至下一行
在屏幕上打印 [This text disappears]▶
等待 [3] 秒
清除屏幕第 [2] 行
屏幕光标列#
The screen cursor column reporter block reports the column number where text will be printed as an integer.
(屏幕光标列数)
参数 |
描述 |
|---|---|
该块没有参数。 |
例子
当开始
[Display the cursor's current column.]
在屏幕上设定光标至 [7] 行 [25] 列
在屏幕上打印 (屏幕光标列数)▶

屏幕光标行#
The screen cursor row reporter block reports the row number where text will be printed as an integer.
(屏幕光标行数)
参数 |
描述 |
|---|---|
该块没有参数。 |
例子
当开始
[Display the cursor's current row.]
在屏幕上设定光标至 [7] 行 [25] 列
在屏幕上打印 (屏幕光标行数)▶

XY打印#
在屏幕上的坐标处打印#
The print at coordinate on screen stack block prints text, numbers, or variable values on the controller screen at a specific (x, y) position in pixels, using the current font and origin. x sets how far from the left side the text begins, and y sets where the bottom of the letters sit. This block disregards the current cursor position.
在屏幕x:[80] y:[120]上打印 [VEXcode]
参数 |
描述 |
|---|---|
价值 |
The text, number, or variable value to print on the screen. |
x |
x 坐标(以像素为单位)(0 到 640,其中 0 为左,640 为右)。 |
y |
y 坐标(以像素为单位)(0 到 480,其中 0 为顶部,480 为底部)。 |
例子
当开始
[Display a message starting in the middle of the screen.]
在屏幕x:[320] y:[240]上打印 [Hello, drone!]

设置屏幕原点#
The set screen origin stack block sets the origin (0, 0) used for drawing and coordinate-based printing on the controller 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.
设置屏幕原点 x: [0] y: [0]
参数 |
描述 |
|---|---|
x |
设置新原点的 x 坐标(以像素为单位)。 |
y |
设置新原点的 y 坐标(以像素为单位)。 |
例子
当开始
[Set the origin to the center of the screen.]
设置屏幕原点 x: [320] y: [240]
[Draw a rectangle at the new origin.]
在屏幕 [0] [0] [80] [40] 上画矩形

设置#
清除屏幕#
The clear screen stack block clears all drawings, text, and images from the controller screen.
清屏
参数 |
描述 |
|---|---|
该块没有参数。 |
例子
当开始
[Draw a circle, and clear it after 2 seconds.]
在屏幕 [320] [240] [80] 上画圆形
等待 [2] 秒
清屏
等待屏幕渲染#
The wait for screen to render stack block switches screen drawing to render-later behavior. Once this block runs, following screen blocks will not appear on the controller screen until the next wait for screen to render block runs.
Note: Use this block before drawing a group of text, shapes, or images, then use it again to render the full update at once.
等待屏幕渲染
参数 |
描述 |
|---|---|
该块没有参数。 |
例子
当开始
[Display text and images when button 7 is pressed.]
等待屏幕渲染
在屏幕上打印 [Screen rendered!]▶
在屏幕 [320] [240] [80] 上画圆形
等到 <遥控器按键 [7 v] 按下了?>
等待屏幕渲染

填满屏幕#
The fill screen stack block clears all drawings, text, and images from the controller screen, then changes the background to a specified color.
屏幕填充色为 [红色 v]
参数 |
描述 |
|---|---|
颜色 |
The color to change the background to:
|
例子
当开始
[Say "Hello" then turn screen green.]
在屏幕上打印 [Hello]▶
等待 [2] 秒
屏幕填充色为 [绿色 v]

设置屏幕上的字体#
The set font on screen stack block sets the font and size used for displaying text on the controller screen. This font will apply to all text printed after this block runs.
设定屏幕字体为 [等宽字体 v] [中 v]
参数 |
描述 |
|---|---|
类型 |
The font type: monospaced or proportional. |
尺寸 |
The font size (shown below):
|
|
与上一张图片相同,现在使用 Mono 15 字体。字母 AZ 位于一行,占据屏幕近一半的宽度。左下角显示 |
与上一张图片相同,现在使用 Mono 20 字体。字母 AZ 位于一行,占据屏幕宽度的一半。左下角显示“53 个字符, |
|---|---|---|
与上一张图片相同,现在使用 Mono 24 字体。字母 AZ 位于一行,占据屏幕宽度的一半多一点。左下角显示“45/_static/img/fonts/MONO24-hornet.png字符, |
与上一张图片相同,现在使用 Mono 30 字体。字母 AZ 位于一行,占据屏幕宽度/_static/img/fonts/MONO30-hornet.png大约四分之三。左下角显示“35 个字符, |
与上一张图片相同,现在使用 Mono 40 字体。字母 AZ 位于一行,横跨屏幕宽度。左下角显示“26 个字符, |
与上一张图片相同,现在使用 Mono 60 字体。字母 AQ 位于一行,横跨屏幕宽度。左下角显示 17/_static/img/fonts/MONO60-hornet.png字符, |
|
|
|
|
|
例子
当开始
[Display text using a larger font.]
设定屏幕字体为 [等宽字体 v] [特大 v]
在屏幕上打印 [VEX]▶

设置屏幕打印精度#
The set print precision on screen stack block sets how many decimal places are shown when numbers are printed on the controller screen. This print precision will apply to all numbers printed after this block runs.
在屏幕上设定打印精度为 [0.1 v]
参数 |
描述 |
|---|---|
精确 |
Sets the print precision to:
|
例子
当开始
[Print 1/3 as 0.33.]
在屏幕上设定打印精度为 [0.01 v]
在屏幕上打印 ([1] [math_division v] [3])▶

设置屏幕上的笔宽#
The set pen width on screen stack block sets the thickness of drawn lines and shape outlines.
设定屏幕笔宽为 [10]
参数 |
描述 |
|---|---|
宽度 |
笔的宽度(以像素为单位)。 |
例子
当开始
[Draw a rectangle with a pen width of 10.]
设定屏幕笔宽为 [10]
在屏幕 [200] [200] [200] [80] 上画矩形

设置屏幕上的笔/字体颜色#
The set pen / font color on screen stack block sets the color of text, pixels, lines, and shape outlines. The default color is white.
设定屏幕笔/字体颜色为 [红色 v]
例子
参数 |
描述 |
|---|---|
颜色 |
The pen and font color to use:
|
当开始
[Draw a rectangle with an orange outline.]
设定屏幕笔/字体颜色为 [orange v]
在屏幕 [200] [150] [240] [150] 上画矩形
设定屏幕笔/字体颜色为 [white v]
print [VEXcode AIR] at x: [250] y: [220] on screen

设置屏幕上的文本填充颜色#
The set text fill color on screen stack block sets the fill color behind printed text. The default text fill color is transparent.
将屏幕上的文本填充颜色设置为 [红色 v]
参数 |
描述 |
|---|---|
颜色 |
The text fill color to use:
|
示例
当开始 :: hat events
[Display two colors behind text.]
将屏幕上的文本填充颜色设置为 [红色 v]
在屏幕上打印 ["Red"]▶
在屏幕上设定光标至下一行
将屏幕上的文本填充颜色设置为 [蓝色 v]
在屏幕上打印 ["Blue"]▶
设置屏幕上的绘制填充颜色#
The set draw fill color on screen stack block sets the fill color used when shapes are drawn. The default fill color is black.
将屏幕上的绘制填充颜色设置为 [红色 v]
参数 |
描述 |
|---|---|
颜色 |
The shape fill color to use:
|
示例
当开始
[Draw an orange-filled rectangle with text on top.]
将屏幕上的绘制填充颜色设置为 [orange v]
在屏幕 [200] [150] [240] [150] 上画矩形
print [VEXcode AIR] at x: [250] y: [220] on screen

画#
在屏幕上显示图像文件#
The show image file on screen stack block draws a custom user-uploaded image on the controller screen at the set origin.
显示图像文件 [IMAGE1 v]
参数 |
描述 |
|---|---|
图像编号 |
要使用的用户上传的图片。如果在控制面板中编辑了图片名称,选项将会更改。 |
例子
当开始
[Display custom image on screen.]
显示图像文件 [IMAGE1 v]
在屏幕上绘制像素#
The draw pixel on screen stack block draws one pixel at the selected x and y coordinate using the current pen color.
在屏幕 [0] [0] 上画点
参数 |
描述 |
|---|---|
x |
The x-coordinate to draw the pixel from 0 to 640. |
y |
The y-coordinate to draw the pixel from 0 to 480. |
例子
当开始
[Draw five pixels in a diagonal.]
在屏幕 [360] [200] 上画点
在屏幕 [340] [220] 上画点
在屏幕 [320] [240] 上画点
在屏幕 [300] [260] 上画点
在屏幕 [280] [280] 上画点
![]()
在屏幕上画线#
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.
在屏幕 [0] [0] [10] [10] 上画线段
参数 |
描述 |
|---|---|
x1 |
The x-coordinate in pixels of the start of the line from 0 to 640. |
y1 |
The y-coordinate in pixels of the start of the line from 0 to 480. |
x2 |
The x-coordinate in pixels of the end of the line from 0 to 640. |
y2 |
The y-coordinate in pixels of the end of the line from 0 to 480. |
例子
当开始
[Make an X across the screen.]
在屏幕 [0] [0] [640] [480] 上画线段
设定屏幕笔/字体颜色为 [cyan v]
在屏幕 [0] [480] [640] [0] 上画线段

在屏幕上绘制矩形#
The draw rectangle on screen stack block draws a rectangle using the current pen width, pen color, and fill color.
在屏幕 [0] [0] [10] [10] 上画矩形
例子
参数 |
描述 |
|---|---|
x |
The x-coordinate in pixels of the top-left corner of the rectangle from 0 to 640. |
y |
The y-coordinate in pixels of the top-left corner of the rectangle from 0 to 480. |
宽度 |
矩形的宽度(以像素为单位)。 |
高度 |
矩形的高度(以像素为单位)。 |
当开始
[Draw two rectangles on the screen.]
在屏幕 [0] [0] [620] [460] 上画矩形
将屏幕上的绘制填充颜色设置为 [绿色 v]
在屏幕 [200] [180] [200] [100] 上画矩形

在屏幕上画一个圆#
The draw circle on screen stack block draws a circle using the current pen width, pen color, and fill color.
在屏幕 [0] [0] [10] 上画圆形
参数 |
描述 |
|---|---|
x |
The x-coordinate in pixels of the center of the circle from 0 to 640. |
y |
The y-coordinate in pixels of the center of the circle from 0 to 480. |
半径 |
圆的半径(以像素为单位)。 |
例子
当开始
[Draw one green circle on the screen.]
将屏幕上的绘制填充颜色设置为 [绿色 v]
在屏幕 [320] [240] [200] 上画圆形

触碰#
screen pressed#
The screen pressed Boolean block reports whether the controller’s screen is currently being pressed.
True - Screen is currently being pressed
False - Screen is not being pressed
<屏幕按下了?>
参数 |
描述 |
|---|---|
该块没有参数。 |
例子
当开始
[Play a sound when the screen is pressed.]
永久循环
如果 <屏幕按下了?> 那么
播放音符 [低 v] [C v] [note_eight v] ▶
当开始
[Display different messages after the screen is pressed.]
等到 <屏幕按下了?>
在屏幕上打印 [First message!]▶
在屏幕上设定光标至下一行
[Lift finger to press the screen again.]
等到 <非 <屏幕按下了?>>
等到 <屏幕按下了?>
在屏幕上打印 [Second message!]▶
屏幕位置#
The screen position reporter block reports the x- or y-coordinate in pixels where the screen was last pressed. The return value for x is between 0 (left) and 640 (right). The return value for y is between 0 (top) and 480 (bottom).

(屏幕 [X v] 坐标)
参数 |
描述 |
|---|---|
协调 |
The coordinate of the last screen press in pixels: x reports the horizontal position, and y reports the vertical position. |
例子
当开始
[Play high or low note based on where screen is pressed.]
永久循环
如果 <屏幕按下了?> 那么
如果 <(屏幕 [X v] 坐标) [math_greater_than v] [320]> 那么
播放音符 [高 v] [C v] [note_eight v] ▶
否则
播放音符 [低 v] [C v] [note_eight v] ▶
当屏幕事件#
The when screen event hat block runs when the controller screen is pressed or released.
当屏幕 [pressed v]
参数 |
描述 |
|---|---|
行动 |
Determines when the attached stack of blocks will run: pressed runs when the screen is pressed, and released runs when the screen is released. |
例子
当屏幕 [pressed v]
[Play a sound when the screen is pressed.]
播放声音 [成功 v] ▶





