SuperTuxKart
|
Contains all GUI engine related classes and functions. More...
Namespaces | |
Private | |
In an attempt to make getters as fast as possible, by possibly still allowing inlining These fields should never be accessed outside of the GUI engine. | |
Classes | |
class | AbstractStateManager |
Abstract base class you must override from to use the GUI engine. More... | |
class | AbstractTopLevelContainer |
Represents a GUI widgets container. More... | |
class | BoxRenderParams |
class containing render params for the 'drawBoxFromStretchableTexture' function see Overview of GUI skin for more information about skinning in STK More... | |
class | BubbleWidget |
A text widget that can expand when focused. More... | |
class | ButtonWidget |
A text button widget. More... | |
class | CheckBoxWidget |
A checkbox widget. More... | |
class | CutsceneScreen |
class | DialogQueue |
class | DynamicRibbonHoverListener |
Even if you have a ribbon that only acts on click/enter, you may wish to know which item is currently highlighted. More... | |
struct | DynamicRibbonScrollCallback |
class | DynamicRibbonWidget |
An extended version of RibbonWidget, with more capabilities. More... | |
class | EmojiKeyboard |
class | EventHandler |
Class to handle irrLicht events (GUI and input as well) More... | |
class | IconButtonWidget |
A button widget with an icon and optionnaly a label beneath. More... | |
class | IListWidgetHeaderListener |
struct | ItemDescription |
The description of an item added to a DynamicRibbonWidget. More... | |
class | ITextBoxWidgetListener |
class | KartStatsWidget |
A progress bar widget. More... | |
class | LabelWidget |
A simple label widget. More... | |
class | LayoutManager |
class | ListWidget |
A vertical list widget with text entries. More... | |
struct | MenuMessage |
class | ModalDialog |
Abstract base class representing a modal dialog. More... | |
class | ModelViewWidget |
A model view widget. More... | |
class | PlayerKartWidget |
A widget representing the kart selection for a player (i.e. More... | |
class | PlayerNameSpinner |
A small extension to the spinner widget to add features like player ID management or badging. More... | |
class | ProgressBarWidget |
A progress bar widget. More... | |
class | RatingBarWidget |
A rating bar widget. More... | |
class | RibbonWidget |
A static text/icons/tabs bar widget. More... | |
class | Screen |
Represents a single GUI screen. More... | |
class | ScreenKeyboard |
Class representing a screen keyboard. More... | |
class | ScreenSingleton |
Declares a class to be a singleton. More... | |
class | SkillLevelWidget |
A skill level widget. More... | |
class | Skin |
Object used to render the GUI widgets see Overview of GUI skin for more information about skinning in STK. More... | |
class | SkinWidgetContainer |
In order to avoid calculating render information every frame, it's stored in a SkinWidgetContainer for each widget (or each widget part if it requires many) More... | |
class | SpinnerWidget |
A spinner or gauge widget (to select numbers / percentages). More... | |
class | TextBoxWidget |
A text field widget. More... | |
class | Widget |
The nearly-abstract base of all widgets (not fully abstract since a bare Widget can be created for the sole goal of containing children widgets in a group) More... | |
Enumerations | |
enum | GameState { MENU, GAME, INGAME_MENU, CURRENT } |
enum | EventPropagation { EVENT_BLOCK, EVENT_BLOCK_BUT_HANDLED, EVENT_LET } |
enum | NavigationDirection { NAV_LEFT, NAV_RIGHT, NAV_UP, NAV_DOWN } |
enum | ModalDialogLocation { MODAL_DIALOG_LOCATION_CENTER = 0, MODAL_DIALOG_LOCATION_BOTTOM = 1 } |
enum | WidgetType { WTYPE_NONE = -1, WTYPE_RIBBON, WTYPE_SPINNER, WTYPE_BUTTON, WTYPE_ICON_BUTTON, WTYPE_CHECKBOX, WTYPE_LABEL, WTYPE_BUBBLE, WTYPE_SPACER, WTYPE_DIV, WTYPE_DYNAMIC_RIBBON, WTYPE_MODEL_VIEW, WTYPE_LIST, WTYPE_TEXTBOX, WTYPE_PROGRESS, WTYPE_RATINGBAR } |
enum | BadgeType { LOCKED_BADGE = 1, OK_BADGE = 2, BAD_BADGE = 4, TROPHY_BADGE = 8, GAMEPAD_BADGE = 16, KEYBOARD_BADGE = 32, LOADING_BADGE = 64, ZIPPER_BADGE = 128, ANCHOR_BADGE = 256, DOWN_BADGE = 512 } |
enum | Property { PROP_ID = 100, PROP_PROPORTION, PROP_WIDTH, PROP_HEIGHT, PROP_CHILD_WIDTH, PROP_CHILD_HEIGHT, PROP_WORD_WRAP, PROP_ALTERNATE_BG, PROP_LINE_HEIGHT, PROP_X, PROP_Y, PROP_LAYOUT, PROP_ALIGN, PROP_ICON, PROP_FOCUS_ICON, PROP_TEXT_ALIGN, PROP_TEXT_VALIGN, PROP_MIN_VALUE, PROP_MAX_VALUE, PROP_MAX_WIDTH, PROP_MAX_HEIGHT, PROP_SQUARE, PROP_EXTEND_LABEL, PROP_LABELS_LOCATION, PROP_MAX_ROWS, PROP_WRAP_AROUND, PROP_DIV_PADDING, PROP_KEEP_SELECTION, PROP_CUSTOM_RATIO, PROP_ICON_ALIGN, PROP_COLOR_SLIDER } |
enum | RibbonType { RIBBON_COMBO, RIBBON_TOOLBAR, RIBBON_TABS, RIBBON_VERTICAL_TABS } |
Types of ribbons. More... | |
enum | RibbonFlip { FLIP_NO, FLIP_UP_LEFT, FLIP_DOWN_RIGHT } |
Filp directions of ribbons. | |
enum | TextBoxType : int { TBT_TEXT = 0, TBT_CAP_SENTENCES = 1, TBT_PASSWORD = 2, TBT_NUMBER = 3, TBT_EMAIL = 4 } |
Functions | |
static DialogQueue * | dialog_queue_singleton (NULL) |
float | getLatestDt () |
void | showMessage (const core::stringw &message, const float time) |
Widget * | getFocusForPlayer (const unsigned int playerID) |
Returns the widget currently focused by given player, or NULL if none. More... | |
void | focusNothingForPlayer (const unsigned int playerID) |
Focuses nothing for given player (removes any selection for this player). More... | |
bool | isFocusedForPlayer (const Widget *w, const unsigned int playerID) |
Returns whether given the widget is currently focused by given player. More... | |
int | getTitleFontHeight () |
int | getSmallTitleFontHeight () |
int | getTinyTitleFontHeight () |
int | getFontHeight () |
int | getSmallFontHeight () |
int | getLargeFontHeight () |
void | clear () |
erases the currently displayed screen, removing all added irrLicht widgets More... | |
void | update (float dt) |
Updates all widgets that need to be updated. More... | |
void | cleanForGame () |
like GUIEngine::clear, but to be called before going into game | |
void | clearScreenCache () |
void | switchToScreen (Screen *screen) |
Low-level mean to change current screen. More... | |
void | addScreenToList (Screen *screen) |
Add a screen to the list of screens known by the gui engine. | |
void | removeScreen (Screen *screen) |
Remove a screen from the list of screens known by the gui engine. | |
void | reshowCurrentScreen () |
to be called after e.g. More... | |
void | cleanUp () |
Clean some of the cached data, either for a shutdown or a reload. More... | |
void | deallocate () |
To be called after cleanup(). More... | |
void | resetGlobalVariables () |
void | init (IrrlichtDevice *device_a, IVideoDriver *driver_a, AbstractStateManager *state_manager, bool loading) |
void | reloadSkin () |
call when skin in user config was updated | |
void | reloadForNewSize () |
call when screen size changed | |
void | addGUIFunctionBeforeRendering (std::function< void()> func) |
Add gui-related function before rendering GUI (from other thread) | |
void | render (float elapsed_time, bool is_loading) |
called on every frame to trigger the rendering of the GUI. More... | |
void | clearLoadingTips () |
void | renderLoading (bool clearIcons=true, bool launching=false, bool update_tips=true) |
renders a "loading" screen | |
void | addLoadingIcon (irr::video::ITexture *icon) |
to spice up a bit the loading icon : add icons to the loading screen | |
Widget * | getWidget (const char *name) |
Finds a widget from its name (PROP_ID) in the current screen/dialog. More... | |
Widget * | getWidget (const int id) |
Finds a widget from its irrlicht widget ID in the current screen/dialog. More... | |
void | disableGraphics () |
bool | isNoGraphics () |
void | init (irr::IrrlichtDevice *device, irr::video::IVideoDriver *driver, AbstractStateManager *state_manager, bool loading=true) |
Call this method to init the GUI engine. More... | |
irr::IrrlichtDevice * | getDevice () |
irr::gui::IGUIEnvironment * | getGUIEnv () |
irr::video::IVideoDriver * | getDriver () |
irr::gui::ScalableFont * | getSmallFont () |
irr::gui::ScalableFont * | getFont () |
irr::gui::ScalableFont * | getOutlineFont () |
irr::gui::ScalableFont * | getLargeFont () |
irr::gui::ScalableFont * | getHighresDigitFont () |
irr::gui::ScalableFont * | getTitleFont () |
irr::gui::ScalableFont * | getSmallTitleFont () |
irr::gui::ScalableFont * | getTinyTitleFont () |
Screen * | getCurrentScreen () |
AbstractStateManager * | getStateManager () |
Skin * | getSkin () |
void | setSkin (Skin *skin) |
Screen * | getScreenNamed (const char *name) |
void | showMessage (const irr::core::stringw &message, const float time=5.0f) |
shows a message at the bottom of the screen for a while More... | |
bool | isWithinATextBox () |
void | setWithinATextBox (bool in) |
Variables | |
PtrVector< Widget, REF > | needsUpdate |
Widgets that need to be notified at every frame can add themselves there (FIXME: unclean) | |
PtrVector< Screen, REF > | g_loaded_screens |
float | dt = 0 |
std::vector< MenuMessage > | gui_messages |
bool | g_is_no_graphics [PT_COUNT] |
std::vector< irr::video::ITexture * > | g_loading_icons |
core::stringw | g_tips_string |
static ModalDialog * | modalWindow = NULL |
global instance of the current dialog if any | |
bool | pointer_was_shown |
To remember and restore the previous state. | |
SkinWidgetContainer * | g_bg_container = NULL |
The widget used to hold the scrollbar BG. | |
SkinWidgetContainer * | g_thumb_container = NULL |
The widget used to hold the scrollbar thumb. | |
static bool | g_is_within_a_text_box = false |
const unsigned int | FOCUSABLE_IDS_BASE = 100 |
const unsigned int | UNFOCUSABLE_IDS_BASE = 1000 |
static unsigned int | id_counter = FOCUSABLE_IDS_BASE |
Used to assign irrLicht IDs to widgets dynamically. | |
static unsigned int | id_counter_2 = UNFOCUSABLE_IDS_BASE |
for items that can't be reached with keyboard navigation but can be clicked | |
const int | BUBBLE_MARGIN_ON_RIGHT = 15 |
Contains all GUI engine related classes and functions.
See GUI Module Overview for more information.
enum GUIEngine::BadgeType |
void GUIEngine::cleanUp | ( | ) |
Clean some of the cached data, either for a shutdown or a reload.
If this is a shutdown then you also need to call free().
void GUIEngine::clear | ( | ) |
erases the currently displayed screen, removing all added irrLicht widgets
void GUIEngine::deallocate | ( | ) |
To be called after cleanup().
The difference between cleanup() and free() is that cleanUp() just removes some cached data but does not actually uninitialize the gui engine. This does.
void GUIEngine::focusNothingForPlayer | ( | const unsigned int | playerID | ) |
Focuses nothing for given player (removes any selection for this player).
|
inline |
|
inline |
|
inline |
Widget * GUIEngine::getFocusForPlayer | ( | const unsigned int | playerID | ) |
Returns the widget currently focused by given player, or NULL if none.
|
inline |
int GUIEngine::getFontHeight | ( | ) |
|
inline |
|
inline |
|
inline |
float GUIEngine::getLatestDt | ( | ) |
|
inline |
|
inline |
int GUIEngine::getSmallFontHeight | ( | ) |
|
inline |
|
inline |
|
inline |
|
inline |
int GUIEngine::getTitleFontHeight | ( | ) |
Widget * GUIEngine::getWidget | ( | const char * | name | ) |
Finds a widget from its name (PROP_ID) in the current screen/dialog.
name | the name (PROP_ID) of the widget to search for |
Widget * GUIEngine::getWidget | ( | const int | id | ) |
Finds a widget from its irrlicht widget ID in the current screen/dialog.
name | the irrlicht widget ID (not to be confused with PROP_ID, which is a string) of the widget to search for |
void GUIEngine::init | ( | irr::IrrlichtDevice * | device, |
irr::video::IVideoDriver * | driver, | ||
AbstractStateManager * | state_manager, | ||
bool | loading = true |
||
) |
Call this method to init the GUI engine.
device | An initialized irrlicht device object |
driver | An initialized irrlicht driver object |
state_manager | An instance of a class derived from abstract base AbstractStateManager |
loading | if it's (re-)loading the GUIEngine |
bool GUIEngine::isFocusedForPlayer | ( | const Widget * | w, |
const unsigned int | playerID | ||
) |
Returns whether given the widget is currently focused by given player.
void GUIEngine::render | ( | float | elapsed_time, |
bool | is_loading | ||
) |
called on every frame to trigger the rendering of the GUI.
called on every frame to trigger the rendering of the GUI
elapsed_time | Time since last rendering calls (in seconds). |
is_loading | True if the rendering is called during loading of world, in which case world, physics etc must not be accessed. |
void GUIEngine::reshowCurrentScreen | ( | ) |
to be called after e.g.
a resolution switch
void GUIEngine::showMessage | ( | const irr::core::stringw & | message, |
const float | time = 5.0f |
||
) |
shows a message at the bottom of the screen for a while
message | the message to display |
time | the time to display the message, in seconds |
void GUIEngine::switchToScreen | ( | Screen * | screen | ) |
Low-level mean to change current screen.
void GUIEngine::update | ( | float | dt | ) |
Updates all widgets that need to be updated.
dt | Time step size. |