#include <GfxMenuConfig.h>
Static Public Member Functions | |
static void | refreshCache () |
Provides full support for configurability of menu items, in terms of the their grid position and also any associated icons and drawing color / font / padding overrides. Each time the renderer sets up a new menu, it calls into here for each item to find out what settings to use for drawing. It is therefore possible to adjust settings either globally, by sub menu, or for a given menu item. This class also stores icon definitions by menu item, so any items that are set to draw as icons will look in that cache. After updating any drawing values, you should call refreshCache() to ensure it is picked up.
|
inlineoverridevirtual |
Get the icon associated with a menu ID or nullptr if not available.
id | the menu id |
Implements tcgfx::ItemDisplayPropertiesFactory.
|
inlineoverridevirtual |
Gets the grid position override for a given menu item if one is available, or nullptr if not.
pItem | the menu item to get the override for |
Implements tcgfx::ItemDisplayPropertiesFactory.
|
overridevirtual |
Get the display configuration for a given item given a component type. This will search for an item at the menu item level first, then at the sub menu item level, and finally it will use the default. It is always safe to call this function, it never returns nullptr.
pItem | the item for which we want properties |
compType | the component type we are drawing |
Implements tcgfx::ItemDisplayPropertiesFactory.
|
overridevirtual |
Get the display configuration for the submenu on display and therefore avoiding checking at the item level. Only checks at the sub menu item level, and finally it will use the default. It is always safe to call this function, it never returns nullptr.
compType | the component type we are drawing |
Implements tcgfx::ItemDisplayPropertiesFactory.
|
inlineoverridevirtual |
Gets the selected color for a particular color type (such as background, text etc)
colorType | the color type we need |
Implements tcgfx::ItemDisplayPropertiesFactory.
|
inlineoverridevirtual |
Adds a new grid position for a particular menu item to the cache of grid positions. Grid positions are stored by menu item and override how and where an item is drawn in the grid.
pItem | the item who's position is being overridden |
position | the position override |
Implements tcgfx::ItemDisplayPropertiesFactory.
|
inline |
Adds an icon image to the cache by menu ID. When there is a grid position override that has icon drawing as its rendering type, then the image will be looked up using this cache.
toAdd | the icon image to add. |
|
inline |
Sets the drawing properties that should be used when no overrides exist at any other level. these are basically the defaults for the component type
drawing | the component type for which these are the defaults |
palette | the palette that should be used |
pad | the padding that should be used |
font | the font that will be used for text rendering |
mag | the font number or magnification depending on the drawable used |
spacing | the spacing between items |
requiredHeight | the required default height for items (can be overridden in position) |
defaultJustification | the default justification (can be overridden in position) |
border | the border to draw around the edges of the item |
|
inline |
Sets the drawing properties that should be used for a specific item, it must have the right component type.
drawing | the component type for which these are the defaults |
id | the menu id for which this override is valid |
palette | the palette that should be used |
pad | the padding that should be used |
font | the font that will be used for text rendering |
mag | the font number or magnification depending on the drawable used |
spacing | the spacing between items |
requiredHeight | the required default height for items (can be overridden in position) |
defaultJustification | the default justification (can be overridden in position) |
border | the border to draw around the edges of the item |
|
inline |
Sets the drawing properties that should be used for a specific item, it must have the right component type.
drawing | the component type for which these are the defaults |
id | the submenu id for which this override will apply to all children |
palette | the palette that should be used |
pad | the padding that should be used |
font | the font that will be used for text rendering |
mag | the font number or magnification depending on the drawable used |
spacing | the spacing between items |
requiredHeight | the required default height for items (can be overridden in position) |
defaultJustification | the default justification (can be overridden in position) |
border | the border to draw around the edges of the item |
|
inline |
Set the backround and text color for selected items
background | the color of the background |
text | the color of the text |
|
inline |
Sets the edit cursor mode and cursor color for different display types
mode | the type of cursor to present |
cursorColor | the color of the cursor itself |
textColor | for filled cursors, this is the text color on the top of the cursor |
|
static |
Whenever you've called any method that adjusts the cache by adding new drawing options, you must then call refreshCache to ensure the drawing functions are aware of the change