25 #include "BasicSprite.h" 26 #include "BasicText.h" 29 #include "VertexArray.h" 33 #ifndef DOXYGEN_SHOULD_SKIP_THIS 56 TextWidget(std::string text,
Font& font,
unsigned characterSize = 30);
60 virtual bool contains(
Vector2f coords)
override;
67 void setTextOutlineThickness(
float thickness);
74 void setDisabledTextColor(
const Color4f &color);
81 void setDisabledTextOutlineColor(
const Color4f &color);
88 void setDefaultTextColor(
const Color4f &color);
95 void setDefaultTextOutlineColor(
const Color4f &color);
102 void setSelectedTextColor(
const Color4f &color);
109 void setSelectedTextOutlineColor(
const Color4f &color);
124 return m_basic.getLocalBounds();
137 void setAnchor(
Anchor anchor);
140 void updateCurrentStateColors();
142 void updateGeometry();
144 virtual void onStateChanged()
override;
156 Color4f m_disabledTextOutlineColor;
159 Color4f m_defaultTextOutlineColor;
162 Color4f m_selectedTextOutlineColor;
184 virtual bool contains(
Vector2f coords)
override;
191 void setBackgroundOutlineThickness(
float thickness);
198 void setDisabledBackgroundColor(
const Color4f &color);
205 void setDisabledBackgroundOutlineColor(
const Color4f &color);
212 void setDefaultBackgroundColor(
const Color4f &color);
219 void setDefaultBackgroundOutlineColor(
const Color4f &color);
226 void setSelectedBackgroundColor(
const Color4f &color);
233 void setSelectedBackgroundOutlineColor(
const Color4f &color);
256 void updateGeometry();
258 virtual void onStateChanged()
override;
263 float m_backgroundOutlineThickness;
265 Color4f m_disabledBackgroundColor;
266 Color4f m_disabledBackgroundOutlineColor;
268 Color4f m_defaultBackgroundColor;
269 Color4f m_defaultBackgroundOutlineColor;
271 Color4f m_selectedBackgroundColor;
272 Color4f m_selectedBackgroundOutlineColor;
310 virtual bool contains(
Vector2f coords)
override;
318 void setDisabledSprite(
const Texture& texture,
const RectF& textureRect);
326 void setDefaultSprite(
const Texture& texture,
const RectF& textureRect);
334 void setSelectedSprite(
const Texture& texture,
const RectF& textureRect);
348 return getSprite().getLocalBounds();
361 void setAnchor(
Anchor anchor);
364 void updateGeometry();
366 virtual void onStateChanged()
override;
406 virtual bool contains(
Vector2f coords)
override;
415 void setChosen(
bool chosen =
true);
434 void setEmptySprite(
const Texture& texture,
const RectF& textureRect);
444 void setChosenSprite(
const Texture& texture,
const RectF& textureRect);
447 virtual void triggered()
override;
450 void updateGeometry();
463 #ifndef DOXYGEN_SHOULD_SKIP_THIS 468 #endif // GF_WIDGETS_H A simple text widget.
Definition: Widgets.h:46
A set of primitives.
Definition: VertexArray.h:65
Base class for all render targets (window, texture, ...)
Definition: RenderTarget.h:66
void setRadius(float radius)
Set the radius of the corners.
Definition: Widgets.h:240
Define the states used for drawing to a RenderTarget.
Definition: RenderStates.h:82
Specialized shape representing a rounded rectangle.
Definition: Shapes.h:395
A text within a rounded rectangle widget.
Definition: Widgets.h:171
A point associated with a color and a texture coordinate.
Definition: Vertex.h:75
Definition: BasicText.h:47
RectF getLocalBounds() const
Get the local bounding rectangle of the entity.
Definition: Widgets.h:123
A texture for colored images.
Definition: Texture.h:339
void setPadding(float padding)
Set the padding around the text.
Definition: Widgets.h:250
The namespace for gf classes.
Definition: Action.h:35
A character font.
Definition: Font.h:130
Anchor
An anchor of a box.
Definition: Anchor.h:38
BasicText & getText()
Definition: Widgets.h:146
Definition: BasicSprite.h:43