SuperTuxKart
Loading...
Searching...
No Matches
Public Member Functions | Static Public Member Functions | Public Attributes | Private Member Functions | Private Attributes | List of all members
GUIEngine::Skin Class Reference

Object used to render the GUI widgets see Overview of GUI skin for more information about skinning in STK. More...

#include <skin.hpp>

Inheritance diagram for GUIEngine::Skin:
Inheritance graph
[legend]

Public Member Functions

 Skin (gui::IGUISkin *fallback_skin)
 load a skin from the file specified in the user configuration file
 
void resetBackgroundImage ()
 
void renderSections (PtrVector< Widget > *within_vector=NULL)
 recursive function to render all sections (recursion allows to easily traverse the tree of children and sub-children)
 
void drawBgImage ()
 
void drawBGFadeColor ()
 
void drawBadgeOn (const Widget *widget, const core::rect< s32 > &rect)
 
void drawProgressBarInScreen (SkinWidgetContainer *swc, const core::rect< s32 > &rect, float progress, bool deactivated=false)
 
virtual void draw2DRectangle (gui::IGUIElement *element, const video::SColor &color, const core::rect< s32 > &pos, const core::rect< s32 > *clip)
 
virtual void draw3DButtonPanePressed (gui::IGUIElement *element, const core::rect< s32 > &rect, const core::rect< s32 > *clip)
 
virtual void draw3DButtonPaneStandard (gui::IGUIElement *element, const core::rect< s32 > &rect, const core::rect< s32 > *clip)
 
virtual void draw3DMenuPane (gui::IGUIElement *element, const core::rect< s32 > &rect, const core::rect< s32 > *clip)
 
virtual void draw3DSunkenPane (gui::IGUIElement *element, video::SColor bgcolor, bool flat, bool fillBackGround, const core::rect< s32 > &rect, const core::rect< s32 > *clip)
 
virtual void draw3DTabBody (gui::IGUIElement *element, bool border, bool background, const core::rect< s32 > &rect, const core::rect< s32 > *clip, s32 tabHeight=-1, gui::EGUI_ALIGNMENT alignment=gui::EGUIA_UPPERLEFT)
 
virtual void draw3DTabButton (gui::IGUIElement *element, bool active, const core::rect< s32 > &rect, const core::rect< s32 > *clip, gui::EGUI_ALIGNMENT alignment=gui::EGUIA_UPPERLEFT)
 
virtual void draw3DToolBar (gui::IGUIElement *element, const core::rect< s32 > &rect, const core::rect< s32 > *clip)
 
virtual core::rect< s32 > draw3DWindowBackground (gui::IGUIElement *element, bool drawTitleBar, video::SColor titleBarColor, const core::rect< s32 > &rect, const core::rect< s32 > *clip, core::rect< s32 > *checkClientArea=0)
 
virtual void draw2DImage (const video::ITexture *texture, const core::rect< s32 > &destRect, const core::rect< s32 > &sourceRect, const core::rect< s32 > *clipRect, const video::SColor *const colors, bool useAlphaChannelOfTexture)
 
virtual void drawIcon (gui::IGUIElement *element, gui::EGUI_DEFAULT_ICON icon, const core::position2di position, u32 starttime, u32 currenttime, bool loop=false, const core::rect< s32 > *clip=NULL)
 
virtual video::SColor getColor (gui::EGUI_DEFAULT_COLOR color) const
 
virtual const wchar_t * getDefaultText (gui::EGUI_DEFAULT_TEXT text) const
 
virtual gui::IGUIFont * getFont (gui::EGUI_DEFAULT_FONT which=gui::EGDF_DEFAULT) const
 
virtual u32 getIcon (gui::EGUI_DEFAULT_ICON icon) const
 
virtual s32 getSize (gui::EGUI_DEFAULT_SIZE size) const
 
const BoxRenderParamsgetBoxRenderParams (const std::string &type)
 Returns the BoxRenderParams data structure for a given type.
 
virtual gui::IGUISpriteBank * getSpriteBank () const
 
virtual void setColor (gui::EGUI_DEFAULT_COLOR which, video::SColor newColor)
 
virtual void setDefaultText (gui::EGUI_DEFAULT_TEXT which, const wchar_t *newText)
 
virtual void setFont (gui::IGUIFont *font, gui::EGUI_DEFAULT_FONT which=gui::EGDF_DEFAULT)
 
virtual void setIcon (gui::EGUI_DEFAULT_ICON icon, u32 index)
 
virtual void setSize (gui::EGUI_DEFAULT_SIZE which, s32 size)
 
virtual void setSpriteBank (gui::IGUISpriteBank *bank)
 
void drawTooltips ()
 
void drawMessage (SkinWidgetContainer *w, const core::recti &dest, const std::string &type)
 Draws a background box for an in-game notification message.
 
video::ITexture * getImage (const char *name)
 
gui::IGUISkin * getFallbackSkin ()
 
bool hasIconTheme () const
 
bool hasFont () const
 
const std::vector< std::string > & getNormalTTF () const
 
const std::vector< std::string > & getDigitTTF () const
 
const std::string & getColorEmojiTTF () const
 
std::string getThemedIcon (const std::string &relative_path) const
 
float getScalingFactor (std::string params, float height)
 

Static Public Member Functions

static video::SColor getColor (const std::string &name)
 

Public Attributes

bool m_dialog
 
float m_dialog_size
 

Private Member Functions

void drawBoxFromStretchableTexture (SkinWidgetContainer *w, const core::rect< s32 > &dest, BoxRenderParams &params, bool deactivated=false, const core::rect< s32 > *clipRect=NULL)
 
void process3DPane (gui::IGUIElement *element, const core::rect< s32 > &rect, const bool pressed)
 
