roo_display
API Documentation for roo_display
Loading...
Searching...
No Matches
roo_display::TileOf< DrawableType > Class Template Reference

Tile with embedded interior object. More...

#include <tile.h>

Inheritance diagram for roo_display::TileOf< DrawableType >:
[legend]
Collaboration diagram for roo_display::TileOf< DrawableType >:
[legend]

Public Member Functions

 TileOf (DrawableType interior, Box extents, Alignment alignment, Color bgcolor=color::Background)
 Create a tile with embedded interior 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 DrawableEmpty ()
 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
 

Detailed Description

template<typename DrawableType>
class roo_display::TileOf< DrawableType >

Tile with embedded interior object.

Useful when returning a tile without keeping a separate interior object.

Definition at line 105 of file tile.h.

Constructor & Destructor Documentation

◆ TileOf()

template<typename DrawableType >
roo_display::TileOf< DrawableType >::TileOf ( DrawableType  interior,
Box  extents,
Alignment  alignment,
Color  bgcolor = color::Background 
)
inline

Create a tile with embedded interior and alignment.

Definition at line 108 of file tile.h.

Member Function Documentation

◆ drawTo()

template<typename DrawableType >
void roo_display::TileOf< DrawableType >::drawTo ( const Surface s) const
inlineoverridevirtual

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.

Definition at line 113 of file tile.h.


The documentation for this class was generated from the following file: