26#ifndef TGUI_PICTURE_HPP
27#define TGUI_PICTURE_HPP
30#include <TGUI/Widgets/ClickableWidget.hpp>
31#include <TGUI/Renderers/PictureRenderer.hpp>
35TGUI_MODULE_EXPORT
namespace tgui
44 using Ptr = std::shared_ptr<Picture>;
45 using ConstPtr = std::shared_ptr<const Picture>;
47 static constexpr const char StaticWidgetType[] =
"Picture";
57 Picture(
const char* typeName = StaticWidgetType,
bool initRenderer =
true);
106 TGUI_NODISCARD
const PictureRenderer* getSharedRenderer()
const override;
125 using Widget::setSize;
167 void leftMouseReleased(
Vector2f pos)
override;
216 TGUI_NODISCARD std::unique_ptr<DataIO::Node>
save(SavingRenderersMap& renderers)
const override;
222 void load(
const std::unique_ptr<DataIO::Node>& node,
const LoadingRenderersMap& renderers)
override;
228 bool updateTime(
Duration elapsedTime)
override;
242 bool m_ignoringMouseEvents =
false;
245 bool m_possibleDoubleClick =
false;
Base class for render targets.
Definition BackendRenderTarget.hpp:48
Wrapper for durations.
Definition Duration.hpp:56
Class to store the position or size of a widget.
Definition Layout.hpp:305
Definition PictureRenderer.hpp:37
Picture widget.
Definition Picture.hpp:41
std::shared_ptr< Picture > Ptr
Shared widget pointer.
Definition Picture.hpp:44
void draw(BackendRenderTarget &target, RenderStates states) const override
Draw the widget to a render target.
static TGUI_NODISCARD Picture::Ptr copy(const Picture::ConstPtr &picture)
Makes a copy of another picture.
TGUI_NODISCARD bool isMouseOnWidget(Vector2f pos) const override
Returns whether the mouse position (which is relative to the parent widget) lies on top of the widget...
std::shared_ptr< const Picture > ConstPtr
Shared constant widget pointer.
Definition Picture.hpp:45
static TGUI_NODISCARD Picture::Ptr create()
Creates a new empty picture widget.
TGUI_NODISCARD bool canGainFocus() const override
Returns whether the widget can gain focus.
void rendererChanged(const String &property) override
Function called when one of the properties of the renderer is changed.
TGUI_NODISCARD std::unique_ptr< DataIO::Node > save(SavingRenderersMap &renderers) const override
Saves the widget as a tree node in order to save it to a file.
TGUI_NODISCARD PictureRenderer * getRenderer() override
Returns the renderer, which gives access to functions that determine how the widget is displayed.
static TGUI_NODISCARD Picture::Ptr create(const Texture &texture, bool transparentTexture=false)
Creates a new picture widget.
TGUI_NODISCARD Signal & getSignal(String signalName) override
Retrieves a signal based on its name.
TGUI_NODISCARD bool isIgnoringMouseEvents() const
Returns whether the widget is ignoring mouse events and letting them pass to the widgets behind it.
TGUI_NODISCARD PictureRenderer * getSharedRenderer() override
Returns the renderer, which gives access to functions that determine how the widget is displayed.
void setSize(const Layout2d &size) override
Changes the size of the picture.
TGUI_NODISCARD Widget::Ptr clone() const override
Makes a copy of the widget if you don't know its exact type.
void ignoreMouseEvents(bool ignore=true)
Sets whether the widget should completely ignore mouse events and let them pass to the widgets behind...
void load(const std::unique_ptr< DataIO::Node > &node, const LoadingRenderersMap &renderers) override
Loads the widget from a tree of nodes.
Signal to which the user can subscribe to get callbacks from.
Definition Signal.hpp:62
Wrapper class to store strings.
Definition String.hpp:101
Texture wrapper that internally reuses resources when multiple Texture objects are loaded from the sa...
Definition Texture.hpp:57
Namespace that contains all TGUI functions and classes.
Definition AbsoluteOrRelativeValue.hpp:39
States used for drawing.
Definition RenderStates.hpp:39