123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051 |
- #pragma once
- #include <SFML/Graphics.hpp>
- #include <functional>
- #include "Foreground.hpp"
- class Triangle: public sf::Drawable, public sf::Transformable
- {
- public:
- Triangle();
- float getSize();
- void setSize(float size);
- virtual void setTexture(sf::Texture& texture);
- void setColor(sf::Color color);
- void setColor(unsigned r, unsigned g, unsigned b, unsigned a = 255);
- protected:
- virtual void redraw();
- void vertexFit();
- sf::VertexArray _vertices;
- const sf::Texture* _texture;
- private:
- virtual void draw(sf::RenderTarget& target, sf::RenderStates states) const override;
- float _size;
- };
|