25#include "BasicSprite.h"
27#include "GraphicsApi.h"
30#include "VertexArray.h"
34#ifndef DOXYGEN_SHOULD_SKIP_THIS
247 return m_basic.getLocalBounds();
279 Color4f m_disabledTextOutlineColor;
282 Color4f m_defaultTextOutlineColor;
285 Color4f m_selectedTextOutlineColor;
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;
489 return getSprite().getLocalBounds();
505 void updateGeometry();
507 void onStateChanged()
override;
591 void updateGeometry();
604#ifndef DOXYGEN_SHOULD_SKIP_THIS
A basic sprite.
Definition: BasicSprite.h:46
A basic text.
Definition: BasicText.h:50
A character font.
Definition: Font.h:109
Base class for all render targets (window, texture, ...)
Definition: RenderTarget.h:102
Specialized shape representing a rounded rectangle.
Definition: Shapes.h:396
A text within a rounded rectangle widget.
Definition: Widgets.h:294
void setPadding(float padding)
Set the padding around the text.
Definition: Widgets.h:373
void setDefaultBackgroundOutlineColor(const Color4f &color)
Set the outline's color of the button when it's in a normal state.
void setDisabledBackgroundOutlineColor(const Color4f &color)
Set the outline's color of the button when disabled.
void onStateChanged() override
Function called when the state changes.
void setRadius(float radius)
Set the radius of the corners.
Definition: Widgets.h:363
void setBackgroundOutlineThickness(float thickness)
Set the thickness of the outline.
void setSelectedBackgroundOutlineColor(const Color4f &color)
Set the outline's color of the button when selected.
void setDefaultBackgroundColor(const Color4f &color)
Set the background's color of the button when it's in a normal state.
bool contains(Vector2f coords) override
Check if the widget contains the coordinates.
TextButtonWidget(std::string text, Font &font, unsigned characterSize=30)
Construct a text button widget.
void draw(RenderTarget &target, const RenderStates &states) override
Draw the object to a render target.
void setSelectedBackgroundColor(const Color4f &color)
Set the background's color of the button when selected.
void setDisabledBackgroundColor(const Color4f &color)
Set the background's color of the button when disabled.
A simple text widget.
Definition: Widgets.h:47
void setDefaultTextOutlineColor(const Color4f &color)
Set the outline's color of the button when it's in a normal state.
TextWidget(std::string text, Font &font, unsigned characterSize=30)
Constructor.
float getLetterSpacing() const
Get the size of the letter spacing factor.
const std::string & getString() const
Get the text's string.
void setDefaultTextColor(const Color4f &color)
Set the text's color of the button when it's in a normal state.
void onStateChanged() override
Function called when the state changes.
void updateColors(Color4f textColor, Color4f outlineColor)
void setDisabledTextColor(const Color4f &color)
Set the text's color of the button when disabled.
void setSelectedTextColor(const Color4f &color)
Set the text's color of the button when selected.
void setParagraphWidth(float paragraphWidth)
Set the paragraph width for aligned text.
void setAnchor(Anchor anchor)
Set the anchor origin of the entity.
void setCharacterSize(unsigned characterSize)
Set the character size.
float getLineSpacing() const
Get the size of the line spacing factor.
void setAlignment(Alignment align)
Set the alignement of the text.
void setLineSpacing(float spacingFactor)
Set the line spacing factor.
void setTextOutlineThickness(float thickness)
Set the thickness of the outline.
void updateCurrentStateColors()
void setString(std::string string)
Set the text's string.
float getParagraphWidth() const
Get the paragraph width.
RectF getLocalBounds() const
Get the local bounding rectangle of the entity.
Definition: Widgets.h:246
Alignment getAlignment() const
Get the alignment of the text.
void setSelectedTextOutlineColor(const Color4f &color)
Set the outline's color of the button when selected.
void setDisabledTextOutlineColor(const Color4f &color)
Set the outline's color of the button when disabled.
bool contains(Vector2f coords) override
Check if the widget contains the coordinates.
unsigned getCharacterSize() const
Get the character size.
void setLetterSpacing(float spacingFactor)
Set the letter spacing factor.
void draw(RenderTarget &target, const RenderStates &states) override
Draw the object to a render target.
BasicText & getText()
Definition: Widgets.h:269
A texture for colored images.
Definition: Texture.h:313
A set of primitives.
Definition: VertexArray.h:65
Anchor
An anchor of a box.
Definition: Anchor.h:38
Alignment
The alignement of a text.
Definition: Alignment.h:33
The namespace for gf classes.
Define the states used for drawing to a RenderTarget.
Definition: RenderStates.h:82
A 4D vector.
Definition: Vector.h:852
A point associated with a color and a texture coordinate.
Definition: Vertex.h:75