14#include <egt/detail/meta.h>
15#include <egt/window.h>
82 int frame_count,
const Point& frame_point = {},
118 int frame_count, const
Point& frame_point = {});
167 void allocate_screen()
override
169 Window::allocate_screen();
174 int frame_count,
const Point& frame_point);
177 std::unique_ptr<detail::SpriteImpl> m_simpl;
179 friend class detail::SoftwareSprite;
180 friend class detail::HardwareSprite;
Raster image resource used for drawing or displaying.
Definition image.h:39
Drawing interface for 2D graphics.
Definition painter.h:45
std::list< std::tuple< std::string, std::string, Serializer::Attributes > > Properties
Definition serialize.h:47
Widget that shows or animates sprite, or frame, strips from a single sprite sheet.
Definition sprite.h:61
uint32_t add_strip(int frame_count, const Point &frame_point={})
Add a new strip.
~Sprite() noexcept override
Sprite(const Sprite &)=delete
Sprite(const Image &image, const Size &frame_size, int frame_count, const Point &frame_point={}, WindowHint hint=WindowHint::automatic)
void show_frame(int index)
Show the frame specified by the index.
void change_strip(uint32_t id)
Change the strip to the specified id.
void advance()
Advance to the next frame in the strip.
Sprite & operator=(const Sprite &)=delete
Sprite(Serializer::Properties &props, bool is_derived) noexcept
EGT_NODISCARD bool is_last_frame() const
Returns true if the current frame is the last frame.
EGT_NODISCARD shared_cairo_surface_t surface() const
Get a surface for the current frame.
void create_impl(const Image &image, const Size &frame_size, int frame_count, const Point &frame_point)
Create the internal implementation.
Sprite(WindowHint hint=WindowHint::automatic)
Sprite(Serializer::Properties &props) noexcept
Definition sprite.h:88
EGT_NODISCARD uint32_t frame_count() const
Returns the number of frames in the current strip.
Sprite(Sprite &&) noexcept
A Window is a Widget that handles drawing to a Screen.
Definition window.h:47
std::shared_ptr< cairo_surface_t > shared_cairo_surface_t
Shared pointer for a cairo surface.
Definition types.h:29
WindowHint
Hint used for configuring Window backends.
Definition widgetflags.h:683
EGT framework namespace.
Definition animation.h:24