lxgui
Public Types | Public Member Functions | Static Public Member Functions | Static Public Attributes | Protected Member Functions | Static Protected Member Functions | Protected Attributes | List of all members
lxgui::gui::font_string Class Reference

A layered_region that can draw text on the screen. More...

#include <gui_font_string.hpp>

Inheritance diagram for lxgui::gui::font_string:
lxgui::gui::layered_region lxgui::gui::region

Public Types

using base = layered_region
 

Public Member Functions

 font_string (utils::control_block &block, manager &mgr, const region_core_attributes &attr)
 Constructor. More...
 
std::string serialize (const std::string &tab) const override
 Prints all relevant information about this region in a string. More...
 
void render () const override
 Renders this region on the current render target. More...
 
void copy_from (const region &obj) override
 Copies a region's parameters into this font_string (inheritance). More...
 
const std::string & get_font_name () const
 Returns the name of the font file. More...
 
float get_font_height () const
 Returns the height of the font. More...
 
void set_outlined (bool outlined)
 Adds or remove the outline around the text. More...
 
bool is_outlined () const
 Check if this font_string is outlined. More...
 
alignment_x get_alignment_x () const
 Returns the horizontal alignment behavior. More...
 
alignment_y get_alignment_y () const
 Returns the vertical alignment behavior. More...
 
const colorget_shadow_color () const
 Returns this font_string's shadow color. More...
 
const vector2fget_shadow_offset () const
 Returns this font_string's shadow offset. More...
 
const vector2fget_offset () const
 Returns this font_string's offset. More...
 
float get_spacing () const
 Returns the space between each letter. More...
 
float get_line_spacing () const
 Returns the space between each line as a fraction of the font height. More...
 
const colorget_text_color () const
 Returns the text color. More...
 
void set_font (const std::string &font_name, float height)
 Sets this font_string's font (file and size). More...
 
void set_alignment_x (alignment_x align_x)
 Sets this font_string's horizontal alignment behavior. More...
 
void set_alignment_y (alignment_y align_y)
 Sets this font_string's vertical alignment behavior. More...
 
void set_shadow_color (const color &shadow_color)
 Sets this font_string's shadow color. More...
 
void set_shadow_offset (const vector2f &shadow_offset)
 Sets this font_string's shadow offset. More...
 
void set_offset (const vector2f &offset)
 Sets this font_string's offset. More...
 
void set_spacing (float spacing)
 Sets the space between each letter. More...
 
void set_line_spacing (float line_spacing)
 Sets the space between each line as a fraction of the font height. More...
 
void set_text_color (const color &text_color)
 Sets the text color. More...
 
bool is_non_space_wrap_enabled () const
 Checks if large text is truncated or wrapped. More...
 
float get_string_height () const
 Returns the height of the string if no format or wrapping is applied. More...
 
float get_string_width () const
 Returns the width of the string if no format or wrapping is applied. More...
 
float get_string_width (const utils::ustring &content) const
 Returns the width of a string if no format or wrapping is applied. More...
 
const utils::ustring & get_text () const
 Returns the rendered text (with format tags). More...
 
void set_non_space_wrap_enabled (bool enabled)
 Sets whether large text without whitespace is truncated or wrapped. More...
 
void enable_non_space_wrap ()
 Allows large text without whitespace to wrap. More...
 
void disable_non_space_wrap ()
 Does not allow large text without whitespace to wrap. More...
 
bool is_shadow_enabled () const
 Checks if this font_string draws a shadow under its text. More...
 
void set_shadow_enabled (bool enabled)
 Sets whether this font_string should draw a shadow under its text. More...
 
void enable_shadow ()
 Makes this font_string draw a shadow under its text. More...
 
void disable_shadow ()
 Makes this font_string draw a shadow under its text. More...
 
void set_word_wrap_enabled (bool enabled)
 Enables/disables word wrap. More...
 
void enable_word_wrap ()
 Enables word wrap. More...
 
void disable_word_wrap ()
 Disables word wrap. More...
 
bool is_word_wrap_enabled () const
 Checks if word wrap is enabled. More...
 
void set_word_ellipsis_enabled (bool enabled)
 Sets whether to show an ellipsis "..." if words don't fit in the text box. More...
 
void enable_word_ellipsis ()
 Show an ellipsis "..." if words don't fit in the text box. More...
 
void disable_word_ellipsis ()
 Do not show an ellipsis "..." if words don't fit in the text box. More...
 
bool is_word_ellipsis_enabled () const
 Checks if word ellipsis is enabled. More...
 
void set_formatting_enabled (bool enabled)
 Enables color formatting. More...
 
void enable_formatting ()
 Enables color formatting. More...
 
void disable_formatting ()
 Disables color formatting. More...
 
bool is_formatting_enabled () const
 Checks if color formatting is enabled. More...
 
void set_vertex_cache_strategy (vertex_cache_strategy strategy)
 Selects the strategy for using vertex caches. More...
 
vertex_cache_strategy get_vertex_cache_strategy () const
 Gets the strategy for using vertex caches. More...
 
void set_text (const utils::ustring &content)
 Sets the rendered text. More...
 
void notify_scaling_factor_updated () override
 Tells this region that the global interface scaling factor has changed. More...
 
void parse_layout (const layout_node &node) override
 Parses data from a layout_node. More...
 
textget_text_object ()
 Returns the text used to render this font_string. More...
 
const textget_text_object () const
 Returns the text used to render this font_string. More...
 
utils::owner_ptr< regionrelease_from_parent () override
 Removes this region from its parent and return an owning pointer. More...
 
layer get_draw_layer () const
 Returns this layered_region's draw layer. More...
 
void set_draw_layer (layer layer_id)
 Sets this layered_region's draw layer. More...
 
int get_region_level () const
 Sets the region level. More...
 
void set_region_level (int region_level)
 Sets this layered_region's region level. More...
 
void notify_renderer_need_redraw () override
 Notifies the renderer of this region that it needs to be redrawn. More...
 
virtual void update (float delta)
 Updates this region's logic. More...
 
virtual void notify_borders_need_update ()
 Tells this region that its borders need updating. More...
 
const std::string & get_name () const
 Returns this region's name. More...
 
const std::string & get_raw_name () const
 Returns this region's raw name. More...
 
utils::observer_ptr< const frameget_parent () const
 Returns this region's parent. More...
 
const utils::observer_ptr< frame > & get_parent ()
 Returns this region's parent. More...
 
void destroy ()
 Forcefully removes this region from the GUI. More...
 
void set_alpha (float alpha)
 Changes this region's alpha (opacity). More...
 
float get_alpha () const
 Returns this region's alpha (opacity). More...
 
float get_effective_alpha () const
 Returns this region's effective alpha (opacity). More...
 
void show ()
 shows this region. More...
 
void hide ()
 hides this region. More...
 
void set_shown (bool is_shown)
 shows/hides this region. More...
 
bool is_shown () const
 Checks if this region is shown. More...
 
