#include <DrawingPrimitives.h>
Public Types | |
enum | IconType : uint8_t { ICON_XBITMAP , ICON_MONO , ICON_PALLETE_2BPP , ICON_PALLETE_4BPP , ICON_NATIVE } |
enum | MemoryLocation : uint8_t { STORED_IN_ROM , STORED_IN_RAM , LOAD_FROM_STORAGE } |
Public Member Functions | |
DrawableIcon () | |
DrawableIcon (const DrawableIcon &other)=default | |
DrawableIcon & | operator= (const DrawableIcon &other)=default |
DrawableIcon (uint16_t id, const Coord &size, IconType ty, const uint8_t *normal, const uint8_t *selected=nullptr) | |
DrawableIcon (uint16_t id, const Coord &size, IconType ty, const color_t *paletteEntries, const uint8_t *normal, const uint8_t *selected=nullptr) | |
const uint8_t * | getIcon (bool selected) const |
const color_t * | getPalette () const |
Coord | getDimensions () const |
IconType | getIconType () const |
uint16_t | getKey () const |
void | setFromValues (const Coord &size, IconType ty, const uint8_t *normal, const uint8_t *selected=nullptr) |
Represents an icon that can be presented for actionable menu items such as submenus, boolean items, and action items. It can have two items states, one for selected and one for normal.
enum tcgfx::DrawableIcon::IconType : uint8_t |
enum tcgfx::DrawableIcon::MemoryLocation : uint8_t |
|
inline |
Creates an empty drawable icon, used mainly by collection support
|
default |
Copy constructor to copy an existing drawable icon
|
inline |
Create a drawable icon providing the size, icon type, and image data
id | the menu id that this icon belongs to |
size | the size of the image, better to be in whole byte sizes |
ty | the type of the image, so the renderer knows what to do with it. |
normal | the image in the normal state. |
selected | the image in the selected state. |
|
inline |
Create a drawable icon providing the size, icon type, and image data along with a palette, this is suited for 2 and 4 bit per pixel images
id | the menu id that this icon belongs to |
size | the size of the image, better to be in whole byte sizes |
palette | the palette data for the image, will define this as a palette based image |
normal | the image in the normal state. |
selected | the image in the selected state. |
|
inline |
Get the icon data for the current state
selected | true if the item is selected (IE pressed or ON for booleans) |
|
inline |
Get the palette information (if available) for this icon
|
inline |
|
inline |