26#ifndef TGUI_CANVAS_HPP
27#define TGUI_CANVAS_HPP
30#include <TGUI/Widgets/ClickableWidget.hpp>
42 typedef std::shared_ptr<Canvas>
Ptr;
43 typedef std::shared_ptr<const Canvas>
ConstPtr;
151 void draw(
const sf::Drawable& drawable,
const sf::RenderStates& states = sf::RenderStates::Default);
163 void draw(
const sf::Vertex* vertices,
unsigned int vertexCount,
164 sf::PrimitiveType type,
const sf::RenderStates& states = sf::RenderStates::Default);
195 return std::make_shared<Canvas>(*
this);
202 virtual void draw(sf::RenderTarget& target, sf::RenderStates states)
const override;
208 sf::RenderTexture m_renderTexture;
Definition: Canvas.hpp:39
void clear(const Color &color=sf::Color(0, 0, 0, 255))
Clear the entire canvas with a single color.
virtual void setSize(const Layout2d &size) override
Changes the size of the widget.
void draw(const sf::Drawable &drawable, const sf::RenderStates &states=sf::RenderStates::Default)
Draw a drawable object to the canvas.
static Canvas::Ptr create(Layout2d size={100, 100})
Creates a new canvas widget.
void draw(const sf::Vertex *vertices, unsigned int vertexCount, sf::PrimitiveType type, const sf::RenderStates &states=sf::RenderStates::Default)
Draw primitives defined by an array of vertices.
virtual void setPosition(const Layout2d &position) override
Set the position of the widget.
static Canvas::Ptr copy(Canvas::ConstPtr canvas)
Makes a copy of another canvas.
Canvas(const Canvas ©)
Copy constructor.
virtual void setOpacity(float opacity) override
Changes the opacity of the widget.
void display()
Update the contents of the canvas.
Canvas(const Layout &width, const Layout &height)
Default constructor.
std::shared_ptr< const Canvas > ConstPtr
Shared constant widget pointer.
Definition: Canvas.hpp:43
std::shared_ptr< Canvas > Ptr
Shared widget pointer.
Definition: Canvas.hpp:42
Canvas(const Layout2d &size={100, 100})
Default constructor.
virtual Widget::Ptr clone() const override
Makes a copy of the widget if you don't know its exact type.
Definition: Canvas.hpp:193
Implicit converter for colors.
Definition: Color.hpp:40
Class to store the position or size of a widget.
Definition: Layout.hpp:255
Class to store the left, top, width or height of a widget.
Definition: Layout.hpp:121
Namespace that contains all TGUI functions and classes.
Definition: Animation.hpp:34