bool is_visible () const
 Checks if this region can be seen on the screen. More...
 
bool is_valid () const
 Checks if this region has all its borders correctly defined. More...
 
virtual void set_dimensions (const vector2f &dimensions)
 Changes this region's absolute dimensions (in pixels). More...
 
virtual void set_width (float abs_width)
 Changes this region's absolute width (in pixels). More...
 
virtual void set_height (float abs_height)
 Changes this region's absolute height (in pixels). More...
 
void set_relative_dimensions (const vector2f &dimensions)
 Changes this region's dimensions (relative to its parent). More...
 
void set_relative_width (float rel_width)
 Changes this region's width (relative to its parent). More...
 
void set_relative_height (float rel_height)
 Changes this region's height (relative to its parent). More...
 
const vector2fget_dimensions () const
 Returns this region's explicitly-defined width and height (in pixels). More...
 
vector2f get_apparent_dimensions () const
 Returns this region's apparent width and height (in pixels). More...
 
bool is_apparent_width_defined () const
 Checks if this region's apparent width is defined. More...
 
bool is_apparent_height_defined () const
 Checks if this region's apparent height is defined. More...
 
virtual bool is_in_region (const vector2f &position) const
 Checks if the provided coordinates are inside this region. More...
 
const std::string & get_region_type () const
 Returns the type of this region. More...
 
bool is_region_type (const std::string &type_name) const
 Checks if this region is of the provided type. More...
 
template<typename ObjectType >
bool is_region_type () const
 Checks if this region is of the provided type. More...
 
bool is_region_type (const region &obj) const
 Checks if this region is of a type equal or derived from the supplied region. More...
 
float get_bottom () const
 Returns the vertical position of this region's bottom border. More...
 
vector2f get_center () const
 Returns the position of this region's center. More...
 
float get_left () const
 Returns the horizontal position of this region's left border. More...
 
float get_right () const
 Returns the horizontal position of this region's right border. More...
 
float get_top () const
 Returns the vertical position of this region's top border. More...
 
const bounds2fget_borders () const
 Returns this region's borders. More...
 
void clear_all_anchors ()
 Removes all anchors. More...
 
void set_all_anchors (const utils::observer_ptr< region > &obj)
 Adjusts this regions anchors to fit the provided region. More...
 
void set_all_anchors (const std::string &obj_name)
 Adjusts this regions anchors to fit the provided region. More...
 
void set_anchor (const anchor_data &a)
 Adds/replaces an anchor. More...
 
template<typename... Args>
void set_anchor (Args &&... args)
 Adds/replaces an anchor. More...
 
bool depends_on (const region &obj) const
 Checks if this region depends on another. More...
 
std::size_t get_anchor_count () const
 Returns the number of defined anchors. More...
 
anchormodify_anchor (point p)
 Returns one of this region's anchor to modify it. More...
 
const anchorget_anchor (point p) const
 Returns one of this region's anchor. More...
 
const std::array< std::optional< anchor >, 9 > & get_anchors () const
 Returns all of this region's anchors. More...
 
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. More...
 
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. More...
 
void add_anchored_object (region &obj)
 Notifies this region that another one is anchored to it. More...
 
void remove_anchored_object (region &obj)
 Notifies this region that another one is no longer anchored to it. More...
 
bool is_virtual () const
 Checks if this region is virtual. More...
 
void set_manually_inherited (bool manually_inherited)
 Flags this region as manually inherited or not. More...
 
bool is_manually_inherited () const
 Checks if this object is manually inherited. More...
 
virtual utils::observer_ptr< const frame_rendererget_effective_frame_renderer () const
 Returns the renderer of this object or its parents. More...
 
utils::observer_ptr< frame_rendererget_effective_frame_renderer ()
 Returns the renderer of this object or its parents, nullptr if none. More...
 
const std::vector< utils::observer_ptr< region > > & get_anchored_objects () const
 Returns the list of all objects that are anchored to this one. More...
 
virtual void notify_loaded ()
 Notifies this region that it has been fully loaded. More...
 
bool is_loaded () const
 Checks if this region has been fully loaded. More...
 
virtual void notify_visible ()
 Notifies this region that it is now visible on screen. More...
 
virtual void notify_invisible ()
 Notifies this region that it is no longer visible on screen. More...
 
void set_addon (const addon *a)
 Sets the addon this frame belongs to. More...
 
const addonget_addon () const
 Returns this frame's addon. More...
 
std::string parse_file_name (const std::string &file_name) const
 Convert an addon-relative file path to a application-relative path. More...
 
managerget_manager ()
 Returns this region's manager. More...
 
const managerget_manager () const
 Returns this region's manager. More...
 
registryget_registry ()
 Returns the UI object registry, which keeps track of all objects in the UI. More...
 
const registryget_registry () const
 Returns the UI object registry, which keeps track of all objects in the UI. More...
 
void remove_glue ()
 Removes the Lua glue. More...
 

Static Public Member Functions

static void register_on_lua (sol::state &lua)
 Registers this region class to the provided Lua state. More...
 

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. More...
 
void set_name_ (const std::string &name)
 Sets this region's name. More...
 
virtual void set_parent_ (utils::observer_ptr< frame > parent)
 Changes this region's parent. More...
 
template<typename T >
void initialize_ (T &self, const region_core_attributes &attr)
 Set up function to call in all derived class constructors. More...
 

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
 
managermanager_
 
const addonaddon_ = nullptr
 
std::string name_
 
std::string raw_name_
 
utils::observer_ptr< frameparent_ = 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_
 

Detailed Description

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.

Member Typedef Documentation

◆ base

Definition at line 50 of file gui_font_string.hpp.

Constructor & Destructor Documentation

◆ font_string()

lxgui::gui::font_string::font_string ( utils::control_block &  block,
manager mgr,
const region_core_attributes attr 
)
explicit

Constructor.

Definition at line 14 of file gui_font_string.cpp.

Member Function Documentation

◆ add_anchored_object()

void lxgui::gui::region::add_anchored_object ( region obj)
inherited

Notifies this region that another one is anchored to it.

Parameters
objThe anchored region
Note
Anchored objects get their borders automatically updated whenever this object's borders are updated.

Definition at line 561 of file gui_region.cpp.

◆ clear_all_anchors()

void lxgui::gui::region::clear_all_anchors ( )
inherited

Removes all anchors.

Note
This region and its children won't be visible until you define at least one anchor.

Definition at line 365 of file gui_region.cpp.

◆ copy_from()

void lxgui::gui::font_string::copy_from ( const region obj)
overridevirtual

Copies a region's parameters into this font_string (inheritance).

Parameters
objThe region to copy

Reimplemented from lxgui::gui::region.

Definition at line 93 of file gui_font_string.cpp.

◆ create_glue_()

template<typename T >
void lxgui::gui::region::create_glue_ ( T &  self)
protectedinherited

Definition at line 136 of file gui_region_tpl.hpp.

◆ depends_on()

bool lxgui::gui::region::depends_on ( const region obj) const
inherited

