1 #ifndef LXGUI_GUI_ANIMATED_TEXTURE_HPP
2 #define LXGUI_GUI_ANIMATED_TEXTURE_HPP
4 #include "lxgui/gui_layered_region.hpp"
5 #include "lxgui/gui_quad.hpp"
6 #include "lxgui/lxgui.hpp"
7 #include "lxgui/utils.hpp"
30 std::string
serialize(
const std::string& tab)
const override;
33 void render()
const override;
39 void update(
float delta)
override;
154 void parse_attributes_(
const layout_node& node)
override;
155 void parse_tex_coords_node_(
const layout_node& node);
156 void parse_gradient_node_(
const layout_node& node);
158 void update_tex_coords_();
159 void update_borders_()
override;
161 const std::vector<std::string>& get_type_list_()
const override;
167 bool is_paused_ =
false;
A layered_region that can draw animated sequences.
void parse_layout(const layout_node &node) override
Parses data from a layout_node.
const std::string & get_texture_file() const
Returns this texture's texture file.
float get_state() const
Returns this animated_texture's state (0: begin, 1: end).
animated_texture(utils::control_block &block, manager &mgr, const region_core_attributes &attr)
Constructor.
static void register_on_lua(sol::state &lua)
Registers this region class to the provided Lua state.
void play()
Play this animated_texture.
std::string serialize(const std::string &tab) const override
Prints all relevant information about this region in a string.
void set_vertex_color(const color &c, std::size_t index=std::numeric_limits< std::size_t >::max())
Sets this texture's vertex color.
void stop()
Stop this animated_texture (stop playing and reset to start).
void update(float delta) override
Updates this region's logic.
color get_vertex_color(std::size_t index) const
Returns this texture's vertex color.
void set_state(float state)
Returns this animated_texture's state (0: begin, 1: end).
void pause()
Pause this animated_texture.
void set_texture(const std::string &file_name)
Sets this texture's texture file.
static constexpr const char * class_name
float get_speed() const
Returns this animated_texture's animation speed (frame per second).
void set_speed(float speed)
Set this animated_texture's animation speed (frame per second).
void set_paused(bool is_paused)
Play or pause this animated_texture.
void copy_from(const region &obj) override
Copies a region's parameters into this texture (inheritance).
float is_paused() const
Check if this animated_texture is paused.
void render() const override
Renders this region on the current render target.
Holds a single color (float RGBA, 128 bits)
A region that can be rendered in a layer.
layered_region(utils::control_block &block, manager &mgr, const region_core_attributes &attr)
Constructor.
An node in a layout file.
Manages the user interface.
The base class of all elements in the GUI.
Abstract type for implementation specific management.
Simple structure holding four vertices and a material.
Struct holding all the core information about a region necessary for its creation.