lxgui
|
A layered_region that can draw text on the screen. More...
#include <gui_font_string.hpp>
Public Types | |
using | base = layered_region |
Public Member Functions | |
font_string (utils::control_block &block, manager &mgr, const region_core_attributes &attr) | |
Constructor. | |
std::string | serialize (const std::string &tab) const override |
Prints all relevant information about this region in a string. | |
void | render () const override |
Renders this region on the current render target. | |
void | copy_from (const region &obj) override |
Copies a region's parameters into this font_string (inheritance). | |
const std::string & | get_font_name () const |
Returns the name of the font file. | |
float | get_font_height () const |
Returns the height of the font. | |
void | set_outlined (bool outlined) |
Adds or remove the outline around the text. | |
bool | is_outlined () const |
Check if this font_string is outlined. | |
alignment_x | get_alignment_x () const |
Returns the horizontal alignment behavior. | |
alignment_y | get_alignment_y () const |
Returns the vertical alignment behavior. | |
const color & | get_shadow_color () const |
Returns this font_string's shadow color. | |
const vector2f & | get_shadow_offset () const |
Returns this font_string's shadow offset. | |
const vector2f & | get_offset () const |
Returns this font_string's offset. | |
float | get_spacing () const |
Returns the space between each letter. | |
float | get_line_spacing () const |
Returns the space between each line as a fraction of the font height. | |
const color & | get_text_color () const |
Returns the text color. | |
void | set_font (const std::string &font_name, float height) |
Sets this font_string's font (file and size). | |
void | set_alignment_x (alignment_x align_x) |
Sets this font_string's horizontal alignment behavior. | |
void | set_alignment_y (alignment_y align_y) |
Sets this font_string's vertical alignment behavior. | |
void | set_shadow_color (const color &shadow_color) |
Sets this font_string's shadow color. | |
void | set_shadow_offset (const vector2f &shadow_offset) |
Sets this font_string's shadow offset. | |
void | set_offset (const vector2f &offset) |
Sets this font_string's offset. | |
void | set_spacing (float spacing) |
Sets the space between each letter. | |
void | set_line_spacing (float line_spacing) |
Sets the space between each line as a fraction of the font height. | |
void | set_text_color (const color &text_color) |
Sets the text color. | |
bool | is_non_space_wrap_enabled () const |
Checks if large text is truncated or wrapped. | |
float | get_string_height () const |
Returns the height of the string if no format or wrapping is applied. | |
float | get_string_width () const |
Returns the width of the string if no format or wrapping is applied. | |
float | get_string_width (const utils::ustring &content) const |
Returns the width of a string if no format or wrapping is applied. | |
const utils::ustring & | get_text () const |
Returns the rendered text (with format tags). | |
void | set_non_space_wrap_enabled (bool enabled) |
Sets whether large text without whitespace is truncated or wrapped. | |
void | enable_non_space_wrap () |
Allows large text without whitespace to wrap. | |
void | disable_non_space_wrap () |
Does not allow large text without whitespace to wrap. | |
bool | is_shadow_enabled () const |
Checks if this font_string draws a shadow under its text. | |
void | set_shadow_enabled (bool enabled) |
Sets whether this font_string should draw a shadow under its text. | |
void | enable_shadow () |
Makes this font_string draw a shadow under its text. | |
void | disable_shadow () |
Makes this font_string draw a shadow under its text. | |
void | set_word_wrap_enabled (bool enabled) |
Enables/disables word wrap. | |
void | enable_word_wrap () |
Enables word wrap. | |
void | disable_word_wrap () |
Disables word wrap. | |
bool | is_word_wrap_enabled () const |
Checks if word wrap is enabled. | |
void | set_word_ellipsis_enabled (bool enabled) |
Sets whether to show an ellipsis "..." if words don't fit in the text box. | |
void | enable_word_ellipsis () |
Show an ellipsis "..." if words don't fit in the text box. | |
void | disable_word_ellipsis () |
Do not show an ellipsis "..." if words don't fit in the text box. | |
bool | is_word_ellipsis_enabled () const |
Checks if word ellipsis is enabled. | |
void | set_formatting_enabled (bool enabled) |
Enables color formatting. | |
void | enable_formatting () |
Enables color formatting. | |
void | disable_formatting () |
Disables color formatting. | |
bool | is_formatting_enabled () const |
Checks if color formatting is enabled. | |
void | set_vertex_cache_strategy (vertex_cache_strategy strategy) |
Selects the strategy for using vertex caches. | |
vertex_cache_strategy | get_vertex_cache_strategy () const |
Gets the strategy for using vertex caches. | |
void | set_text (const utils::ustring &content) |
Sets the rendered text. | |
void | notify_scaling_factor_updated () override |
Tells this region that the global interface scaling factor has changed. | |
void | parse_layout (const layout_node &node) override |
Parses data from a layout_node. | |
text * | get_text_object () |
Returns the text used to render this font_string. | |
const text * | get_text_object () const |
Returns the text used to render this font_string. | |
utils::owner_ptr< region > | release_from_parent () override |
Removes this region from its parent and return an owning pointer. | |
layer | get_draw_layer () const |
Returns this layered_region's draw layer. | |
void | set_draw_layer (layer layer_id) |
Sets this layered_region's draw layer. | |
int | get_region_level () const |
Sets the region level. | |
void | set_region_level (int region_level) |
Sets this layered_region's region level. | |
void | notify_renderer_need_redraw () override |
Notifies the renderer of this region that it needs to be redrawn. | |
virtual void | update (float delta) |
Updates this region's logic. | |
virtual void | notify_borders_need_update () |
Tells this region that its borders need updating. | |
const std::string & | get_name () const |
Returns this region's name. | |
const std::string & | get_raw_name () const |
Returns this region's raw name. | |
utils::observer_ptr< const frame > | get_parent () const |
Returns this region's parent. | |
const utils::observer_ptr< frame > & | get_parent () |
Returns this region's parent. | |
void | destroy () |
Forcefully removes this region from the GUI. | |
void | set_alpha (float alpha) |
Changes this region's alpha (opacity). | |
float | get_alpha () const |
Returns this region's alpha (opacity). | |
float | get_effective_alpha () const |
Returns this region's effective alpha (opacity). | |
void | show () |
shows this region. | |
void | hide () |
hides this region. | |
void | set_shown (bool is_shown) |
shows/hides this region. | |
bool | is_shown () const |
Checks if this region is shown. | |
bool | is_visible () const |
Checks if this region can be seen on the screen. | |
bool | is_valid () const |
Checks if this region has all its borders correctly defined. | |
virtual void | set_dimensions (const vector2f &dimensions) |
Changes this region's absolute dimensions (in pixels). | |
virtual void | set_width (float abs_width) |
Changes this region's absolute width (in pixels). | |
virtual void | set_height (float abs_height) |
Changes this region's absolute height (in pixels). | |
void | set_relative_dimensions (const vector2f &dimensions) |
Changes this region's dimensions (relative to its parent). | |
void | set_relative_width (float rel_width) |
Changes this region's width (relative to its parent). | |
void | set_relative_height (float rel_height) |
Changes this region's height (relative to its parent). | |
const vector2f & | get_dimensions () const |
Returns this region's explicitly-defined width and height (in pixels). | |
vector2f | get_apparent_dimensions () const |
Returns this region's apparent width and height (in pixels). | |
bool | is_apparent_width_defined () const |
Checks if this region's apparent width is defined. | |
bool | is_apparent_height_defined () const |
Checks if this region's apparent height is defined. | |
virtual bool | is_in_region (const vector2f &position) const |
Checks if the provided coordinates are inside this region. | |
const std::string & | get_region_type () const |
Returns the type of this region. | |
bool | is_region_type (const std::string &type_name) const |
Checks if this region is of the provided type. | |
template<typename ObjectType > | |
bool | is_region_type () const |
Checks if this region is of the provided type. | |
bool | is_region_type (const region &obj) const |
Checks if this region is of a type equal or derived from the supplied region. | |
float | get_bottom () const |
Returns the vertical position of this region's bottom border. | |
vector2f | get_center () const |
Returns the position of this region's center. | |
float | get_left () const |
Returns the horizontal position of this region's left border. | |
float | get_right () const |
Returns the horizontal position of this region's right border. | |
float | get_top () const |
Returns the vertical position of this region's top border. | |
const bounds2f & | get_borders () const |
Returns this region's borders. | |
void | clear_all_anchors () |
Removes all anchors. | |
void | set_all_anchors (const utils::observer_ptr< region > &obj) |
Adjusts this regions anchors to fit the provided region. | |
void | set_all_anchors (const std::string &obj_name) |
Adjusts this regions anchors to fit the provided region. | |
void | set_anchor (const anchor_data &a) |
Adds/replaces an anchor. | |
template<typename... Args> | |
void | set_anchor (Args &&... args) |
Adds/replaces an anchor. | |
bool | depends_on (const region &obj) const |
Checks if this region depends on another. | |
std::size_t | get_anchor_count () const |
Returns the number of defined anchors. | |
anchor & | modify_anchor (point p) |
Returns one of this region's anchor to modify it. | |
const anchor & | get_anchor (point p) const |
Returns one of this region's anchor. | |
const std::array< std::optional< anchor >, 9 > & | get_anchors () const |
Returns all of this region's anchors. | |
float | round_to_pixel (float value, utils::rounding_method method=utils::rounding_method::nearest) const |
Round an absolute position on screen to the nearest physical pixel. | |
vector2f | round_to_pixel (const vector2f &position, utils::rounding_method method=utils::rounding_method::nearest) const |
Round an absolute position on screen to the nearest physical pixel. | |
void | add_anchored_object (region &obj) |
Notifies this region that another one is anchored to it. | |
void | remove_anchored_object (region &obj) |
Notifies this region that another one is no longer anchored to it. | |
bool | is_virtual () const |
Checks if this region is virtual. | |
void | set_manually_inherited (bool manually_inherited) |
Flags this region as manually inherited or not. | |
bool | is_manually_inherited () const |
Checks if this object is manually inherited. | |
virtual utils::observer_ptr< const frame_renderer > | get_effective_frame_renderer () const |
Returns the renderer of this object or its parents. | |
utils::observer_ptr< frame_renderer > | get_effective_frame_renderer () |
Returns the renderer of this object or its parents, nullptr if none. | |
const std::vector< utils::observer_ptr< region > > & | get_anchored_objects () const |
Returns the list of all objects that are anchored to this one. | |
virtual void | notify_loaded () |
Notifies this region that it has been fully loaded. | |
bool | is_loaded () const |
Checks if this region has been fully loaded. | |
virtual void | notify_visible () |
Notifies this region that it is now visible on screen. | |
virtual void | notify_invisible () |
Notifies this region that it is no longer visible on screen. | |
void | set_addon (const addon *a) |
Sets the addon this frame belongs to. | |
const addon * | get_addon () const |
Returns this frame's addon. | |
std::string | parse_file_name (const std::string &file_name) const |
Convert an addon-relative file path to a application-relative path. | |
manager & | get_manager () |
Returns this region's manager. | |
const manager & | get_manager () const |
Returns this region's manager. | |
registry & | get_registry () |
Returns the UI object registry, which keeps track of all objects in the UI. | |
const registry & | get_registry () const |
Returns the UI object registry, which keeps track of all objects in the UI. | |
void | remove_glue () |
Removes the Lua glue. | |
Static Public Member Functions | |
static void | register_on_lua (sol::state &lua) |
Registers this region class to the provided Lua state. | |
Static Public Attributes | |
static constexpr const char * | class_name = "FontString" |
Protected Member Functions | |
virtual void | parse_size_node_ (const layout_node &node) |
virtual void | parse_anchor_node_ (const layout_node &node) |
color | parse_color_node_ (const layout_node &node) |
vector2< std::optional< float > > | parse_offset_node_ (const layout_node &node) |
vector2< float > | parse_offset_node_or_ (const layout_node &node, float fallback) |
std::pair< anchor_type, vector2< std::optional< float > > > | parse_dimension_node_ (const layout_node &node) |
void | read_anchors_ (float &left, float &right, float &top, float &bottom, float &x_center, float &y_center) const |
bool | make_borders_ (float &min, float &max, float center, float size) const |
sol::state & | get_lua_ () |
const sol::state & | get_lua_ () const |
template<typename T > | |
void | create_glue_ (T &self) |
void | set_lua_member_ (std::string key, sol::stack_object value) |
sol::object | get_lua_member_ (const std::string &key) const |
void | set_virtual_ () |
Makes this region virtual. | |
void | set_name_ (const std::string &name) |
Sets this region's name. | |
virtual void | set_parent_ (utils::observer_ptr< frame > parent) |
Changes this region's parent. | |
template<typename T > | |
void | initialize_ (T &self, const region_core_attributes &attr) |
Set up function to call in all derived class constructors. | |
Static Protected Member Functions | |
template<typename T > | |
static const std::vector< std::string > & | get_type_list_impl_ () |
Protected Attributes | |
layer | layer_ = layer::artwork |
int | region_level_ = 0 |
manager & | manager_ |
const addon * | addon_ = nullptr |
std::string | name_ |
std::string | raw_name_ |
utils::observer_ptr< frame > | parent_ = nullptr |
bool | is_manually_inherited_ = false |
bool | is_virtual_ = false |
bool | is_loaded_ = false |
bool | is_valid_ = true |
std::array< std::optional< anchor >, 9 > | anchor_list_ |
bounds2< bool > | defined_borders_ |
bounds2f | borders_ |
float | alpha_ = 1.0f |
bool | is_shown_ = true |
bool | is_visible_ = true |
vector2f | dimensions_ |
std::vector< utils::observer_ptr< region > > | anchored_object_list_ |
A layered_region that can draw text on the screen.
This class holds a string and a reference to a font, which is used to draw the string on the screen. The appearance of the string can be changed (font, size, color, alignment, wrapping). In addition, it is possible to change the color of a portion of the string, for example to highlight a particular name.
Sizing. The font_string class has a special property when it comes to determining the size of its region on the screen, hence how other object anchor to it, and how it anchors to other objects. See the documentation for #region for more information on anchors. While other regions must either have a fixed size or more than two anchors constraining their size, the font_string does not. If only one anchor is specified, the width and height of the font_string will be determined by the area occupied by the displayed text, however long and tall this may be. If the width is already constrained by the fixed size or anchors, then the text will word wrap (if allowed) and the font_string's height will be as tall as the height of the wrapped text. Finally, if both the width and height are constrained by fixed sizes or anchors, the text will simply word wrap (if allowed) and be cut to fit in the specified area.
Definition at line 48 of file gui_font_string.hpp.
Definition at line 50 of file gui_font_string.hpp.
|
explicit |
Constructor.
Definition at line 14 of file gui_font_string.cpp.
|
inherited |
Notifies this region that another one is anchored to it.
obj | The anchored region |
Definition at line 561 of file gui_region.cpp.
|
inherited |
Removes all anchors.
Definition at line 365 of file gui_region.cpp.
|
overridevirtual |
Copies a region's parameters into this font_string (inheritance).
obj | The region to copy |
Reimplemented from lxgui::gui::region.
Definition at line 93 of file gui_font_string.cpp.
|
protectedinherited |
Definition at line 136 of file gui_region_tpl.hpp.
|
inherited |
Checks if this region depends on another.
obj | The region to test |
Definition at line 503 of file gui_region.cpp.
|
inherited |
Forcefully removes this region from the GUI.
Definition at line 333 of file gui_region.cpp.
|
inline |
Disables color formatting.
Definition at line 365 of file gui_font_string.hpp.
|
inline |
Does not allow large text without whitespace to wrap.
Definition at line 260 of file gui_font_string.hpp.
|
inline |
Makes this font_string draw a shadow under its text.
Definition at line 288 of file gui_font_string.hpp.
|
inline |
Do not show an ellipsis "..." if words don't fit in the text box.
Definition at line 336 of file gui_font_string.hpp.
|
inline |
Disables word wrap.
Definition at line 309 of file gui_font_string.hpp.
|
inline |
Enables color formatting.
Definition at line 357 of file gui_font_string.hpp.
|
inline |
Allows large text without whitespace to wrap.
Definition at line 252 of file gui_font_string.hpp.
|
inline |
Makes this font_string draw a shadow under its text.
Definition at line 280 of file gui_font_string.hpp.
|
inline |
Show an ellipsis "..." if words don't fit in the text box.
Definition at line 329 of file gui_font_string.hpp.
|
inline |
Enables word wrap.
Definition at line 302 of file gui_font_string.hpp.
|
inherited |
Returns this frame's addon.
Definition at line 843 of file gui_region.cpp.
alignment_x lxgui::gui::font_string::get_alignment_x | ( | ) | const |
Returns the horizontal alignment behavior.
Definition at line 145 of file gui_font_string.cpp.
alignment_y lxgui::gui::font_string::get_alignment_y | ( | ) | const |
Returns the vertical alignment behavior.
Definition at line 149 of file gui_font_string.cpp.
|
inherited |
Returns this region's alpha (opacity).
Definition at line 157 of file gui_region.cpp.
Returns one of this region's anchor.
p | The anchor point |
Definition at line 539 of file gui_region.cpp.
|
inherited |
Returns the number of defined anchors.
Definition at line 519 of file gui_region.cpp.
|
inherited |
Returns the list of all objects that are anchored to this one.
Definition at line 790 of file gui_region.cpp.
|
inherited |
Returns all of this region's anchors.
Definition at line 549 of file gui_region.cpp.
|
inherited |
Returns this region's apparent width and height (in pixels).
Definition at line 276 of file gui_region.cpp.
|
inherited |
Returns this region's borders.
Definition at line 361 of file gui_region.cpp.
|
inherited |
Returns the vertical position of this region's bottom border.
Definition at line 357 of file gui_region.cpp.
|
inherited |
Returns the position of this region's center.
Definition at line 341 of file gui_region.cpp.
|
inherited |
Returns this region's explicitly-defined width and height (in pixels).
Definition at line 272 of file gui_region.cpp.
|
inherited |
Returns this layered_region's draw layer.
Definition at line 35 of file gui_layered_region.cpp.
|
inherited |
Returns this region's effective alpha (opacity).
Definition at line 161 of file gui_region.cpp.
|
inlineinherited |
Returns the renderer of this object or its parents, nullptr if none.
Definition at line 615 of file gui_region.hpp.
|
virtualinherited |
Returns the renderer of this object or its parents.
Reimplemented in lxgui::gui::frame.
Definition at line 802 of file gui_region.cpp.
float lxgui::gui::font_string::get_font_height | ( | ) | const |
Returns the height of the font.
Definition at line 124 of file gui_font_string.cpp.
const std::string & lxgui::gui::font_string::get_font_name | ( | ) | const |
Returns the name of the font file.
Definition at line 120 of file gui_font_string.cpp.
|
inherited |
Returns the horizontal position of this region's left border.
Definition at line 345 of file gui_region.cpp.
float lxgui::gui::font_string::get_line_spacing | ( | ) | const |
Returns the space between each line as a fraction of the font height.
Definition at line 169 of file gui_font_string.cpp.
|
protectedinherited |
Definition at line 767 of file gui_region.cpp.
|
protectedinherited |
Definition at line 771 of file gui_region.cpp.
|
protectedinherited |
|
inlineinherited |
Returns this region's manager.
Definition at line 693 of file gui_region.hpp.
|
inlineinherited |
Returns this region's manager.
Definition at line 701 of file gui_region.hpp.
|
inherited |
Returns this region's name.
Definition at line 140 of file gui_region.cpp.
const vector2f & lxgui::gui::font_string::get_offset | ( | ) | const |
Returns this font_string's offset.
Definition at line 161 of file gui_font_string.cpp.
|
inlineinherited |
Returns this region's parent.
Definition at line 237 of file gui_region.hpp.
|
inlineinherited |
Returns this region's parent.
Definition at line 229 of file gui_region.hpp.
|
inherited |
Returns this region's raw name.
Definition at line 144 of file gui_region.cpp.
|
inherited |
Sets the region level.
Definition at line 48 of file gui_layered_region.cpp.
|
inherited |
Returns the type of this region.
Definition at line 148 of file gui_region.cpp.
|
inherited |
Returns the UI object registry, which keeps track of all objects in the UI.
Definition at line 850 of file gui_region.cpp.
|
inherited |
Returns the UI object registry, which keeps track of all objects in the UI.
Definition at line 855 of file gui_region.cpp.
|
inherited |
Returns the horizontal position of this region's right border.
Definition at line 349 of file gui_region.cpp.
const color & lxgui::gui::font_string::get_shadow_color | ( | ) | const |
Returns this font_string's shadow color.
Definition at line 153 of file gui_font_string.cpp.
const vector2f & lxgui::gui::font_string::get_shadow_offset | ( | ) | const |
Returns this font_string's shadow offset.
Definition at line 157 of file gui_font_string.cpp.
float lxgui::gui::font_string::get_spacing | ( | ) | const |
Returns the space between each letter.
Definition at line 165 of file gui_font_string.cpp.
float lxgui::gui::font_string::get_string_height | ( | ) | const |
Returns the height of the string if no format or wrapping is applied.
Definition at line 323 of file gui_font_string.cpp.
float lxgui::gui::font_string::get_string_width | ( | ) | const |
Returns the width of the string if no format or wrapping is applied.
Definition at line 330 of file gui_font_string.cpp.
float lxgui::gui::font_string::get_string_width | ( | const utils::ustring & | content | ) | const |
Returns the width of a string if no format or wrapping is applied.
content | The string for which to calculate the width |
Definition at line 337 of file gui_font_string.cpp.
const utils::ustring & lxgui::gui::font_string::get_text | ( | ) | const |
Returns the rendered text (with format tags).
Definition at line 344 of file gui_font_string.cpp.
const color & lxgui::gui::font_string::get_text_color | ( | ) | const |
text * lxgui::gui::font_string::get_text_object | ( | ) |
Returns the text used to render this font_string.
Definition at line 458 of file gui_font_string.cpp.
const text * lxgui::gui::font_string::get_text_object | ( | ) | const |
Returns the text used to render this font_string.
Definition at line 462 of file gui_font_string.cpp.
|
inherited |
Returns the vertical position of this region's top border.
Definition at line 353 of file gui_region.cpp.
|
staticprotectedinherited |
Definition at line 147 of file gui_region_tpl.hpp.
vertex_cache_strategy lxgui::gui::font_string::get_vertex_cache_strategy | ( | ) | const |
Gets the strategy for using vertex caches.
Definition at line 454 of file gui_font_string.cpp.
|
inherited |
hides this region.
Definition at line 186 of file gui_region.cpp.
|
protectedinherited |
Set up function to call in all derived class constructors.
self | A pointer to the derived this |
attr | The region attributes provided to the constructor |
Definition at line 141 of file gui_region_tpl.hpp.
|
inherited |
Checks if this region's apparent height is defined.
Definition at line 284 of file gui_region.cpp.
|
inherited |
Checks if this region's apparent width is defined.
Definition at line 280 of file gui_region.cpp.
bool lxgui::gui::font_string::is_formatting_enabled | ( | ) | const |
Checks if color formatting is enabled.
Definition at line 419 of file gui_font_string.cpp.
|
virtualinherited |
Checks if the provided coordinates are inside this region.
position | The coordinates to test |
Reimplemented in lxgui::gui::frame, and lxgui::gui::slider.
Definition at line 288 of file gui_region.cpp.
|
inherited |
Checks if this region has been fully loaded.
Definition at line 798 of file gui_region.cpp.
|
inherited |
Checks if this object is manually inherited.
Definition at line 784 of file gui_region.cpp.
bool lxgui::gui::font_string::is_non_space_wrap_enabled | ( | ) | const |
Checks if large text is truncated or wrapped.
Definition at line 319 of file gui_font_string.cpp.
bool lxgui::gui::font_string::is_outlined | ( | ) | const |
Check if this font_string is outlined.
Definition at line 141 of file gui_font_string.cpp.
|
inlineinherited |
Checks if this region is of the provided type.
Definition at line 423 of file gui_region.hpp.
|
inlineinherited |
Checks if this region is of a type equal or derived from the supplied region.
Definition at line 431 of file gui_region.hpp.
|
inherited |
Checks if this region is of the provided type.
type_name | The type to test |
Definition at line 152 of file gui_region.cpp.
bool lxgui::gui::font_string::is_shadow_enabled | ( | ) | const |
Checks if this font_string draws a shadow under its text.
Definition at line 358 of file gui_font_string.cpp.
|
inherited |
Checks if this region is shown.
Definition at line 203 of file gui_region.cpp.
|
inherited |
Checks if this region has all its borders correctly defined.
Definition at line 211 of file gui_region.cpp.
|
inherited |
Checks if this region is virtual.
Definition at line 553 of file gui_region.cpp.
|
inherited |
Checks if this region can be seen on the screen.
Definition at line 207 of file gui_region.cpp.
bool lxgui::gui::font_string::is_word_ellipsis_enabled | ( | ) | const |
Checks if word ellipsis is enabled.
Definition at line 402 of file gui_font_string.cpp.
bool lxgui::gui::font_string::is_word_wrap_enabled | ( | ) | const |
Checks if word wrap is enabled.
Definition at line 385 of file gui_font_string.cpp.
|
protectedinherited |
Definition at line 585 of file gui_region.cpp.
Returns one of this region's anchor to modify it.
p | The anchor point |
Definition at line 529 of file gui_region.cpp.
|
virtualinherited |
Tells this region that its borders need updating.
Reimplemented in lxgui::gui::slider.
Definition at line 744 of file gui_region.cpp.
|
virtualinherited |
Notifies this region that it is no longer visible on screen.
Reimplemented in lxgui::gui::frame.
Definition at line 813 of file gui_region.cpp.
|
virtualinherited |
Notifies this region that it has been fully loaded.
Reimplemented in lxgui::gui::frame.
Definition at line 794 of file gui_region.cpp.
|
overridevirtualinherited |
Notifies the renderer of this region that it needs to be redrawn.
Reimplemented from lxgui::gui::region.
Definition at line 61 of file gui_layered_region.cpp.
|
overridevirtual |
Tells this region that the global interface scaling factor has changed.
Reimplemented from lxgui::gui::region.
Definition at line 177 of file gui_font_string.cpp.
|
virtualinherited |
Notifies this region that it is now visible on screen.
Reimplemented in lxgui::gui::frame.
Definition at line 808 of file gui_region.cpp.
|
protectedvirtualinherited |
Definition at line 89 of file gui_region_parser.cpp.
|
protectedinherited |
Definition at line 10 of file gui_region_parser.cpp.
|
protectedinherited |
Definition at line 35 of file gui_region_parser.cpp.
|
inherited |
Convert an addon-relative file path to a application-relative path.
file_name | The raw file name |
Definition at line 818 of file gui_region.cpp.
|
overridevirtual |
Parses data from a layout_node.
node | The layout node |
Reimplemented from lxgui::gui::region.
Definition at line 9 of file gui_font_string_parser.cpp.
|
protectedinherited |
Definition at line 24 of file gui_region_parser.cpp.
|
protectedinherited |
Definition at line 28 of file gui_region_parser.cpp.
|
protectedvirtualinherited |
Definition at line 65 of file gui_region_parser.cpp.
|
protectedinherited |
Definition at line 614 of file gui_region.cpp.
|
static |
Registers this region class to the provided Lua state.
|
overridevirtualinherited |
Removes this region from its parent and return an owning pointer.
Reimplemented from lxgui::gui::region.
Definition at line 28 of file gui_layered_region.cpp.
|
inherited |
Notifies this region that another one is no longer anchored to it.
obj | The region no longer anchored |
Definition at line 565 of file gui_region.cpp.
|
inherited |
Removes the Lua glue.
Definition at line 775 of file gui_region.cpp.
|
overridevirtual |
Renders this region on the current render target.
Reimplemented from lxgui::gui::region.
Definition at line 24 of file gui_font_string.cpp.
|
inherited |
Round an absolute position on screen to the nearest physical pixel.
position | The input absolute position (can be fractional) |
method | The rounding method |
Definition at line 578 of file gui_region.cpp.
|
inherited |
Round an absolute position on screen to the nearest physical pixel.
value | The input absolute position (can be fractional) |
method | The rounding method |
Definition at line 573 of file gui_region.cpp.
|
overridevirtual |
Prints all relevant information about this region in a string.
tab | The offset to give to all lines |
Reimplemented from lxgui::gui::region.
Definition at line 67 of file gui_font_string.cpp.
|
inherited |
Sets the addon this frame belongs to.
a | The addon this frame belongs to |
Definition at line 833 of file gui_region.cpp.
void lxgui::gui::font_string::set_alignment_x | ( | alignment_x | align_x | ) |
Sets this font_string's horizontal alignment behavior.
align_x | The horizontal alignment behavior |
Definition at line 233 of file gui_font_string.cpp.
void lxgui::gui::font_string::set_alignment_y | ( | alignment_y | align_y | ) |
Sets this font_string's vertical alignment behavior.
align_y | The vertical alignment behavior |
Definition at line 246 of file gui_font_string.cpp.
|
inherited |
Adjusts this regions anchors to fit the provided region.
obj_name | The name of the object to fit to |
Definition at line 404 of file gui_region.cpp.
|
inherited |
Adjusts this regions anchors to fit the provided region.
obj | A pointer to the object you want to wrap |
Definition at line 437 of file gui_region.cpp.
|
inherited |
Changes this region's alpha (opacity).
alpha | The new alpha value |
Definition at line 169 of file gui_region.cpp.
|
inlineinherited |
Adds/replaces an anchor.
args | Argument to construct a new anchor_data |
Definition at line 503 of file gui_region.hpp.
|
inherited |
Adds/replaces an anchor.
a | The anchor to add |
Definition at line 473 of file gui_region.cpp.
|
virtualinherited |
Changes this region's absolute dimensions (in pixels).
dimensions | The new dimensions |
Reimplemented in lxgui::gui::frame.
Definition at line 215 of file gui_region.cpp.
|
inherited |
Sets this layered_region's draw layer.
layer_id | The new layer |
Definition at line 39 of file gui_layered_region.cpp.
void lxgui::gui::font_string::set_font | ( | const std::string & | font_name, |
float | height | ||
) |
Sets this font_string's font (file and size).
font_name | The file path to the .ttf file |
height | The font height |
Definition at line 221 of file gui_font_string.cpp.
void lxgui::gui::font_string::set_formatting_enabled | ( | bool | enabled | ) |
Enables color formatting.
enabled | 'true' to enable color formatting |
Definition at line 406 of file gui_font_string.cpp.
|
virtualinherited |
Changes this region's absolute height (in pixels).
abs_height | The new height |
Reimplemented in lxgui::gui::frame.
Definition at line 239 of file gui_region.cpp.
void lxgui::gui::font_string::set_line_spacing | ( | float | line_spacing | ) |
Sets the space between each line as a fraction of the font height.
line_spacing | The space between each line, as a relative factor of the font height |
Definition at line 298 of file gui_font_string.cpp.
|
protectedinherited |
|
inherited |
Flags this region as manually inherited or not.
Definition at line 780 of file gui_region.cpp.
|
protectedinherited |
Sets this region's name.
name | This region's name |
Definition at line 294 of file gui_region.cpp.
void lxgui::gui::font_string::set_non_space_wrap_enabled | ( | bool | enabled | ) |
Sets whether large text without whitespace is truncated or wrapped.
enabled | 'true' to wrap, 'false' to truncate |
Definition at line 348 of file gui_font_string.cpp.
void lxgui::gui::font_string::set_offset | ( | const vector2f & | offset | ) |
Sets this font_string's offset.
offset | Offset |
Definition at line 277 of file gui_font_string.cpp.
void lxgui::gui::font_string::set_outlined | ( | bool | outlined | ) |
Adds or remove the outline around the text.
outlined | 'true' to enable the outline |
Definition at line 128 of file gui_font_string.cpp.
|
protectedvirtualinherited |
Changes this region's parent.
parent | The new parent |
Reimplemented in lxgui::gui::frame.
Definition at line 312 of file gui_region.cpp.
|
inherited |
Sets this layered_region's region level.
region_level | The new level |
Definition at line 52 of file gui_layered_region.cpp.
|
inherited |
Changes this region's dimensions (relative to its parent).
dimensions | The new dimensions (relative) |
Definition at line 251 of file gui_region.cpp.
|
inherited |
Changes this region's height (relative to its parent).
rel_height | The new height |
Definition at line 265 of file gui_region.cpp.
|
inherited |
Changes this region's width (relative to its parent).
rel_width | The new width |
Definition at line 258 of file gui_region.cpp.
void lxgui::gui::font_string::set_shadow_color | ( | const color & | shadow_color | ) |
Sets this font_string's shadow color.
shadow_color | The shadow color |
Definition at line 259 of file gui_font_string.cpp.
void lxgui::gui::font_string::set_shadow_enabled | ( | bool | enabled | ) |
Sets whether this font_string should draw a shadow under its text.
enabled | 'true' to enable shadow |
Definition at line 362 of file gui_font_string.cpp.
void lxgui::gui::font_string::set_shadow_offset | ( | const vector2f & | shadow_offset | ) |
Sets this font_string's shadow offset.
shadow_offset | Offset |
Definition at line 268 of file gui_font_string.cpp.
|
inherited |
shows/hides this region.
is_shown | 'true' if you want to show this region |
Definition at line 196 of file gui_region.cpp.
void lxgui::gui::font_string::set_spacing | ( | float | spacing | ) |
Sets the space between each letter.
spacing | The space between each letter |
Definition at line 286 of file gui_font_string.cpp.
void lxgui::gui::font_string::set_text | ( | const utils::ustring & | content | ) |
Sets the rendered text.
content | The rendered text |
Definition at line 423 of file gui_font_string.cpp.
void lxgui::gui::font_string::set_text_color | ( | const color & | text_color | ) |
Sets the text color.
text_color | The text color |
Definition at line 310 of file gui_font_string.cpp.
void lxgui::gui::font_string::set_vertex_cache_strategy | ( | vertex_cache_strategy | strategy | ) |
Selects the strategy for using vertex caches.
strategy | The new strategy |
Definition at line 450 of file gui_font_string.cpp.
|
protectedinherited |
|
virtualinherited |
Changes this region's absolute width (in pixels).
abs_width | The new width |
Reimplemented in lxgui::gui::frame.
Definition at line 227 of file gui_region.cpp.
void lxgui::gui::font_string::set_word_ellipsis_enabled | ( | bool | enabled | ) |
Sets whether to show an ellipsis "..." if words don't fit in the text box.
enabled | 'true' to put "..." at the end of a truncated line |
Definition at line 389 of file gui_font_string.cpp.
void lxgui::gui::font_string::set_word_wrap_enabled | ( | bool | enabled | ) |
Enables/disables word wrap.
enabled | 'true' to enable word wrap |
Definition at line 372 of file gui_font_string.cpp.
|
inherited |
shows this region.
Definition at line 176 of file gui_region.cpp.
|
virtualinherited |
Updates this region's logic.
delta | Time spent since last update |
Reimplemented in lxgui::gui::frame, and lxgui::gui::animated_texture.
Definition at line 763 of file gui_region.cpp.
|
protectedinherited |
Definition at line 802 of file gui_region.hpp.
|
protectedinherited |
Definition at line 818 of file gui_region.hpp.
|
protectedinherited |
Definition at line 814 of file gui_region.hpp.
|
protectedinherited |
Definition at line 824 of file gui_region.hpp.
|
protectedinherited |
Definition at line 816 of file gui_region.hpp.
|
staticconstexpr |
Definition at line 426 of file gui_font_string.hpp.
|
protectedinherited |
Definition at line 815 of file gui_region.hpp.
|
protectedinherited |
Definition at line 822 of file gui_region.hpp.
|
protectedinherited |
Definition at line 811 of file gui_region.hpp.
|
protectedinherited |
Definition at line 809 of file gui_region.hpp.
|
protectedinherited |
Definition at line 819 of file gui_region.hpp.
|
protectedinherited |
Definition at line 812 of file gui_region.hpp.
|
protectedinherited |
Definition at line 810 of file gui_region.hpp.
|
protectedinherited |
Definition at line 820 of file gui_region.hpp.
|
protectedinherited |
Definition at line 92 of file gui_layered_region.hpp.
|
protectedinherited |
Definition at line 800 of file gui_region.hpp.
|
protectedinherited |
Definition at line 804 of file gui_region.hpp.
|
protectedinherited |
Definition at line 807 of file gui_region.hpp.
|
protectedinherited |
Definition at line 805 of file gui_region.hpp.
|
protectedinherited |
Definition at line 93 of file gui_layered_region.hpp.