Checks if this region depends on another.

Parameters
objThe region to test
Note
Useful to detect circular references.

Definition at line 503 of file gui_region.cpp.

◆ destroy()

void lxgui::gui::region::destroy ( )
inherited

Forcefully removes this region from the GUI.

Warning
After calling this function, any pointer to the object is invalidated! Only call this function if you need the object to be destroyed early, before its parent (if any) would itself be destroyed.

Definition at line 333 of file gui_region.cpp.

◆ disable_formatting()

void lxgui::gui::font_string::disable_formatting ( )
inline

Disables color formatting.

See also
set_formatting_enabled

Definition at line 365 of file gui_font_string.hpp.

◆ disable_non_space_wrap()

void lxgui::gui::font_string::disable_non_space_wrap ( )
inline

Does not allow large text without whitespace to wrap.

See also
set_non_space_wrap_enabled

Definition at line 260 of file gui_font_string.hpp.

◆ disable_shadow()

void lxgui::gui::font_string::disable_shadow ( )
inline

Makes this font_string draw a shadow under its text.

See also
set_shadow_enabled

Definition at line 288 of file gui_font_string.hpp.

◆ disable_word_ellipsis()

void lxgui::gui::font_string::disable_word_ellipsis ( )
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.

◆ disable_word_wrap()

void lxgui::gui::font_string::disable_word_wrap ( )
inline

Disables word wrap.

Definition at line 309 of file gui_font_string.hpp.

◆ enable_formatting()

void lxgui::gui::font_string::enable_formatting ( )
inline

Enables color formatting.

See also
set_formatting_enabled

Definition at line 357 of file gui_font_string.hpp.

◆ enable_non_space_wrap()

void lxgui::gui::font_string::enable_non_space_wrap ( )
inline

Allows large text without whitespace to wrap.

See also
set_non_space_wrap_enabled

Definition at line 252 of file gui_font_string.hpp.

◆ enable_shadow()

void lxgui::gui::font_string::enable_shadow ( )
inline

Makes this font_string draw a shadow under its text.

See also
set_shadow_enabled

Definition at line 280 of file gui_font_string.hpp.

◆ enable_word_ellipsis()

void lxgui::gui::font_string::enable_word_ellipsis ( )
inline

Show an ellipsis "..." if words don't fit in the text box.

Definition at line 329 of file gui_font_string.hpp.

◆ enable_word_wrap()

void lxgui::gui::font_string::enable_word_wrap ( )
inline

Enables word wrap.

Definition at line 302 of file gui_font_string.hpp.

◆ get_addon()

const addon * lxgui::gui::region::get_addon ( ) const
inherited

Returns this frame's addon.

Returns
This frame's addon
Note
Returns "nullptr" if the frame has been created by Lua code and wasn't assigned a parent.

Definition at line 843 of file gui_region.cpp.

◆ get_alignment_x()

alignment_x lxgui::gui::font_string::get_alignment_x ( ) const

Returns the horizontal alignment behavior.

Returns
The horizontal alignment behavior

Definition at line 145 of file gui_font_string.cpp.

◆ get_alignment_y()

alignment_y lxgui::gui::font_string::get_alignment_y ( ) const

Returns the vertical alignment behavior.

Returns
The vertical alignment behavior

Definition at line 149 of file gui_font_string.cpp.

◆ get_alpha()

float lxgui::gui::region::get_alpha ( ) const
inherited

Returns this region's alpha (opacity).

Returns
This region's alpha (opacity).

Definition at line 157 of file gui_region.cpp.

◆ get_anchor()

const anchor & lxgui::gui::region::get_anchor ( point  p) const
inherited

Returns one of this region's anchor.

Parameters
pThe anchor point
Returns
A pointer to the anchor, nullptr if none

Definition at line 539 of file gui_region.cpp.

◆ get_anchor_count()

std::size_t lxgui::gui::region::get_anchor_count ( ) const
inherited

Returns the number of defined anchors.

Returns
The number of defined anchors

Definition at line 519 of file gui_region.cpp.

◆ get_anchored_objects()

const std::vector< utils::observer_ptr< region > > & lxgui::gui::region::get_anchored_objects ( ) const
inherited

Returns the list of all objects that are anchored to this one.

Returns
The list of all objects that are anchored to this one

Definition at line 790 of file gui_region.cpp.

◆ get_anchors()

const std::array< std::optional< anchor >, 9 > & lxgui::gui::region::get_anchors ( ) const
inherited

Returns all of this region's anchors.

Returns
All of this region's anchors

Definition at line 549 of file gui_region.cpp.

◆ get_apparent_dimensions()

vector2f lxgui::gui::region::get_apparent_dimensions ( ) const
inherited

Returns this region's apparent width and height (in pixels).

Returns
This region's apparent width and height (in pixels)
Note
If you need to get the actual size of a region on the screen, use this function instead of get_dimensions(), as some regions may not have their dimensions explicitly defined, and instead get their extents from anchors.

Definition at line 276 of file gui_region.cpp.

◆ get_borders()

const bounds2f & lxgui::gui::region::get_borders ( ) const
inherited

Returns this region's borders.

Returns
This region's borders

Definition at line 361 of file gui_region.cpp.

◆ get_bottom()

float lxgui::gui::region::get_bottom ( ) const
inherited

Returns the vertical position of this region's bottom border.

Returns
The vertical position of this region's bottom border

Definition at line 357 of file gui_region.cpp.

◆ get_center()

vector2f lxgui::gui::region::get_center ( ) const
inherited

Returns the position of this region's center.

Returns
The position of this region's center

Definition at line 341 of file gui_region.cpp.

◆ get_dimensions()

const vector2f & lxgui::gui::region::get_dimensions ( ) const
inherited

Returns this region's explicitly-defined width and height (in pixels).

Returns
This region's explicitly-defined width and height (in pixels)
Note
If you need to get the actual size of a region on the screen, use get_apparent_dimensions(), as some regions may not have their dimensions explicitly defined, and instead get their extents from anchors. If a dimension is not explicitly defined, it will be returned as zero.

Definition at line 272 of file gui_region.cpp.

◆ get_draw_layer()

layer lxgui::gui::layered_region::get_draw_layer ( ) const
inherited

Returns this layered_region's draw layer.

Returns
this layered_region's draw layer

Definition at line 35 of file gui_layered_region.cpp.

◆ get_effective_alpha()

float lxgui::gui::region::get_effective_alpha ( ) const
inherited

Returns this region's effective alpha (opacity).

Returns
This region's effective alpha (opacity).
Note
This includes the region's parent alpha.

Definition at line 161 of file gui_region.cpp.

◆ get_effective_frame_renderer() [1/2]

utils::observer_ptr<frame_renderer> lxgui::gui::region::get_effective_frame_renderer ( )
inlineinherited

Returns the renderer of this object or its parents, nullptr if none.

Returns
The renderer of this object or its parents, nullptr if none
Note
For more information, see frame::set_frame_renderer().

