![]() |
Blamite Game Engine - blam!
00406.12.10.23.1457.blamite
The core library for the Blamite Game Engine.
|
Class representing a Text widget. More...
#include <ui.h>
Public Member Functions | |
BlamUIWidget_Text (BlamUIWidget_Group *_parent) | |
~BlamUIWidget_Text () | |
void | Draw () override |
Draws the widget on-screen. More... | |
void | ShowImGuiPropertyEditor () override |
Displays an ImGUI-based property editor. More... | |
void | UpdateMetrics () override |
Updates metrics for the widget. More... | |
void | SetHidden (bool new_hidden) override |
Sets the hidden state of the widget. More... | |
void | RebuildTextObject () |
Regenerates the text object. More... | |
![]() | |
BlamUIWidget (BlamWidgetType type) | |
Constructs a new UI widget. More... | |
BlamUIWidget (BlamWidgetType type, BlamUIWidget_Group *_parent) | |
Constructs a new UI widget. More... | |
virtual | ~BlamUIWidget () |
BlamWidgetType | GetType () |
Retrieves the type of this widget. More... | |
virtual void | RefreshRelativePosition () |
Updates the relative position of the widget, relative to its parent. More... | |
void | RefreshRelativePosition (int viewport_width, int viewport_height, BlamVector2 initial_position) |
Updates the relative position of the widget. More... | |
void | SetSize (BlamVector2 new_size) |
Sets the size of the widget. More... | |
virtual void | SetPosition (BlamVector2 new_position) |
Sets the position of the widget. More... | |
void | SetRotation (float new_rotation) |
Sets the rotation of the widget. More... | |
void | SetAnchorPosition (BlamWidgetAnchor new_anchor_position) |
Sets the anchor position of the widget. More... | |
void | MarkForUpdate () |
Marks the widget as needing to be updated on the next draw call. More... | |
BlamVector2 | GetAbsolutePosition () |
Retrieves the absolute position of the widget. More... | |
BlamWidgetAnchor | GetAnchorPosition () |
Retrieves the anchor position of the widget. More... | |
bool | IsHidden () |
Checks whether or not the widget is hidden. More... | |
Public Attributes | |
bool | auto_scale_shadow = true |
Whether or not to automatically scale the text shadow based on text size. More... | |
int | character_height = 16 |
The line height of this text widget, in pixels. More... | |
BlamVector2 | shadow_offset = { 1, 1 } |
The offset of the text shadow, in pixels. More... | |
BlamColor | color = BlamColor(255, 255, 255) |
The text foreground color. More... | |
BlamColor | shadow_color = BlamColor(0, 0, 0) |
The text shadow color. More... | |
std::string | font_name = "fixedsys" |
The name of the font package to use for this text widget. More... | |
BlamFontPackage * | font_package = nullptr |
The font package being used for this text widget. More... | |
std::string | text = "blam!" |
The text to display within this text widget. More... | |
![]() | |
std::string | display_name = "unnamed" |
The display name of the widget. More... | |
std::string | description = "" |
An optional description of the widget. More... | |
BlamVector2 | position = { 0, 0 } |
The position of the widget, relative to its parent. More... | |
BlamVector2 | size = { 100, 100 } |
The size of the widget, relative to its parent. More... | |
float | rotation = 0.0f |
The rotation of the widget, in degrees. More... | |
int | z_index = 0 |
The Z index of the widget, where higher Z orders are drawn on top. More... | |
float | z_size = 1.0f |
The Z size of the widget. Mostly unused. More... | |
bool | auto_update = false |
Whether or not the widget should always update every frame. More... | |
Ogre::HlmsDatablock * | material = nullptr |
The datablock used by the widget, if applicable. More... | |
BlamUIWidget_Group * | parent = nullptr |
The parent group of this widget, if applicable. More... | |
bool | ignore_layout = false |
Whether or not this widget should ignore any layout positioning. More... | |
bool | hide_in_layout = false |
Whether or not this widget should be hidden within its layout. More... | |
bool | ignore_scale_factor = false |
Whether or not this widget should ignore the UI scale factor settings. More... | |
Additional Inherited Members | |
![]() | |
int | GetAdjustedZIndex () |
Retrieves the adjusted Z-index of the widget. More... | |
![]() | |
BlamVector2 | position_absolute = { 0, 0 } |
The absolute position of the widget on-screen. More... | |
BlamVector2 | size_absolute = { 100, 100 } |
The absolute size of the widget on-screen. More... | |
bool | update = false |
Whether or not the widget needs to be updated before the next draw call. More... | |
bool | hidden = false |
Whether or not the widget is hidden. More... | |
Class representing a Text widget.
This widget allows for text to be displayed on-screen. It supports all font packages that the engine has available, and can be freely sized and positioned. It also supports multi-line text and includes a simple drop-shadow out of the box.
BlamUIWidget_Text::BlamUIWidget_Text | ( | BlamUIWidget_Group * | _parent | ) |
BlamUIWidget_Text::~BlamUIWidget_Text | ( | ) |
|
overridevirtual |
Draws the widget on-screen.
Reimplemented from BlamUIWidget.
void BlamUIWidget_Text::RebuildTextObject | ( | ) |
Regenerates the text object.
This takes care of destroying any existing objects used, and generating a new manual object, scene node, and datablocks.
|
overridevirtual |
Sets the hidden state of the widget.
new_hidden | - Whether or not the widget should be hidden. |
Reimplemented from BlamUIWidget.
|
overridevirtual |
Displays an ImGUI-based property editor.
Used in conjunction with the UI Editor window.
Reimplemented from BlamUIWidget.
|
overridevirtual |
Updates metrics for the widget.
The term "metrics" as used in this method is generally up to an individual widget class to decide. However, in most cases, it will include position, size, rotation, and color.
Reimplemented from BlamUIWidget.
bool BlamUIWidget_Text::auto_scale_shadow = true |
Whether or not to automatically scale the text shadow based on text size.
int BlamUIWidget_Text::character_height = 16 |
The line height of this text widget, in pixels.
BlamColor BlamUIWidget_Text::color = BlamColor(255, 255, 255) |
The text foreground color.
std::string BlamUIWidget_Text::font_name = "fixedsys" |
The name of the font package to use for this text widget.
BlamFontPackage* BlamUIWidget_Text::font_package = nullptr |
The font package being used for this text widget.
BlamColor BlamUIWidget_Text::shadow_color = BlamColor(0, 0, 0) |
The text shadow color.
BlamVector2 BlamUIWidget_Text::shadow_offset = { 1, 1 } |
The offset of the text shadow, in pixels.
std::string BlamUIWidget_Text::text = "blam!" |
The text to display within this text widget.