1 #ifndef LXGUI_GUI_STATUS_BAR_HPP
2 #define LXGUI_GUI_STATUS_BAR_HPP
4 #include "lxgui/gui_color.hpp"
5 #include "lxgui/gui_frame.hpp"
6 #include "lxgui/gui_orientation.hpp"
7 #include "lxgui/lxgui.hpp"
8 #include "lxgui/utils.hpp"
45 std::string
serialize(
const std::string& tab)
const override;
52 bool can_use_script(
const std::string& script_name)
const override;
Holds a single color (float RGBA, 128 bits)
A region that can contain other regions and react to events.
An node in a layout file.
Manages the user interface.
The base class of all elements in the GUI.
A frame representing a variable-length bar.
void set_value(float value)
Sets this status_bar's value.
void set_orientation(orientation orient)
Sets this status_bar's orientation.
std::array< float, 4 > initial_text_coords_
float get_max_value() const
Returns this status_bar's maximum value.
utils::observer_ptr< texture > bar_texture_
float get_min_value() const
Returns this status_bar's minimum value.
void create_bar_texture_()
float get_value() const
Returns this status_bar's value.
bool is_reversed() const
Checks if this status_bar is reversed.
static constexpr const char * class_name
const std::vector< std::string > & get_type_list_() const override
orientation get_orientation() const
Returns this status_bar's orientation.
void set_min_value(float min_value)
Sets this status_bar's minimum value.
const color & get_bar_color() const
Returns this status_bar's bar color.
void copy_from(const region &obj) override
Copies a region's parameters into this status_bar (inheritance).
status_bar(utils::control_block &block, manager &mgr, const frame_core_attributes &attr)
Constructor.
void set_min_max_values(float min_value, float max_value)
Sets this status_bar's value range.
void parse_all_nodes_before_children_(const layout_node &node) override
void notify_bar_texture_needs_update_()
void set_bar_draw_layer(layer bar_layer)
Sets the draw layer of this status_bar's bar texture.
void set_reversed(bool reversed)
Reverses this status_bar.
layer get_bar_draw_layer() const
Returns the draw layer of status_bar's bar texture.
void parse_attributes_(const layout_node &node) override
bool can_use_script(const std::string &script_name) const override
Returns 'true' if this status_bar can use a script.
static void register_on_lua(sol::state &lua)
Registers this region class to the provided Lua state.
void set_max_value(float max_value)
Sets this status_bar's maximum value.
void set_bar_texture(utils::observer_ptr< texture > bar_texture)
Sets this status_bar's bar texture.
const utils::observer_ptr< texture > & get_bar_texture()
Returns this status_bar's bar texture.
std::string serialize(const std::string &tab) const override
Prints all relevant information about this region in a string.
utils::observer_ptr< const texture > get_bar_texture() const
Returns this status_bar's bar texture.
void set_bar_color(const color &bar_color)
Sets this status_bar's bar color.
layer
ID of a layer for rendering inside a frame.
Struct holding all the core information about a frame necessary for its creation.