Go to the source code of this file.
Functions | |
| void | ui::begin (bool require_touch=false) |
| Initialize the screen. | |
| void | ui::setRotation (rotation_t rotation) |
| Set the screen rotation. | |
| rotation_t | ui::getRotation () |
| Get the current screen rotation. | |
| bool | ui::rotationChanged () |
| Check if the screen rotation has changed since the last render cycle. | |
| void | ui::finalizeRotation () |
| After a render cycle has completed, set the screen rotation to not changed. | |
| void | ui::drawPixel (coord_t x, coord_t y, color_t color) |
| Render a pixel to the screen, accounting for rotation. | |
| void | ui::fillScreen (color_t color) |
| Fill the screen with a color. | |
| void | ui::drawFastVLine (coord_t x, coord_t y, coord_t h, color_t color) |
| Draw a hardware-accelerated vertical line. | |
| void | ui::drawFastHLine (coord_t x, coord_t y, coord_t w, color_t color) |
| Draw a hardware-accelerated horizontal line. | |
| void | ui::endWrite () |
| Flush data to the screen. | |
| void | ui::setCursor (coord_t x, coord_t y) |
| Set the current position for rendering text. | |
| void | ui::setTextSize (uint8_t size) |
| Set the scaling factor for rendering text. | |
| void | ui::setTextColor (color_t color) |
| Set the color of rendered text. | |
| void | ui::setTextWrap (bool wrap) |
| Set whether text wraps. | |
| void | ui::print (const String &str) |
| Write text to the screen. | |
| uisize_t | ui::width () |
| Get the screen width, adjusted for rotation. | |
| uisize_t | ui::height () |
| Get the screen height, adjusted for rotation. | |
| Event | ui::getTouchEvent () |
| Check for a touchscreen event. | |
| void | ui::fillRoundRect (coord_t x, coord_t y, coord_t width, coord_t height, radius_t radius, color_t color) |
| Draw a filled rectangle with rounded corners. | |
| void | ui::drawRect (coord_t x, coord_t y, coord_t width, coord_t height, color_t color) |
| Draw a rectangle. | |
| void | ui::drawBitmap (coord_t x, coord_t y, uint8_t *bitmap, coord_t w, coord_t h, color_t color) |
| Draw a single-color bitmap. | |
| void | ui::drawRGBBitmap (coord_t x, coord_t y, color_t *bitmap, coord_t w, coord_t h) |
| Draw an RGB bitmap without transparency. | |
| void | ui::drawRGBBitmap (coord_t x, coord_t y, color_t *bitmap, uint8_t *mask, coord_t w, coord_t h) |
| Draw an RGB bitmap with a transparency mask. | |
| void | ui::drawLine (coord_t x0, coord_t y0, coord_t x1, coord_t y1, color_t color) |
| Draw an arbitrary single-pixel line. | |
| void | ui::drawCircle (coord_t x, coord_t y, radius_t radius, color_t color, bool fill) |
| Draw a circle. | |
| void | ui::drawEllipse (coord_t x, coord_t y, radius_t radius1, radius_t radius2, color_t color, bool fill) |
| Draw an ellipse. | |
This file contains low-level functions for rendering directly to the screen.
| void ui::begin | ( | bool | require_touch = false | ) |
Initialize the screen.
| require_touch | If true and the touchscreen failed to initialize, spit out a fatal error and halt execution. |
Draw a single-color bitmap.
| x | The horizontal coordinate. |
| y | The vertical coordinate. |
| bitmap | The bitmap data to render. |
| w | The horizontal size of the bitmap. |
| h | The vertical size of the bitmap. |
| color | The color to render non-zero pixels as. |
Draw a circle.
| x | The horizontal coordinate. |
| y | The vertical coordinate. |
| radius | The circle radius. |
| color | The color of the circle. |
| fill | Whether to fill the circle or just draw an outline. |
| void ui::drawEllipse | ( | coord_t | x, |
| coord_t | y, | ||
| radius_t | radius1, | ||
| radius_t | radius2, | ||
| color_t | color, | ||
| bool | fill | ||
| ) |
Draw an ellipse.
| x | The horizontal coordinate. |
| y | The vertical coordinate. |
| radius1 | The horizontal radius. |
| radius2 | The vertical radius. |
| color | The color of the ellipse. |
| fill | Whether to fill the ellipse or just draw an outline. |
Draw a hardware-accelerated horizontal line.
| x | The horizontal coordinate. |
| y | The vertical coordinate. |
| w | The length of the line, in pixels. |
| color | The color of the line. |
Draw a hardware-accelerated vertical line.
| x | The horizontal coordinate. |
| y | The vertical coordinate. |
| h | The height of the line, in pixels. |
| color | The color of the line. |
Draw an arbitrary single-pixel line.
| x0 | The starting horizontal coordinate. |
| y0 | The starting vertical coordinate. |
| x1 | The ending horizontal coordinate. |
| y1 | The ending vertical coordinate. |
| color | The color of the line. |
Render a pixel to the screen, accounting for rotation.
| x | The horizontal coordinate. |
| y | The vertical coordinate. |
| color | The color of the pixel. |
Draw a rectangle.
| x | The horizontal coordinate. |
| y | The vertical coordinate. |
| width | The horizontal size of the rectangle. |
| height | The vertical size of the rectangle. |
| color | The color of the rectangle. |
Draw an RGB bitmap without transparency.
| x | The horizontal coordinate. |
| y | The vertical coordinate. |
| bitmap | The bitmap data to render. |
| w | The horizontal size of the bitmap. |
| h | The vertical size of the bitmap. |
| void ui::drawRGBBitmap | ( | coord_t | x, |
| coord_t | y, | ||
| color_t * | bitmap, | ||
| uint8_t * | mask, | ||
| coord_t | w, | ||
| coord_t | h | ||
| ) |
Draw an RGB bitmap with a transparency mask.
| x | The horizontal coordinate. |
| y | The vertical coordinate. |
| bitmap | The bitmap data to render. |
| mask | The 1-bit transparency mask. |
| w | The horizontal size of the bitmap. |
| h | The vertical size of the bitmap. |
| void ui::fillRoundRect | ( | coord_t | x, |
| coord_t | y, | ||
| coord_t | width, | ||
| coord_t | height, | ||
| radius_t | radius, | ||
| color_t | color | ||
| ) |
Draw a filled rectangle with rounded corners.
| x | The horizontal coordinate. |
| y | The vertical coordinate. |
| width | The horizontal size of the rectangle. |
| height | The vertical size of the rectangle. |
| radius | The radius of the curved corners. |
| color | The color of the rectangle. |
| void ui::fillScreen | ( | color_t | color | ) |
Fill the screen with a color.
| color | The color to fill. |
| rotation_t ui::getRotation | ( | ) |
Get the current screen rotation.
| Event ui::getTouchEvent | ( | ) |
Check for a touchscreen event.
| uisize_t ui::height | ( | ) |
Get the screen height, adjusted for rotation.
| void ui::print | ( | const String & | str | ) |
Write text to the screen.
| str | The string to write. |
| bool ui::rotationChanged | ( | ) |
Check if the screen rotation has changed since the last render cycle.
Set the current position for rendering text.
| x | The horizontal coordinate. |
| y | The vertical coordinate. |
| void ui::setRotation | ( | rotation_t | rotation | ) |
Set the screen rotation.
| rotation | The new screen rotation; one of 4 cardinal directions. |
| void ui::setTextColor | ( | color_t | color | ) |
Set the color of rendered text.
| color | The text color. |
| void ui::setTextSize | ( | uint8_t | size | ) |
Set the scaling factor for rendering text.
| size | The scaling factor. |
| void ui::setTextWrap | ( | bool | wrap | ) |
Set whether text wraps.
| wrap | If true, wrap text. If false, do not wrap. |
| uisize_t ui::width | ( | ) |
Get the screen width, adjusted for rotation.