Luanti 5.16.0-dev
Loading...
Searching...
No Matches
StatusTextHelper Class Reference

#include <statusTextHelper.h>

Collaboration diagram for StatusTextHelper:

Public Member Functions

 StatusTextHelper (gui::IGUIEnvironment *guienv, gui::IGUIElement *parent=nullptr)
 ~StatusTextHelper ()
void showStatusText (const std::wstring &str)
void update (float dtime)
void setGameStyle ()
void setMainMenuStyle ()
void clearStatusText ()
void setVisible (bool visible)
bool isVisible () const
const std::wstring & getStatusText () const
float getStatusTextTime () const

Private Member Functions

void updatePosition ()

Private Attributes

irr_ptr< gui::IGUIStaticText > m_guitext_status
std::wstring m_statustext
float m_statustext_time = 0.0f
float m_display_duration = 1.5f
float m_fade_progress = 0.0f
video::SColor m_text_color
video::SColor m_background_color = video::SColor(0, 0, 0, 0)
bool m_background_enabled = false
bool m_use_main_menu_position = false
gui::EGUI_ALIGNMENT m_text_alignment_v = gui::EGUIA_UPPERLEFT

Static Private Attributes

static constexpr s32 MAIN_MENU_BAR_HEIGHT = 40

Constructor & Destructor Documentation

◆ StatusTextHelper()

StatusTextHelper::StatusTextHelper ( gui::IGUIEnvironment * guienv,
gui::IGUIElement * parent = nullptr )

References gui::StaticText::add(), guienv, m_guitext_status, and m_text_color.

Here is the call graph for this function:

◆ ~StatusTextHelper()

StatusTextHelper::~StatusTextHelper ( )

References m_guitext_status.

Member Function Documentation

◆ clearStatusText()

void StatusTextHelper::clearStatusText ( )

References m_fade_progress, m_guitext_status, m_statustext, and m_statustext_time.

Referenced by TestGameUI::testStatusText(), and update().

Here is the caller graph for this function:

◆ getStatusText()

const std::wstring & StatusTextHelper::getStatusText ( ) const
inline

References m_statustext.

Referenced by TestGameUI::testStatusText().

Here is the caller graph for this function:

◆ getStatusTextTime()

float StatusTextHelper::getStatusTextTime ( ) const
inline

References m_statustext_time.

Referenced by TestGameUI::testStatusText().

Here is the caller graph for this function:

◆ isVisible()

bool StatusTextHelper::isVisible ( ) const

References m_guitext_status.

◆ setGameStyle()

void StatusTextHelper::setGameStyle ( )

◆ setMainMenuStyle()

void StatusTextHelper::setMainMenuStyle ( )

◆ setVisible()

void StatusTextHelper::setVisible ( bool visible)

References m_guitext_status.

◆ showStatusText()

void StatusTextHelper::showStatusText ( const std::wstring & str)

References m_fade_progress, m_statustext, and m_statustext_time.

Referenced by TestGameUI::testStatusText().

Here is the caller graph for this function:

◆ update()

void StatusTextHelper::update ( float dtime)

References clearStatusText(), m_background_color, m_background_enabled, m_display_duration, m_fade_progress, m_guitext_status, m_statustext, m_statustext_time, m_text_alignment_v, m_text_color, and updatePosition().

Here is the call graph for this function:

◆ updatePosition()

void StatusTextHelper::updatePosition ( )
private

References RenderingEngine::getWindowSize(), m_guitext_status, m_use_main_menu_position, and MAIN_MENU_BAR_HEIGHT.

Referenced by update().

Here is the call graph for this function:
Here is the caller graph for this function:

Member Data Documentation

◆ m_background_color

video::SColor StatusTextHelper::m_background_color = video::SColor(0, 0, 0, 0)
private

Referenced by setMainMenuStyle(), and update().

◆ m_background_enabled

bool StatusTextHelper::m_background_enabled = false
private

◆ m_display_duration

float StatusTextHelper::m_display_duration = 1.5f
private

◆ m_fade_progress

float StatusTextHelper::m_fade_progress = 0.0f
private

◆ m_guitext_status

irr_ptr<gui::IGUIStaticText> StatusTextHelper::m_guitext_status
private

◆ m_statustext

std::wstring StatusTextHelper::m_statustext
private

◆ m_statustext_time

float StatusTextHelper::m_statustext_time = 0.0f
private

◆ m_text_alignment_v

gui::EGUI_ALIGNMENT StatusTextHelper::m_text_alignment_v = gui::EGUIA_UPPERLEFT
private

◆ m_text_color

video::SColor StatusTextHelper::m_text_color
private

Referenced by StatusTextHelper(), and update().

◆ m_use_main_menu_position

bool StatusTextHelper::m_use_main_menu_position = false
private

◆ MAIN_MENU_BAR_HEIGHT

s32 StatusTextHelper::MAIN_MENU_BAR_HEIGHT = 40
staticconstexprprivate

Referenced by updatePosition().


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