25 #include "BasicSprite.h" 26 #include "BasicText.h" 29 #include "VertexArray.h" 33 #ifndef DOXYGEN_SHOULD_SKIP_THIS 55 TextWidget(std::string text,
Font& font,
unsigned characterSize = 30);
59 bool contains(
Vector2f coords)
override;
69 void setString(std::string
string);
80 const std::string& getString()
const;
108 void setParagraphWidth(
float paragraphWidth);
116 float getParagraphWidth()
const;
130 void setLineSpacing(
float spacingFactor);
139 float getLineSpacing()
const;
157 void setLetterSpacing(
float spacingFactor);
166 float getLetterSpacing()
const;
173 void setCharacterSize(
unsigned characterSize);
182 unsigned getCharacterSize()
const;
189 void setTextOutlineThickness(
float thickness);
196 void setDisabledTextColor(
const Color4f &color);
203 void setDisabledTextOutlineColor(
const Color4f &color);
210 void setDefaultTextColor(
const Color4f &color);
217 void setDefaultTextOutlineColor(
const Color4f &color);
224 void setSelectedTextColor(
const Color4f &color);
231 void setSelectedTextOutlineColor(
const Color4f &color);
246 return m_basic.getLocalBounds();
259 void setAnchor(
Anchor anchor);
262 void updateCurrentStateColors();
264 void updateGeometry();
266 void onStateChanged()
override;
278 Color4f m_disabledTextOutlineColor;
281 Color4f m_defaultTextOutlineColor;
284 Color4f m_selectedTextOutlineColor;
306 bool contains(
Vector2f coords)
override;
313 void setBackgroundOutlineThickness(
float thickness);
320 void setDisabledBackgroundColor(
const Color4f &color);
327 void setDisabledBackgroundOutlineColor(
const Color4f &color);
334 void setDefaultBackgroundColor(
const Color4f &color);
341 void setDefaultBackgroundOutlineColor(
const Color4f &color);
348 void setSelectedBackgroundColor(
const Color4f &color);
355 void setSelectedBackgroundOutlineColor(
const Color4f &color);
378 void updateGeometry();
380 void onStateChanged()
override;
385 float m_backgroundOutlineThickness;
387 Color4f m_disabledBackgroundColor;
388 Color4f m_disabledBackgroundOutlineColor;
390 Color4f m_defaultBackgroundColor;
391 Color4f m_defaultBackgroundOutlineColor;
393 Color4f m_selectedBackgroundColor;
394 Color4f m_selectedBackgroundOutlineColor;
432 bool contains(
Vector2f coords)
override;
440 void setDisabledSprite(
const Texture& texture,
const RectF& textureRect);
446 void unsetDisabledSprite();
454 void setDefaultSprite(
const Texture& texture,
const RectF& textureRect);
460 void unsetDefaultSprite();
468 void setSelectedSprite(
const Texture& texture,
const RectF& textureRect);
474 void unsetSelectedSprite();
488 return getSprite().getLocalBounds();
501 void setAnchor(
Anchor anchor);
504 void updateGeometry();
506 void onStateChanged()
override;
546 bool contains(
Vector2f coords)
override;
555 void setChosen(
bool chosen =
true);
574 void setEmptySprite(
const Texture& texture,
const RectF& textureRect);
584 void setChosenSprite(
const Texture& texture,
const RectF& textureRect);
587 void triggered()
override;
590 void updateGeometry();
603 #ifndef DOXYGEN_SHOULD_SKIP_THIS 608 #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:90
void setRadius(float radius)
Set the radius of the corners.
Definition: Widgets.h:362
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:293
A point associated with a color and a texture coordinate.
Definition: Vertex.h:75
A basic text.
Definition: BasicText.h:50
RectF getLocalBounds() const
Get the local bounding rectangle of the entity.
Definition: Widgets.h:245
A texture for colored images.
Definition: Texture.h:309
void setPadding(float padding)
Set the padding around the text.
Definition: Widgets.h:372
The namespace for gf classes.
Definition: Action.h:35
A character font.
Definition: Font.h:109
A 4D vector.
Definition: Vector.h:852
Anchor
An anchor of a box.
Definition: Anchor.h:38
Alignment
The alignement of a text.
Definition: Alignment.h:33
BasicText & getText()
Definition: Widgets.h:268
A basic sprite.
Definition: BasicSprite.h:46