pros/screen.h file

Brain screen display and touch functions.

Contains user calls to the v5 screen for touching and displaying graphics.

This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0. If a copy of the MPL was not distributed with this file, You can obtain one at http://mozilla.org/MPL/2.0/.

Namespaces

namespace pros
LLEMU Conditional Include
namespace pros::c

Screen Graphical Display Functions

These functions allow programmers to display shapes on the v5 screen

uint32_t screen_set_pen(uint32_t color)
Set the pen color for subsequent graphics operations.
uint32_t screen_set_eraser(uint32_t color)
Set the eraser color for erasing and the current background.
uint32_t screen_get_pen(void)
Get the current pen color.
uint32_t screen_get_eraser(void)
Get the current eraser color.
uint32_t screen_erase(void)
Clear display with eraser color.
uint32_t screen_scroll(int16_t start_line, int16_t lines)
Scroll lines on the display upwards.
uint32_t screen_scroll_area(int16_t x0, int16_t y0, int16_t x1, int16_t y1, int16_t lines)
Scroll lines within a region on the display.
uint32_t screen_copy_area(int16_t x0, int16_t y0, int16_t x1, int16_t y1, uint32_t* buf, int32_t stride)
Copy a screen region (designated by a rectangle) from an off-screen buffer to the screen.
uint32_t screen_draw_pixel(int16_t x, int16_t y)
Draw a single pixel on the screen using the current pen color.
uint32_t screen_erase_pixel(int16_t x, int16_t y)
Erase a pixel from the screen (Sets the location)
uint32_t screen_draw_line(int16_t x0, int16_t y0, int16_t x1, int16_t y1)
Draw a line on the screen using the current pen color.
uint32_t screen_erase_line(int16_t x0, int16_t y0, int16_t x1, int16_t y1)
Erase a line on the screen using the current eraser color.
uint32_t screen_draw_rect(int16_t x0, int16_t y0, int16_t x1, int16_t y1)
Draw a rectangle on the screen using the current pen color.
uint32_t screen_erase_rect(int16_t x0, int16_t y0, int16_t x1, int16_t y1)
Erase a rectangle on the screen using the current eraser color.
uint32_t screen_fill_rect(int16_t x0, int16_t y0, int16_t x1, int16_t y1)
Fill a rectangular region of the screen using the current pen color.
uint32_t screen_draw_circle(int16_t x, int16_t y, int16_t radius)
Draw a circle on the screen using the current pen color.
uint32_t screen_erase_circle(int16_t x, int16_t y, int16_t radius)
Erase a circle on the screen using the current eraser color.
uint32_t screen_fill_circle(int16_t x, int16_t y, int16_t radius)
Fill a circular region of the screen using the current pen color.

Screen Text Display Functions

These functions allow programmers to display text on the v5 screen

uint32_t screen_print(text_format_e_t txt_fmt, const int16_t line, const char* text, ...)
Print a formatted string to the screen on the specified line.
uint32_t screen_print_at(text_format_e_t txt_fmt, const int16_t x, const int16_t y, const char* text, ...)
Print a formatted string to the screen at the specified point.
uint32_t screen_vprintf(text_format_e_t txt_fmt, const int16_t line, const char* text, va_list args)
Print a formatted string to the screen on the specified line.
uint32_t screen_vprintf_at(text_format_e_t txt_fmt, const int16_t x, const int16_t y, const char* text, va_list args)
Print a formatted string to the screen at the specified coordinates.

Screen Touch Functions

These functions allow programmers to access information about screen touches

screen_touch_status_s_t screen_touch_status(void)
Gets the touch status of the last touch of the screen.
uint32_t screen_touch_callback(touch_event_cb_fn_t cb, last_touch_e_t event_type)
Assigns a callback function to be called when a certain touch event happens.

Enums

enum text_format_e_t { E_TEXT_SMALL = 0, E_TEXT_MEDIUM, E_TEXT_LARGE, E_TEXT_MEDIUM_CENTER, E_TEXT_LARGE_CENTER }
enum last_touch_e_t { E_TOUCH_RELEASED = 0, E_TOUCH_PRESSED, E_TOUCH_HELD, E_TOUCH_ERROR }

Typedefs

using touch_event_cb_fn_t = void(*)()

Defines

#define _GNU_SOURCE