|
roo_display
API Documentation for roo_display
|
Rectangular drawable with background and aligned interior. More...
#include <tile.h>
Public Member Functions | |
| Tile (const Drawable *interior, Box extents, Alignment alignment, Color bgcolor=color::Background) | |
| Create a tile with the specified interior, extents, and alignment. | |
| void | drawTo (const Surface &s) const override |
| Draw this object's content, respecting the fill mode. | |
Public Member Functions inherited from roo_display::internal::TileBase | |
| TileBase (const Drawable &interior, Box extents, Alignment alignment, Color bgcolor=color::Background) | |
| void | setBgColor (Color bgcolor) |
| void | setBackground (const Rasterizable *background) |
| Box | extents () const override |
| Return the bounding box encompassing all pixels that need to be drawn. | |
Public Member Functions inherited from roo_display::Drawable | |
| virtual | ~Drawable () |
| virtual Box | anchorExtents () const |
| Return the bounds used for alignment. | |
Additional Inherited Members | |
Static Public Member Functions inherited from roo_display::Drawable | |
| static const Drawable * | Empty () |
| A singleton representing a no-op drawable with no bounding box. | |
Protected Member Functions inherited from roo_display::internal::TileBase | |
| void | draw (const Surface &s, const Drawable &interior) const |
| void | drawInternal (const Surface &s, const Drawable &interior) const |
Rectangular drawable with background and aligned interior.
Useful for UI widgets (icons, text boxes, etc.). Handles alignment and flicker-minimized redraws.
Alignment: the interior is positioned inside the tile using the alignment specification (horizontal and vertical anchors plus optional offsets).
Flickerless redraws: the tile is drawn as up to 5 non-overlapping sections (top, left, interior, right, bottom) to avoid double draws.
Semi-transparent backgrounds are supported. The tile background is alpha-blended over the draw-time background color.
Draw this object's content, respecting the fill mode.
If s.fill_mode() == FillMode::kExtents, the method must fill the entire (clipped) extents() rectangle (using s.bgcolor() for transparent parts).
The default implementation fills the clipped extents() rectangle with bgcolor and then calls drawInteriorTo(). That can cause flicker, so override this method if a better implementation is possible.
The implementation must respect surface parameters, particularly clip_box(), and must not draw outside it. The surface clip box is pre-clipped to fit within this drawable's extents().
Reimplemented from roo_display::Drawable.