25 #include "BasicSprite.h" 26 #include "BasicText.h" 27 #include "GraphicsApi.h" 30 #include "VertexArray.h" 34 #ifndef DOXYGEN_SHOULD_SKIP_THIS 56 TextWidget(std::string text,
Font& font,
unsigned characterSize = 30);
60 bool contains(
Vector2f coords)
override;
70 void setString(std::string
string);
81 const std::string& getString()
const;
109 void setParagraphWidth(
float paragraphWidth);
117 float getParagraphWidth()
const;
131 void setLineSpacing(
float spacingFactor);
140 float getLineSpacing()
const;
158 void setLetterSpacing(
float spacingFactor);
167 float getLetterSpacing()
const;
174 void setCharacterSize(
unsigned characterSize);
183 unsigned getCharacterSize()
const;
190 void setTextOutlineThickness(
float thickness);
197 void setDisabledTextColor(
const Color4f &color);
204 void setDisabledTextOutlineColor(
const Color4f &color);
211 void setDefaultTextColor(
const Color4f &color);
218 void setDefaultTextOutlineColor(
const Color4f &color);
225 void setSelectedTextColor(
const Color4f &color);
232 void setSelectedTextOutlineColor(
const Color4f &color);
247 return m_basic.getLocalBounds();
260 void setAnchor(
Anchor anchor);
263 void updateCurrentStateColors();
265 void updateGeometry();
267 void onStateChanged()
override;
279 Color4f m_disabledTextOutlineColor;
282 Color4f m_defaultTextOutlineColor;
285 Color4f m_selectedTextOutlineColor;
307 bool contains(
Vector2f coords)
override;
314 void setBackgroundOutlineThickness(
float thickness);
321 void setDisabledBackgroundColor(
const Color4f &color);
328 void setDisabledBackgroundOutlineColor(
const Color4f &color);
335 void setDefaultBackgroundColor(
const Color4f &color);
342 void setDefaultBackgroundOutlineColor(
const Color4f &color);
349 void setSelectedBackgroundColor(
const Color4f &color);
356 void setSelectedBackgroundOutlineColor(
const Color4f &color);
379 void updateGeometry();
381 void onStateChanged()
override;
386 float m_backgroundOutlineThickness;
388 Color4f m_disabledBackgroundColor;
389 Color4f m_disabledBackgroundOutlineColor;
391 Color4f m_defaultBackgroundColor;
392 Color4f m_defaultBackgroundOutlineColor;
394 Color4f m_selectedBackgroundColor;
395 Color4f m_selectedBackgroundOutlineColor;
433 bool contains(
Vector2f coords)
override;
441 void setDisabledSprite(
const Texture& texture,
const RectF& textureRect);
447 void unsetDisabledSprite();
455 void setDefaultSprite(
const Texture& texture,
const RectF& textureRect);
461 void unsetDefaultSprite();
469 void setSelectedSprite(
const Texture& texture,
const RectF& textureRect);
475 void unsetSelectedSprite();
489 return getSprite().getLocalBounds();
502 void setAnchor(
Anchor anchor);
505 void updateGeometry();
507 void onStateChanged()
override;
547 bool contains(
Vector2f coords)
override;
556 void setChosen(
bool chosen =
true);
575 void setEmptySprite(
const Texture& texture,
const RectF& textureRect);
585 void setChosenSprite(
const Texture& texture,
const RectF& textureRect);
588 void triggered()
override;
591 void updateGeometry();
604 #ifndef DOXYGEN_SHOULD_SKIP_THIS 609 #endif // GF_WIDGETS_H A simple text widget.
Definition: Widgets.h:47
A set of primitives.
Definition: VertexArray.h:65
Base class for all render targets (window, texture, ...)
Definition: RenderTarget.h:102
void setRadius(float radius)
Set the radius of the corners.
Definition: Widgets.h:363
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:294
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:246
A texture for colored images.
Definition: Texture.h:313
void setPadding(float padding)
Set the padding around the text.
Definition: Widgets.h:373
Alignment
The alignement of a text.
Definition: Alignment.h:33
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
General purpose math vector.
Definition: Vector.h:61
BasicText & getText()
Definition: Widgets.h:269
A basic sprite.
Definition: BasicSprite.h:46