Definition at line 615 of file gui_region.hpp.

◆ get_effective_frame_renderer() [2/2]

utils::observer_ptr< const frame_renderer > lxgui::gui::region::get_effective_frame_renderer ( ) const
virtualinherited

Returns the renderer of this object or its parents.

Returns
The renderer of this object or its parents
Note
For more information, see frame::set_frame_renderer().

Reimplemented in lxgui::gui::frame.

Definition at line 802 of file gui_region.cpp.

◆ get_font_height()

float lxgui::gui::font_string::get_font_height ( ) const

Returns the height of the font.

Returns
The height of the font

Definition at line 124 of file gui_font_string.cpp.

◆ get_font_name()

const std::string & lxgui::gui::font_string::get_font_name ( ) const

Returns the name of the font file.

Returns
The name of the font file

Definition at line 120 of file gui_font_string.cpp.

◆ get_left()

float lxgui::gui::region::get_left ( ) const
inherited

Returns the horizontal position of this region's left border.

Returns
The horizontal position of this region's left border

Definition at line 345 of file gui_region.cpp.

◆ get_line_spacing()

float lxgui::gui::font_string::get_line_spacing ( ) const

Returns the space between each line as a fraction of the font height.

Returns
The space between each line as a fraction of the font height (default is 1).

Definition at line 169 of file gui_font_string.cpp.

◆ get_lua_() [1/2]

sol::state & lxgui::gui::region::get_lua_ ( )
protectedinherited

Definition at line 767 of file gui_region.cpp.

◆ get_lua_() [2/2]

const sol::state & lxgui::gui::region::get_lua_ ( ) const
protectedinherited

Definition at line 771 of file gui_region.cpp.

◆ get_lua_member_()

sol::object lxgui::gui::region::get_lua_member_ ( const std::string &  key) const
protectedinherited

◆ get_manager() [1/2]

manager& lxgui::gui::region::get_manager ( )
inlineinherited

Returns this region's manager.

Returns
This region's manager

Definition at line 693 of file gui_region.hpp.

◆ get_manager() [2/2]

const manager& lxgui::gui::region::get_manager ( ) const
inlineinherited

Returns this region's manager.

Returns
This region's manager

Definition at line 701 of file gui_region.hpp.

◆ get_name()

const std::string & lxgui::gui::region::get_name ( ) const
inherited

Returns this region's name.

Returns
This region's name

Definition at line 140 of file gui_region.cpp.

◆ get_offset()

const vector2f & lxgui::gui::font_string::get_offset ( ) const

Returns this font_string's offset.

Returns
This font_string's offset
Note
Contains (X, Y) offset.

Definition at line 161 of file gui_font_string.cpp.

◆ get_parent() [1/2]

const utils::observer_ptr<frame>& lxgui::gui::region::get_parent ( )
inlineinherited

Returns this region's parent.

Returns
This region's parent

Definition at line 237 of file gui_region.hpp.

◆ get_parent() [2/2]

utils::observer_ptr<const frame> lxgui::gui::region::get_parent ( ) const
inlineinherited

Returns this region's parent.

Returns
This region's parent

Definition at line 229 of file gui_region.hpp.

◆ get_raw_name()

const std::string & lxgui::gui::region::get_raw_name ( ) const
inherited

Returns this region's raw name.

Returns
This region's raw name
Note
This is the name of the region before "$parent" has been replaced by its parent's name.

Definition at line 144 of file gui_region.cpp.

◆ get_region_level()

int lxgui::gui::layered_region::get_region_level ( ) const
inherited

Sets the region level.

Returns
The region level

Definition at line 48 of file gui_layered_region.cpp.

◆ get_region_type()

const std::string & lxgui::gui::region::get_region_type ( ) const
inherited

Returns the type of this region.

Returns
The type of this region

Definition at line 148 of file gui_region.cpp.

◆ get_registry() [1/2]

registry & lxgui::gui::region::get_registry ( )
inherited

Returns the UI object registry, which keeps track of all objects in the UI.

Returns
The registry object

Definition at line 850 of file gui_region.cpp.

◆ get_registry() [2/2]

const registry & lxgui::gui::region::get_registry ( ) const
inherited

Returns the UI object registry, which keeps track of all objects in the UI.

Returns
The registry object

Definition at line 855 of file gui_region.cpp.

◆ get_right()

float lxgui::gui::region::get_right ( ) const
inherited

Returns the horizontal position of this region's right border.

Returns
The horizontal position of this region's right border

Definition at line 349 of file gui_region.cpp.

◆ get_shadow_color()

const color & lxgui::gui::font_string::get_shadow_color ( ) const

Returns this font_string's shadow color.

Returns
This font_string's shadow color

Definition at line 153 of file gui_font_string.cpp.

◆ get_shadow_offset()

const vector2f & lxgui::gui::font_string::get_shadow_offset ( ) const

Returns this font_string's shadow offset.

Returns
This font_string's shadow offset
Note
Contains (X, Y) offset.

Definition at line 157 of file gui_font_string.cpp.

◆ get_spacing()

float lxgui::gui::font_string::get_spacing ( ) const

Returns the space between each letter.

Returns
The space between each letter

Definition at line 165 of file gui_font_string.cpp.

◆ get_string_height()

float lxgui::gui::font_string::get_string_height ( ) const

Returns the height of the string if no format or wrapping is applied.

Returns
The height of the string if no format or wrapping is applied

Definition at line 323 of file gui_font_string.cpp.

◆ get_string_width() [1/2]

float lxgui::gui::font_string::get_string_width ( ) const

Returns the width of the string if no format or wrapping is applied.

Returns
The width of the string if no format or wrapping is applied

Definition at line 330 of file gui_font_string.cpp.

◆ get_string_width() [2/2]

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.

Parameters
contentThe string for which to calculate the width
Returns
The width of a string if no format or wrapping is applied

Definition at line 337 of file gui_font_string.cpp.

◆ get_text()

const utils::ustring & lxgui::gui::font_string::get_text ( ) const

Returns the rendered text (with format tags).

Returns
The rendered text (with format tags)

Definition at line 344 of file gui_font_string.cpp.

◆ get_text_color()

const color & lxgui::gui::font_string::get_text_color ( ) const

Returns the text color.

Returns
The text color

Definition at line 173 of file gui_font_string.cpp.

◆ get_text_object() [1/2]

text * lxgui::gui::font_string::get_text_object ( )

Returns the text used to render this font_string.

Returns
The text used to render this font_string

Definition at line 458 of file gui_font_string.cpp.

◆ get_text_object() [2/2]

const text * lxgui::gui::font_string::get_text_object ( ) const

Returns the text used to render this font_string.

Returns
The text used to render this font_string

Definition at line 462 of file gui_font_string.cpp.

◆ get_top()

float lxgui::gui::region::get_top ( ) const
inherited

Returns the vertical position of this region's top border.

Returns
The vertical position of this region's top border

Definition at line 353 of file gui_region.cpp.

◆ get_type_list_impl_()