void drawButton (Widget *w, const core::rect< s32 > &rect, const bool pressed, const bool focused)
 
void drawProgress (Widget *w, const core::rect< s32 > &rect, const bool pressed, const bool focused)
 
void drawRatingBar (Widget *w, const core::rect< s32 > &rect, const bool pressed, const bool focused)
 
void drawRibbon (const core::rect< s32 > &rect, Widget *widget, const bool pressed, bool focused)
 
void drawRibbonChild (const core::rect< s32 > &rect, Widget *widget, const bool pressed, bool focused)
 
void drawSpinnerChild (const core::rect< s32 > &rect, Widget *widget, const bool pressed, bool focused)
 
void drawSpinnerBody (const core::rect< s32 > &rect, Widget *widget, const bool pressed, bool focused)
 
void drawGauge (const core::rect< s32 > &rect, Widget *widget, bool focused)
 
void drawGaugeFill (const core::rect< s32 > &rect, Widget *widget, bool focused)
 
void drawCheckBox (const core::rect< s32 > &rect, Widget *widget, bool focused)
 
void drawList (const core::rect< s32 > &rect, Widget *widget, bool focused)
 
void drawListHeader (const core::rect< s32 > &rect, Widget *widget)
 
void drawListSelection (const core::rect< s32 > &rect, Widget *widget, bool focused, const core::rect< s32 > *clip)
 
void drawIconButton (const core::rect< s32 > &rect, Widget *widget, const bool pressed, bool focused)
 
void drawScrollbarBackground (const core::rect< s32 > &rect)
 
void drawScrollbarThumb (const core::rect< s32 > &rect)
 
void drawScrollbarButton (const core::rect< s32 > &rect, const bool pressed, const bool bottomArrow)
 
void drawTooltip (Widget *widget, bool atMouse)
 
irr::video::SColorf getPlayerColor (int player_id)
 

Private Attributes

gui::IGUISkin * m_fallback_skin
 
video::ITexture * m_bg_image
 
std::vector< Widget * > m_tooltips
 
std::vector< bool > m_tooltip_at_mouse
 

Detailed Description

Object used to render the GUI widgets see Overview of GUI skin for more information about skinning in STK.

Constructor & Destructor Documentation

◆ Skin()

Skin::Skin ( gui::IGUISkin *  fallback_skin)

load a skin from the file specified in the user configuration file

Exceptions
std::runtime_errorif file cannot be read

Member Function Documentation

◆ drawButton()

void Skin::drawButton ( Widget w,
const core::rect< s32 > &  rect,
const bool  pressed,
const bool  focused 
)
private
Parameters
focusedwhether this element is focus by the master player (focus for other players is not supported)

◆ drawCheckBox()

void Skin::drawCheckBox ( const core::rect< s32 > &  rect,
Widget widget,
bool  focused 
)
private
Parameters
focusedwhether this element is focus by the master player (focus for other players is not supported)

◆ drawIconButton()

void Skin::drawIconButton ( const core::rect< s32 > &  rect,
Widget widget,
const bool  pressed,
bool  focused 
)
private
Parameters
focusedwhether this element is focus by the master player (focus for other players is not supported)

◆ drawList()

void Skin::drawList ( const core::rect< s32 > &  rect,
Widget widget,
bool  focused 
)
private
Parameters
focusedwhether this element is focus by the master player (focus for other players is not supported)

◆ drawListHeader()

void Skin::drawListHeader ( const core::rect< s32 > &  rect,
Widget widget 
)
private

img sets the icon for the column according to sort order

◆ drawListSelection()

void Skin::drawListSelection ( const core::rect< s32 > &  rect,
Widget widget,
bool  focused,
const core::rect< s32 > *  clip 
)
private
Parameters
focusedwhether this element is focus by the master player (focus for other players is not supported)

◆ drawMessage()

void Skin::drawMessage ( SkinWidgetContainer w,
const core::recti &  dest,
const std::string &  type 
)

Draws a background box for an in-game notification message.

Example would be an achievement, or friends comming online.

Parameters
wThe SkinWidgetContainer for the outline.
destThe destination rectangle to use.
typeThe type of the message (achievement or friend).

◆ drawProgress()

void Skin::drawProgress ( Widget w,
const core::rect< s32 > &  rect,
const bool  pressed,
const bool  focused 
)
private
Parameters
focusedwhether this element is focus by the master player (focus for other players is not supported)

◆ drawRatingBar()

void Skin::drawRatingBar ( Widget w,
const core::rect< s32 > &  rect,
const bool  pressed,
const bool  focused 
)
private
Parameters
focusedwhether this element is focus by the master player (focus for other players is not supported)

◆ drawRibbonChild()

void Skin::drawRibbonChild ( const core::rect< s32 > &  rect,
Widget widget,
const bool  pressed,
bool  focused 
)
private
Parameters
focusedwhether this element is focus by the master player (whether the widget is focused for other players is automatically determined) FIXME: ugly to pass some focuses through parameter and others not xD

◆ drawSpinnerBody()

void Skin::drawSpinnerBody ( const core::rect< s32 > &  rect,
Widget widget,
const bool  pressed,
bool  focused 
)
private
Parameters
focusedwhether this element is focus by the master player (whether the widget is focused for other players is automatically determined) FIXME: ugly to pass some focuses through parameter and others not xD

◆ drawSpinnerChild()

void Skin::drawSpinnerChild ( const core::rect< s32 > &  rect,
Widget widget,
const bool  pressed,
bool  focused 
)
private
Parameters
focusedwhether this element is focus by the master player (focus for other players is not supported)

◆ getBoxRenderParams()

const BoxRenderParams & Skin::getBoxRenderParams ( const std::string &  type)

Returns the BoxRenderParams data structure for a given type.

Parameters
typeThe type name of the box render param to get.

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