pros/screen.hpp file

Contents

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::screen

Functions

std::uint32_t set_pen(pros::Color color)
Screen Graphical Display Functions
std::uint32_t set_pen(std::uint32_t color)
Set the pen color for subsequent graphics operations.
std::uint32_t set_eraser(pros::Color color)
Set the eraser color for erasing and the current background.
std::uint32_t set_eraser(std::uint32_t color)
Set the eraser color for erasing and the current background.
std::uint32_t get_pen()
Get the current pen color.
std::uint32_t get_eraser()
Get the current eraser color.
std::uint32_t erase()
Clear display with eraser color.
std::uint32_t scroll(const std::int16_t start_line, const std::int16_t lines)
Scroll lines on the display upwards.
std::uint32_t scroll_area(const std::int16_t x0, const std::int16_t y0, const std::int16_t x1, const std::int16_t y1, std::int16_t lines)
Scroll lines within a region on the display.
std::uint32_t copy_area(const std::int16_t x0, const std::int16_t y0, const std::int16_t x1, const std::int16_t y1, uint32_t* buf, const std::int32_t stride)
Copy a screen region (designated by a rectangle) from an off-screen buffer to the screen.
std::uint32_t draw_pixel(const std::int16_t x, const std::int16_t y)
Draw a single pixel on the screen using the current pen color.
std::uint32_t erase_pixel(const std::int16_t x, const std::int16_t y)
Erase a pixel from the screen (Sets the location)
std::uint32_t draw_line(const std::int16_t x0, const std::int16_t y0, const std::int16_t x1, const std::int16_t y1)
Draw a line on the screen using the current pen color.
std::uint32_t erase_line(const std::int16_t x0, const std::int16_t y0, const std::int16_t x1, const std::int16_t y1)
Erase a line on the screen using the current eraser color.
std::uint32_t draw_rect(const std::int16_t x0, const std::int16_t y0, const std::int16_t x1, const std::int16_t y1)
Draw a rectangle on the screen using the current pen color.
std::uint32_t erase_rect(const std::int16_t x0, const std::int16_t y0, const std::int16_t x1, const std::int16_t y1)
Erase a rectangle on the screen using the current eraser color.
std::uint32_t fill_rect(const std::int16_t x0, const std::int16_t y0, const std::int16_t x1, const std::int16_t y1)
Fill a rectangular region of the screen using the current pen color.
std::uint32_t draw_circle(const std::int16_t x, const std::int16_t y, const std::int16_t radius)
Draw a circle on the screen using the current pen color.
std::uint32_t erase_circle(const std::int16_t x, const std::int16_t y, const std::int16_t radius)
Erase a circle on the screen using the current eraser color.
std::uint32_t fill_circle(const std::int16_t x, const std::int16_t y, const std::int16_t radius)
Fill a circular region of the screen using the current pen color.
screen_touch_status_s_t touch_status()
Screen Text Display Functions
std::uint32_t 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.
__attribute__((weak))
Displays a formatted string on the emulated three-button LCD screen.

Function documentation

__attribute__((weak))

Displays a formatted string on the emulated three-button LCD screen.

Returns True if the operation was successful, or false otherwise, setting errno values as specified above.

This function uses the following values of errno when an error state is reached: ENXIO - The LCD has not been initialized. Call lcd_initialize() first. EINVAL - The line number specified is not in the range [0-7]