template<typename T >
const std::vector< std::string > & lxgui::gui::region::get_type_list_impl_
staticprotectedinherited

Definition at line 147 of file gui_region_tpl.hpp.

◆ get_vertex_cache_strategy()

vertex_cache_strategy lxgui::gui::font_string::get_vertex_cache_strategy ( ) const

Gets the strategy for using vertex caches.

Returns
The strategy for using vertex caches

Definition at line 454 of file gui_font_string.cpp.

◆ hide()

void lxgui::gui::region::hide ( )
inherited

hides this region.

Note
All its children won't be visible on the screen anymore, even if they are still marked as shown.

Definition at line 186 of file gui_region.cpp.

◆ initialize_()

template<typename T >
void lxgui::gui::region::initialize_ ( T &  self,
const region_core_attributes attr 
)
protectedinherited

Set up function to call in all derived class constructors.

Parameters
selfA pointer to the derived this
attrThe region attributes provided to the constructor

Definition at line 141 of file gui_region_tpl.hpp.

◆ is_apparent_height_defined()

bool lxgui::gui::region::is_apparent_height_defined ( ) const
inherited

Checks if this region's apparent height is defined.

Returns
'true' if defined, 'false' otherwise
Note
The apparent height is defined if either the region's absolute or relative height is explicitly specified (from set_height(), set_relative_height(), set_dimensions(), or set_relative_dimensions()), or if its left and right borders are anchored. A region with an undefined apparent height will not be rendered on the screen until its height is defined.

Definition at line 284 of file gui_region.cpp.

◆ is_apparent_width_defined()

bool lxgui::gui::region::is_apparent_width_defined ( ) const
inherited

Checks if this region's apparent width is defined.

Returns
'true' if defined, 'false' otherwise
Note
The apparent width is defined if either the region's absolute or relative width is explicitly specified (from set_width(), set_relative_width(), set_dimensions(), or set_relative_dimensions()), or if its left and right borders are anchored. A region with an undefined apparent width will not be rendered on the screen until its width is defined.

Definition at line 280 of file gui_region.cpp.

◆ is_formatting_enabled()

bool lxgui::gui::font_string::is_formatting_enabled ( ) const

Checks if color formatting is enabled.

Returns
'true' if color formatting is enabled

Definition at line 419 of file gui_font_string.cpp.

◆ is_in_region()

bool lxgui::gui::region::is_in_region ( const vector2f position) const
virtualinherited

Checks if the provided coordinates are inside this region.

Parameters
positionThe coordinates to test
Returns
'true' if the provided coordinates are inside this region

Reimplemented in lxgui::gui::slider, and lxgui::gui::frame.

Definition at line 288 of file gui_region.cpp.

◆ is_loaded()

bool lxgui::gui::region::is_loaded ( ) const
inherited

Checks if this region has been fully loaded.

Note
A region that is not fully loaded still has all its core attributes set, hence can be considered as "fully constructed" from a C++ point of view. However, semantically, the object may need further steps to be complete, as designed by the UI designer. Therefore, form the UI's point of view, a region is considered "complete" only if is_loaded() returns 'true' (see notifu_loaded()). Only then can the region, e.g., react to or generate events.

Definition at line 798 of file gui_region.cpp.

◆ is_manually_inherited()

bool lxgui::gui::region::is_manually_inherited ( ) const
inherited

Checks if this object is manually inherited.

Returns
'true' if this object is manually inherited
Note
For more information, see set_manually_inherited().

Definition at line 784 of file gui_region.cpp.

◆ is_non_space_wrap_enabled()

bool lxgui::gui::font_string::is_non_space_wrap_enabled ( ) const

Checks if large text is truncated or wrapped.

Returns
'true' if large text is truncated
Note
See set_non_space_wrap_enabled for more information.

Definition at line 319 of file gui_font_string.cpp.

◆ is_outlined()

bool lxgui::gui::font_string::is_outlined ( ) const

Check if this font_string is outlined.

Returns
'true' if this font_string is outlined

Definition at line 141 of file gui_font_string.cpp.

◆ is_region_type() [1/3]

template<typename ObjectType >
bool lxgui::gui::region::is_region_type ( ) const
inlineinherited

Checks if this region is of the provided type.

Returns
'true' if this region is of the provided type

Definition at line 423 of file gui_region.hpp.

◆ is_region_type() [2/3]

bool lxgui::gui::region::is_region_type ( const region obj) const
inlineinherited

Checks if this region is of a type equal or derived from the supplied region.

Returns
'true' if this region is of a type equal or derived from the supplied region

Definition at line 431 of file gui_region.hpp.

◆ is_region_type() [3/3]

bool lxgui::gui::region::is_region_type ( const std::string &  type_name) const
inherited

Checks if this region is of the provided type.

Parameters
type_nameThe type to test
Returns
'true' if this region is of the provided type

Definition at line 152 of file gui_region.cpp.

◆ is_shadow_enabled()

bool lxgui::gui::font_string::is_shadow_enabled ( ) const

Checks if this font_string draws a shadow under its text.

Returns
'true' if this font_string draws a shadow under its text

Definition at line 358 of file gui_font_string.cpp.

◆ is_shown()

bool lxgui::gui::region::is_shown ( ) const
inherited

Checks if this region is shown.

Returns
'true' if this region is shown

Definition at line 203 of file gui_region.cpp.

◆ is_valid()

bool lxgui::gui::region::is_valid ( ) const
inherited

Checks if this region has all its borders correctly defined.

Returns
'true' if this region has all its borders correctly defined
Note
To be valid, a region needs to have a defined position and size along both the X and Y dimensions. This means either one anchor and a set size, or two opposite anchors. For example, any anchor plus a call to set_dimensions(). Or a top_left plus a bottom_right anchors. Or a left plus a right anchors plus a call to set_height().

Definition at line 211 of file gui_region.cpp.

◆ is_virtual()

bool lxgui::gui::region::is_virtual ( ) const
inherited

Checks if this region is virtual.

Returns
'true' if this region is virtual
Note
A virtual region will not be displayed on the screen, but can serve as a template to create new GUI elements (it is then "inherited", although note that this has no connection to C++ inheritance).

Definition at line 553 of file gui_region.cpp.

◆ is_visible()

bool lxgui::gui::region::is_visible ( ) const
inherited

Checks if this region can be seen on the screen.

Returns
'true' if this region can be seen on the screen

Definition at line 207 of file gui_region.cpp.

◆ is_word_ellipsis_enabled()

bool lxgui::gui::font_string::is_word_ellipsis_enabled ( ) const

Checks if word ellipsis is enabled.

Returns
'true' if word ellipsis is enabled

Definition at line 402 of file gui_font_string.cpp.

◆ is_word_wrap_enabled()

bool lxgui::gui::font_string::is_word_wrap_enabled ( ) const

Checks if word wrap is enabled.

Returns
'true' if word wrap is enabled

Definition at line 385 of file gui_font_string.cpp.

◆ make_borders_()

