8 #ifndef SSG_HAVEBACKGROUND_HPP_ 9 #define SSG_HAVEBACKGROUND_HPP_ 11 #include <SFML/Graphics.hpp> 16 #include "ColorProvider.hpp" 17 #include "Element.hpp" 19 typedef std::pair<sf::Color, float> GradientPoint;
20 typedef std::vector<GradientPoint> GradientVector;
21 typedef std::vector<sf::Color> ColorVector;
22 typedef std::array<sf::Color, 4> GradientModifier;
24 #define GradientModifierNone { \ 25 {sf::Color::Transparent, sf::Color::Transparent, sf::Color::Transparent, sf::Color::Transparent} \ 33 void setBackgroundTexture(
const std::shared_ptr<sf::Texture>& backgroundTexture);
34 void setBackgroundTextureRect(
const sf::IntRect& value);
35 void setGradientType(GradientType gradientType);
36 void updateGradient(sf::FloatRect& area);
37 void setGradientPoints(
const ColorVector& evenlyColors);
38 void setGradientPoints(
const GradientVector& gradientPoints);
39 void setGradientModifier(
const GradientModifier& gradientModifier);
40 void setBackgroundSymbol(
const sf::VertexArray& value);
41 void setBackgroundSymbolTransform(
const sf::Transform& value);
42 void setBackgroundSymbolShift(
const sf::Vector2f& value);
43 sf::Vector2f getBackgroundSymbolShift()
const;
44 void setBackgroundSymbolStrech(
bool value);
45 void setBackgroundSymbolColor(sf::Color col);
46 void mulBackgroundSymbolColor(sf::Color col);
47 void initDefaultButtonBackgroundStyle(
ColorProvider& colorProvider);
48 bool isBackroundTextureRectActive()
const;
50 static void setDefaultBackgroundColor(sf::Color defaultBackgroundColor);
51 static sf::Color sum(sf::Color col, sf::Vector3i mod);
54 void drawBackgroundSymbol(
56 sf::RenderTarget& target,
57 const sf::RenderStates& states = sf::RenderStates()
60 std::shared_ptr<sf::Texture> backgroundTexture;
61 sf::VertexArray backgroundSymbol;
62 sf::VertexArray gradient;
63 GradientVector gradientPoints;
64 GradientType gradientType;
65 GradientModifier gradientModifier;
66 sf::FloatRect lastGradientUpdateArea;
67 sf::IntRect backgroundTextureRect;
68 sf::Transform backgroundSymbolTransform;
69 sf::Vector2f backgroundSymbolShift;
70 bool backgroundSymbolStrech;
72 static sf::Color defaultBackgroundColor;
73 static std::shared_ptr<sf::Texture> defaultTexture;
Definition: HaveBackground.hpp:28
Definition: ColorProvider.hpp:15
Definition: Element.hpp:22