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);
122 void setTexture(
const Texture& texture,
bool fullyClickable =
true);
145 static Picture::Ptr create(
const char* filename,
bool fullyClickable =
true);
191 return m_loadedFilename;
207 virtual void setPosition(
const Layout2d& position)
override;
219 virtual void setSize(
const Layout2d& size)
override;
235 void setSmooth(
bool smooth =
true);
248 return m_texture.isSmooth();
258 virtual void setOpacity(
float opacity)
override;
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;
316 #endif // TGUI_PICTURE_HPP Namespace that contains all TGUI functions and classes.
Definition: Animation.hpp:33
Class to store the position or size of a widget.
Definition: Layout.hpp:254
const sf::String & getLoadedFilename() const
Returns the filename of the image that was used to load the widget.
Definition: Picture.hpp:189
std::shared_ptr< const Picture > ConstPtr
Shared constant widget pointer.
Definition: Picture.hpp:52
Definition: Texture.hpp:44
std::shared_ptr< Picture > Ptr
Shared widget pointer.
Definition: Picture.hpp:51
virtual Widget::Ptr clone() const override
Makes a copy of the widget if you don't know its exact type.
Definition: Picture.hpp:279
Picture widget.
Definition: Picture.hpp:47
bool isSmooth() const
Tell whether the smooth filter is enabled or not.
Definition: Picture.hpp:246