bool lxgui::gui::region::make_borders_ ( float &  min,
float &  max,
float  center,
float  size 
) const
protectedinherited

Definition at line 585 of file gui_region.cpp.

◆ modify_anchor()

anchor & lxgui::gui::region::modify_anchor ( point  p)
inherited

Returns one of this region's anchor to modify it.

Parameters
pThe anchor point
Returns
A reference to the anchor, will throw if this point has no anchor.
Note
After you have modified the anchor, you must call notify_borders_need_update() to ensure that the object's borders are properly updated.

Definition at line 529 of file gui_region.cpp.

◆ notify_borders_need_update()

void lxgui::gui::region::notify_borders_need_update ( )
virtualinherited

Tells this region that its borders need updating.

Reimplemented in lxgui::gui::slider.

Definition at line 744 of file gui_region.cpp.

◆ notify_invisible()

void lxgui::gui::region::notify_invisible ( )
virtualinherited

Notifies this region that it is no longer visible on screen.

Note
Automatically called by show()/hide().

Reimplemented in lxgui::gui::frame.

Definition at line 813 of file gui_region.cpp.

◆ notify_loaded()

void lxgui::gui::region::notify_loaded ( )
virtualinherited

Notifies this region that it has been fully loaded.

See also
is_loaded()

Reimplemented in lxgui::gui::frame.

Definition at line 794 of file gui_region.cpp.

◆ notify_renderer_need_redraw()

void lxgui::gui::layered_region::notify_renderer_need_redraw ( )
overridevirtualinherited

Notifies the renderer of this region that it needs to be redrawn.

Note
Automatically called by any shape changing function.

Reimplemented from lxgui::gui::region.

Definition at line 61 of file gui_layered_region.cpp.

◆ notify_scaling_factor_updated()

void lxgui::gui::font_string::notify_scaling_factor_updated ( )
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.

◆ notify_visible()

void lxgui::gui::region::notify_visible ( )
virtualinherited

Notifies this region that it is now visible on screen.

Note
Automatically called by show()/hide().

Reimplemented in lxgui::gui::frame.

Definition at line 808 of file gui_region.cpp.

◆ parse_anchor_node_()

void lxgui::gui::region::parse_anchor_node_ ( const layout_node node)
protectedvirtualinherited

Definition at line 89 of file gui_region_parser.cpp.

◆ parse_color_node_()

color lxgui::gui::region::parse_color_node_ ( const layout_node node)
protectedinherited

Definition at line 10 of file gui_region_parser.cpp.

◆ parse_dimension_node_()

std::pair< anchor_type, vector2< std::optional< float > > > lxgui::gui::region::parse_dimension_node_ ( const layout_node node)
protectedinherited

Definition at line 35 of file gui_region_parser.cpp.

◆ parse_file_name()

std::string lxgui::gui::region::parse_file_name ( const std::string &  file_name) const
inherited

Convert an addon-relative file path to a application-relative path.

