Class Text

Inheritance Relationships

Base Type

Class Documentation

class Text : public BlamRendering::RenderStack::StackObjectBase

Class used to wrap around BitmapText and DWText, making the usage of both of them directly unnecessary.

Public Functions

Text()

Sets the stack type, creates the needed resources, and sets some default colors.

~Text()

Deletes any used resources.

void SetText(std::string text)

Sets the text to display.

Parameters
  • new_text: - The new text to display.

void UpdateAllProperties()

Applies any modified parent properties to the appropriate child object.

Should be called any time any of the properties are directly modified.

void SetFont(std::string new_font_id)

Sets the font to use for the text.

Parameters
  • new_font_id: - The ID of the font to use.

std::string GetFont()

Retrieves the ID of the active font.

Return

The ID of this object’s current font.

void RefreshTranslation()

Refreshes any translation data and applies them to the child objects.

Should be called any time the X/Y coordinates are modified.

void Draw()

Draws the stack object.

Specific functionality may vary depending on the type of object.

void ShowImPropertyEditor()

Shows a set of ImGUI properties associated with the object.

This will call functions to draw only the property controls for the item, and nothing else. The window/container for the properties must be handled externally.

Public Members

std::string text = "the quick brown fox jumped over the lazy dog"

The text to display.

float font_size = 12.0f

The size of the font. Only used with TrueType fonts.

int shadow_x = 1

The X offset of the drop shadow.

int shadow_y = 1

The Y offset of the drop shadow.

D2D1_COLOR_F shadow_color

The color to use for the drop shadow.

bool use_shadow = false

Whether or not to draw the text with a drop shadow.

bool show_zone = false

Whether or not to show the text zone.

D2D1_COLOR_F zone_color

The color to use for the zone border.

float zone_thickness = 1

The thickness of the zone border.

bool use_background = false

Whether or not to draw a background behind the text.

D2D1_COLOR_F bg_color

The color to use for the text background.

char text_buffer[1024] = ""

Text buffer for ImGUI editor.

char font_buffer[256] = ""

Font name buffer for ImGUI editor.

bool auto_calculate_area = false

Whether or not to automatically calculate the text area.