26#ifndef TGUI_PICTURE_HPP
27#define TGUI_PICTURE_HPP
30#include <TGUI/Widgets/ClickableWidget.hpp>
51 typedef std::shared_ptr<Picture>
Ptr;
52 typedef std::shared_ptr<const Picture>
ConstPtr;
71 Picture(
const sf::String& filename,
bool fullyClickable =
true);
103 void setTexture(
const sf::String& filename,
bool fullyClickable =
true);
191 return m_loadedFilename;
248 return m_texture.isSmooth();
264 virtual bool mouseOnWidget(
float x,
float y)
const override;
270 virtual void leftMouseReleased(
float x,
float y)
override;
281 return std::make_shared<Picture>(*
this);
288 virtual void update(sf::Time elapsedTime)
override;
294 virtual void draw(sf::RenderTarget& target, sf::RenderStates states)
const override;
300 sf::String m_loadedFilename;
305 bool m_fullyClickable =
true;
308 bool m_possibleDoubleClick =
false;
Class to store the position or size of a widget.
Definition: Layout.hpp:255
Picture widget.
Definition: Picture.hpp:48
virtual Widget::Ptr clone() const override
Makes a copy of the widget if you don't know its exact type.
Definition: Picture.hpp:279
void setTexture(const Texture &texture, bool fullyClickable=true)
Change the image.
Picture()
Default constructor.
const sf::String & getLoadedFilename() const
Returns the filename of the image that was used to load the widget.
Definition: Picture.hpp:189
Picture(const sf::String &filename, bool fullyClickable=true)
Constructor to creates the picture.
bool isSmooth() const
Tell whether the smooth filter is enabled or not.
Definition: Picture.hpp:246
std::shared_ptr< const Picture > ConstPtr
Shared constant widget pointer.
Definition: Picture.hpp:52
virtual void setSize(const Layout2d &size) override
Changes the size of the picture.
std::shared_ptr< Picture > Ptr
Shared widget pointer.
Definition: Picture.hpp:51
void setSmooth(bool smooth=true)
Enable or disable the smooth filter.
virtual void setOpacity(float opacity) override
Changes the opacity of the widget.
virtual void setPosition(const Layout2d &position) override
Set the position of the widget.
void setTexture(const sf::String &filename, bool fullyClickable=true)
Change the image.
Picture(const Texture &texture, bool fullyClickable=true)
Constructor to create the picture from an image.
static Picture::Ptr copy(Picture::ConstPtr picture)
Makes a copy of another picture.
static Picture::Ptr create(const char *filename, bool fullyClickable=true)
Creates a new picture widget.
static Picture::Ptr create(const Texture &texture={}, bool fullyClickable=true)
Creates a new picture widget.
Definition: Texture.hpp:45
Namespace that contains all TGUI functions and classes.
Definition: Animation.hpp:34