Luanti 5.17.0-dev
Loading...
Searching...
No Matches
TextDrawer Class Reference

#include <guiHyperText.h>

Collaboration diagram for TextDrawer:

Classes

struct  RectWithMargin

Public Member Functions

 TextDrawer (const wchar_t *text, Client *client, gui::IGUIEnvironment *environment, ISimpleTextureSource *tsrc, video::SColor default_background_color, video::SColor default_color)
void place (const core::rect< s32 > &dest_rect)
s32 getHeight ()
void draw (const core::rect< s32 > &clip_rect, const core::position2d< s32 > &dest_offset)
void drawBackgroundImage (video::IVideoDriver *driver, const core::rect< s32 > &clip_rect)
void applyStyleSpecToText (const StyleSpec &style)
ParsedText::ElementgetElementAt (core::position2d< s32 > pos)

Public Attributes

ParsedText::Tagm_hovertag

Protected Attributes

ParsedText m_text
Clientm_client
 null in the mainmenu
ISimpleTextureSourcem_tsrc
gui::IGUIEnvironment * m_guienv
s32 m_height = 0
s32 m_voffset
std::vector< RectWithMarginm_floating
video::SColor m_default_background_color

Constructor & Destructor Documentation

◆ TextDrawer()

TextDrawer::TextDrawer ( const wchar_t * text,
Client * client,
gui::IGUIEnvironment * environment,
ISimpleTextureSource * tsrc,
video::SColor default_background_color,
video::SColor default_color )

References m_client, m_default_background_color, m_guienv, m_text, m_tsrc, and p().

Here is the call graph for this function:

Member Function Documentation

◆ applyStyleSpecToText()

void TextDrawer::applyStyleSpecToText ( const StyleSpec & style)

References StyleSpec::BGCOLOR, StyleSpec::BGIMG, StyleSpec::BGIMG_MIDDLE, StyleSpec::BORDER, StyleSpec::getBool(), StyleSpec::getColor(), StyleSpec::getRect(), StyleSpec::getTexture(), StyleSpec::isNotDefault(), m_default_background_color, m_text, and m_tsrc.

Here is the call graph for this function:

◆ draw()

void TextDrawer::draw ( const core::rect< s32 > & clip_rect,
const core::position2d< s32 > & dest_offset )

References ParsedText::BACKGROUND_COLOR, ItemStack::deSerialize(), drawBackgroundImage(), drawItemStack(), ParsedText::ELEMENT_IMAGE, ParsedText::ELEMENT_ITEM, ParsedText::ELEMENT_SEPARATOR, ParsedText::ELEMENT_TEXT, g_fontengine, IT_ROT_OTHER, m_client, m_guienv, m_hovertag, m_text, m_tsrc, m_voffset, and p().

Here is the call graph for this function:

◆ drawBackgroundImage()

void TextDrawer::drawBackgroundImage ( video::IVideoDriver * driver,
const core::rect< s32 > & clip_rect )

References draw2DImage9Slice(), draw2DImageFilterScaled(), and m_text.

Referenced by draw().

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

◆ getElementAt()

ParsedText::Element * TextDrawer::getElementAt ( core::position2d< s32 > pos)

References m_text, m_voffset, and p().

Here is the call graph for this function:

◆ getHeight()

s32 TextDrawer::getHeight ( )
inline

References m_height.

◆ place()

Member Data Documentation

◆ m_client

Client* TextDrawer::m_client
protected

null in the mainmenu

Referenced by TextDrawer(), and draw().

◆ m_default_background_color

video::SColor TextDrawer::m_default_background_color
protected

Referenced by TextDrawer(), and applyStyleSpecToText().

◆ m_floating

std::vector<RectWithMargin> TextDrawer::m_floating
protected

Referenced by place().

◆ m_guienv

gui::IGUIEnvironment* TextDrawer::m_guienv
protected

Referenced by TextDrawer(), and draw().

◆ m_height

s32 TextDrawer::m_height = 0
protected

Referenced by getHeight(), and place().

◆ m_hovertag

ParsedText::Tag* TextDrawer::m_hovertag

Referenced by draw().

◆ m_text

◆ m_tsrc

ISimpleTextureSource* TextDrawer::m_tsrc
protected

◆ m_voffset

s32 TextDrawer::m_voffset
protected

Referenced by draw(), getElementAt(), and place().


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