Parameters
file_nameThe raw file name
Returns
The modified file name
Note
All file names must be relative to the current working directory (typically, the application's executable path), but sometimes it is more convenient and maintainable to specify a path that is relative to the addon directory. This can be achieved by simply putting "|" in front of a file name, which will then be interpreted as relative to the addon directory. This function takes care of this transformation.

Definition at line 818 of file gui_region.cpp.

◆ parse_layout()

void lxgui::gui::font_string::parse_layout ( const layout_node node)
overridevirtual

Parses data from a layout_node.

Parameters
nodeThe layout node

Reimplemented from lxgui::gui::region.

Definition at line 9 of file gui_font_string_parser.cpp.

◆ parse_offset_node_()

vector2< std::optional< float > > lxgui::gui::region::parse_offset_node_ ( const layout_node node)
protectedinherited

Definition at line 24 of file gui_region_parser.cpp.

◆ parse_offset_node_or_()

vector2< float > lxgui::gui::region::parse_offset_node_or_ ( const layout_node node,
float  fallback 
)
protectedinherited

Definition at line 28 of file gui_region_parser.cpp.

◆ parse_size_node_()

void lxgui::gui::region::parse_size_node_ ( const layout_node node)
protectedvirtualinherited

Definition at line 65 of file gui_region_parser.cpp.

◆ read_anchors_()

void lxgui::gui::region::read_anchors_ ( float &  left,
float &  right,
float &  top,
float &  bottom,
float &  x_center,
float &  y_center 
) const
protectedinherited

Definition at line 614 of file gui_region.cpp.

◆ register_on_lua()

static void lxgui::gui::font_string::register_on_lua ( sol::state &  lua)
static

Registers this region class to the provided Lua state.

◆ release_from_parent()

utils::owner_ptr< region > lxgui::gui::layered_region::release_from_parent ( )
overridevirtualinherited

Removes this region from its parent and return an owning pointer.

Returns
An owning pointer to this region

Reimplemented from lxgui::gui::region.

Definition at line 28 of file gui_layered_region.cpp.

◆ remove_anchored_object()

void lxgui::gui::region::remove_anchored_object ( region obj)
inherited

Notifies this region that another one is no longer anchored to it.

Parameters
objThe region no longer anchored
See also
add_anchored_object()

Definition at line 565 of file gui_region.cpp.

◆ remove_glue()

void lxgui::gui::region::remove_glue ( )
inherited

Removes the Lua glue.

Definition at line 775 of file gui_region.cpp.

◆ render()

void lxgui::gui::font_string::render ( ) const
overridevirtual

Renders this region on the current render target.

Reimplemented from lxgui::gui::region.

Definition at line 24 of file gui_font_string.cpp.

◆ round_to_pixel() [1/2]

vector2f lxgui::gui::region::round_to_pixel ( const vector2f position,
utils::rounding_method  method = utils::rounding_method::nearest 
) const
inherited

Round an absolute position on screen to the nearest physical pixel.

Parameters
positionThe input absolute position (can be fractional)
methodThe rounding method
Returns
The position of the nearest physical pixel

Definition at line 578 of file gui_region.cpp.

◆ round_to_pixel() [2/2]

float lxgui::gui::region::round_to_pixel ( float  value,
utils::rounding_method  method = utils::rounding_method::nearest 
) const
inherited

Round an absolute position on screen to the nearest physical pixel.

Parameters
valueThe input absolute position (can be fractional)
methodThe rounding method
Returns
The position of the nearest physical pixel

Definition at line 573 of file gui_region.cpp.

◆ serialize()

std::string lxgui::gui::font_string::serialize ( const std::string &  tab) const
overridevirtual

Prints all relevant information about this region in a string.

Parameters
tabThe offset to give to all lines
Returns
All relevant information about this region

Reimplemented from lxgui::gui::region.

Definition at line 67 of file gui_font_string.cpp.

◆ set_addon()

void lxgui::gui::region::set_addon ( const addon a)
inherited

Sets the addon this frame belongs to.

Parameters
aThe addon this frame belongs to

Definition at line 833 of file gui_region.cpp.

◆ set_alignment_x()

void lxgui::gui::font_string::set_alignment_x ( alignment_x  align_x)

Sets this font_string's horizontal alignment behavior.

Parameters
align_xThe horizontal alignment behavior

Definition at line 233 of file gui_font_string.cpp.

◆ set_alignment_y()

void lxgui::gui::font_string::set_alignment_y ( alignment_y  align_y)

Sets this font_string's vertical alignment behavior.

Parameters
align_yThe vertical alignment behavior

Definition at line 246 of file gui_font_string.cpp.

◆ set_all_anchors() [1/2]

void lxgui::gui::region::set_all_anchors ( const std::string &  obj_name)
inherited

Adjusts this regions anchors to fit the provided region.

Parameters
obj_nameThe name of the object to fit to
Note
Removes all anchors and defines two new ones.

Definition at line 404 of file gui_region.cpp.

◆ set_all_anchors() [2/2]

void lxgui::gui::region::set_all_anchors ( const utils::observer_ptr< region > &  obj)
inherited

Adjusts this regions anchors to fit the provided region.

Parameters
objA pointer to the object you want to wrap
Note
Removes all anchors and defines two new ones.

Definition at line 437 of file gui_region.cpp.

◆ set_alpha()

void lxgui::gui::region::set_alpha ( float  alpha)
inherited

Changes this region's alpha (opacity).

Parameters
alphaThe new alpha value
Note
Default is 1.0f.

Definition at line 169 of file gui_region.cpp.

◆ set_anchor() [1/2]

template<typename... Args>
void lxgui::gui::region::set_anchor ( Args &&...  args)
inlineinherited

Adds/replaces an anchor.

Parameters
argsArgument to construct a new anchor_data

Definition at line 503 of file gui_region.hpp.

◆ set_anchor() [2/2]

void lxgui::gui::region::set_anchor ( const anchor_data a)
inherited

Adds/replaces an anchor.

Parameters
aThe anchor to add

Definition at line 473 of file gui_region.cpp.

◆ set_dimensions()

void lxgui::gui::region::set_dimensions ( const vector2f dimensions)
virtualinherited

Changes this region's absolute dimensions (in pixels).

Parameters
dimensionsThe new dimensions

Reimplemented in lxgui::gui::frame.

Definition at line 215 of file gui_region.cpp.

◆ set_draw_layer()

void lxgui::gui::layered_region::set_draw_layer ( layer  layer_id)
inherited

Sets this layered_region's draw layer.

Parameters
layer_idThe new layer

Definition at line 39 of file gui_layered_region.cpp.

◆ set_font()

void lxgui::gui::font_string::set_font ( const std::string &  font_name,
float  height 
)

Sets this font_string's font (file and size).

Parameters
font_nameThe file path to the .ttf file
heightThe font height

Definition at line 221 of file gui_font_string.cpp.

◆ set_formatting_enabled()

void lxgui::gui::font_string::set_formatting_enabled ( bool  enabled)

Enables color formatting.

Parameters
enabled'true' to enable color formatting
Note
Enabled by default. See text::set_formatting_enabled().

Definition at line 406 of file gui_font_string.cpp.

◆ set_height()

void lxgui::gui::region::set_height ( float  abs_height)
virtualinherited

Changes this region's absolute height (in pixels).

Parameters
abs_heightThe new height

Reimplemented in lxgui::gui::frame.

Definition at line 239 of file gui_region.cpp.

◆ set_line_spacing()

void lxgui::gui::font_string::set_line_spacing ( float  line_spacing)

Sets the space between each line as a fraction of the font height.

Parameters
line_spacingThe space between each line, as a relative factor of the font height
Note
A line spacing of 1 is the default and results in fairly dense text. To increase the space between lines, set the line spacing to a larger value, for example 1.5 results in 50% more space.

Definition at line 298 of file gui_font_string.cpp.

◆ set_lua_member_()

void lxgui::gui::region::set_lua_member_ ( std::string  key,
sol::stack_object  value 
)
protectedinherited

◆ set_manually_inherited()

void lxgui::gui::region::set_manually_inherited ( bool  manually_inherited)
inherited

Flags this region as manually inherited or not.

Note
By default, all regions are automatically inherited. This is generally the desired behavior for regions defined by the user, but it is less desirable for "special" or "internal" regions necessary for the proper operation of some region types (e.g., the texture used by a button), which need special treatment or registration.

Definition at line 780 of file gui_region.cpp.

◆ set_name_()

void lxgui::gui::region::set_name_ ( const std::string &  name)
protectedinherited

Sets this region's name.

Parameters
nameThis region's name
Note
Can only be called once. If you need to set both the name and the parent at the same time (typically, at creation), use set_name_and_parent_().

Definition at line 294 of file gui_region.cpp.

◆ set_non_space_wrap_enabled()

void lxgui::gui::font_string::set_non_space_wrap_enabled ( bool  enabled)

Sets whether large text without whitespace is truncated or wrapped.

Parameters
enabled'true' to wrap, 'false' to truncate
Note
This applies to large chunks of text with no spaces. When truncated, "..." is appended at the line's end. Else, the word is cut and continues on the next line.

Definition at line 348 of file gui_font_string.cpp.

◆ set_offset()

void lxgui::gui::font_string::set_offset ( const vector2f offset)

Sets this font_string's offset.

Parameters
offsetOffset
Note
Contains (X, Y) offset.

Definition at line 277 of file gui_font_string.cpp.

◆ set_outlined()

void lxgui::gui::font_string::set_outlined ( bool  outlined)

Adds or remove the outline around the text.

Parameters
outlined'true' to enable the outline
Note
The thickness of this outline is constant and does not depend on the font's size.

Definition at line 128 of file gui_font_string.cpp.

◆ set_parent_()

void lxgui::gui::region::set_parent_ ( utils::observer_ptr< frame parent)
protectedvirtualinherited

Changes this region's parent.

Parameters
parentThe new parent
Note
Default is nullptr.

Reimplemented in lxgui::gui::frame.

Definition at line 312 of file gui_region.cpp.

◆ set_region_level()

void lxgui::gui::layered_region::set_region_level ( int  region_level)
inherited

Sets this layered_region's region level.

Parameters
region_levelThe new level

Definition at line 52 of file gui_layered_region.cpp.

◆ set_relative_dimensions()

void lxgui::gui::region::set_relative_dimensions ( const vector2f dimensions)
inherited

Changes this region's dimensions (relative to its parent).

Parameters
dimensionsThe new dimensions (relative)

Definition at line 251 of file gui_region.cpp.

◆ set_relative_height()

void lxgui::gui::region::set_relative_height ( float  rel_height)
inherited

Changes this region's height (relative to its parent).

Parameters
rel_heightThe new height

Definition at line 265 of file gui_region.cpp.

◆ set_relative_width()

void lxgui::gui::region::set_relative_width ( float  rel_width)
inherited

Changes this region's width (relative to its parent).

Parameters
rel_widthThe new width

Definition at line 258 of file gui_region.cpp.

◆ set_shadow_color()

void lxgui::gui::font_string::set_shadow_color ( const color shadow_color)

Sets this font_string's shadow color.

Parameters
shadow_colorThe shadow color

Definition at line 259 of file gui_font_string.cpp.

◆ set_shadow_enabled()

void lxgui::gui::font_string::set_shadow_enabled ( bool  enabled)

Sets whether this font_string should draw a shadow under its text.

Parameters
enabled'true' to enable shadow

Definition at line 362 of file gui_font_string.cpp.

◆ set_shadow_offset()

void lxgui::gui::font_string::set_shadow_offset ( const vector2f shadow_offset)

Sets this font_string's shadow offset.

Parameters
shadow_offsetOffset
Note
Contains (X, Y) offset.

Definition at line 268 of file gui_font_string.cpp.

◆ set_shown()

void lxgui::gui::region::set_shown ( bool  is_shown)
inherited

shows/hides this region.

Parameters
is_shown'true' if you want to show this region
Note
See show() and hide() for more information.

Definition at line 196 of file gui_region.cpp.

◆ set_spacing()

void lxgui::gui::font_string::set_spacing ( float  spacing)

Sets the space between each letter.

Parameters
spacingThe space between each letter

Definition at line 286 of file gui_font_string.cpp.

◆ set_text()

void lxgui::gui::font_string::set_text ( const utils::ustring &  content)

Sets the rendered text.

Parameters
contentThe rendered text
Note
See text::set_text for more information about formatting.

Definition at line 423 of file gui_font_string.cpp.

◆ set_text_color()

void lxgui::gui::font_string::set_text_color ( const color text_color)

Sets the text color.

Parameters
text_colorThe text color

Definition at line 310 of file gui_font_string.cpp.

◆ set_vertex_cache_strategy()

void lxgui::gui::font_string::set_vertex_cache_strategy ( vertex_cache_strategy  strategy)

Selects the strategy for using vertex caches.

Parameters
strategyThe new strategy
Note
The recommended value is the default, vertex_cache_strategy::automatic. This will automatically decide whether vertex caches should be used or not, based on what is expected to give the best performance for the common use case of mostly static text. If the displayed text changes very frequently, it is best to use the strategy vertex_cache_strategy::always_disabled. If the displayed text changes rarely and contains a large number of characters, it is best to use the strategy vertex_cache_strategy::prefer_enabled, or vertex_cache_strategy::always_enabled if you want to completely bypass the preferences set in the renderer configuration.

Definition at line 450 of file gui_font_string.cpp.

◆ set_virtual_()

void lxgui::gui::region::set_virtual_ ( )
protectedinherited

Makes this region virtual.

Note
See is_virtual().

Definition at line 557 of file gui_region.cpp.

◆ set_width()

void lxgui::gui::region::set_width ( float  abs_width)
virtualinherited

Changes this region's absolute width (in pixels).

Parameters
abs_widthThe new width

Reimplemented in lxgui::gui::frame.

Definition at line 227 of file gui_region.cpp.

◆ set_word_ellipsis_enabled()

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.

Parameters
enabled'true' to put "..." at the end of a truncated line
Note
Disabled by default.

Definition at line 389 of file gui_font_string.cpp.

◆ set_word_wrap_enabled()

void lxgui::gui::font_string::set_word_wrap_enabled ( bool  enabled)

Enables/disables word wrap.

Parameters
enabled'true' to enable word wrap
Note
Enabled by default.

Definition at line 372 of file gui_font_string.cpp.

◆ show()

void lxgui::gui::region::show ( )
inherited

shows this region.

Note
Its parent must be shown for it to appear on the screen.

Definition at line 176 of file gui_region.cpp.

◆ update()

void lxgui::gui::region::update ( float  delta)
virtualinherited

Updates this region's logic.

Parameters
deltaTime spent since last update

Reimplemented in lxgui::gui::animated_texture, and lxgui::gui::frame.

Definition at line 763 of file gui_region.cpp.

Member Data Documentation

◆ addon_

const addon* lxgui::gui::region::addon_ = nullptr
protectedinherited

Definition at line 802 of file gui_region.hpp.

◆ alpha_

float lxgui::gui::region::alpha_ = 1.0f
protectedinherited

Definition at line 818 of file gui_region.hpp.

◆ anchor_list_

std::array<std::optional<anchor>, 9> lxgui::gui::region::anchor_list_
protectedinherited

Definition at line 814 of file gui_region.hpp.

◆ anchored_object_list_

std::vector<utils::observer_ptr<region> > lxgui::gui::region::anchored_object_list_
protectedinherited

Definition at line 824 of file gui_region.hpp.

◆ borders_

bounds2f lxgui::gui::region::borders_
protectedinherited

Definition at line 816 of file gui_region.hpp.

◆ class_name

constexpr const char* lxgui::gui::font_string::class_name = "FontString"
staticconstexpr

Definition at line 426 of file gui_font_string.hpp.

◆ defined_borders_

bounds2<bool> lxgui::gui::region::defined_borders_
protectedinherited

Definition at line 815 of file gui_region.hpp.

◆ dimensions_

vector2f lxgui::gui::region::dimensions_
protectedinherited

Definition at line 822 of file gui_region.hpp.

◆ is_loaded_

bool lxgui::gui::region::is_loaded_ = false
protectedinherited

Definition at line 811 of file gui_region.hpp.

◆ is_manually_inherited_

bool lxgui::gui::region::is_manually_inherited_ = false
protectedinherited

Definition at line 809 of file gui_region.hpp.

◆ is_shown_

bool lxgui::gui::region::is_shown_ = true
protectedinherited

Definition at line 819 of file gui_region.hpp.

◆ is_valid_

bool lxgui::gui::region::is_valid_ = true
protectedinherited

Definition at line 812 of file gui_region.hpp.

◆ is_virtual_

bool lxgui::gui::region::is_virtual_ = false
protectedinherited

Definition at line 810 of file gui_region.hpp.

◆ is_visible_

bool lxgui::gui::region::is_visible_ = true
protectedinherited

Definition at line 820 of file gui_region.hpp.

◆ layer_

layer lxgui::gui::layered_region::layer_ = layer::artwork
protectedinherited

Definition at line 92 of file gui_layered_region.hpp.

◆ manager_

manager& lxgui::gui::region::manager_
protectedinherited

Definition at line 800 of file gui_region.hpp.

◆ name_

std::string lxgui::gui::region::name_
protectedinherited

Definition at line 804 of file gui_region.hpp.

◆ parent_

utils::observer_ptr<frame> lxgui::gui::region::parent_ = nullptr
protectedinherited

Definition at line 807 of file gui_region.hpp.

◆ raw_name_

std::string lxgui::gui::region::raw_name_
protectedinherited

Definition at line 805 of file gui_region.hpp.

◆ region_level_

int lxgui::gui::layered_region::region_level_ = 0
protectedinherited

Definition at line 93 of file gui_layered_region.hpp.


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