1 #ifndef AETHER_TEXT_HPP 2 #define AETHER_TEXT_HPP 4 #include "Aether/base/BaseText.hpp" 54 static std::pair<int, int>
getDimensions(
const std::string & str,
const unsigned int size);
104 void update(
unsigned int dt);
112 void setW(
const int w);
void update(unsigned int dt)
Called internally. Overrides Element's update in order to scroll the text if needed.
void setString(const std::string &str)
Set a new string. Will cause an immediate redraw.
Element for rendering a single line of text. It can optionally scroll when overflowing.
Definition: Text.hpp:15
Small utility class to measure time.
Definition: Timer.hpp:10
void setW(const int w)
Adjust the overall element's width. This will cause the text to clip if it doesn't fit and scrolling ...
void setScrollSpeed(const int pps)
Set the scroll speed of the text.
int w()
Returns width of element.
Stores either a surface or texture which can be drawn on screen by providing a renderer to render()...
Definition: Drawable.hpp:22
int x()
Returns x-coordinate of element.
BaseText is an abstract class storing relevant information to render a text element.
Definition: BaseText.hpp:12
Base namespace for all Aether related classes and functions.
Text(const int x, const int y, const std::string &str, const unsigned int size, const Render type=Render::Sync)
Constructs a new Text element.
bool canScroll()
Returns whether the text is allowed to scroll when needed.
static std::pair< int, int > getDimensions(const std::string &str, const unsigned int size)
Returns the dimensions of the given string if it were to be rendered, without performing any slow ren...
void setFontSize(const unsigned int size)
Set the render font size for text.
void setScrollPause(const unsigned int ms)
Set how long the text should 'pause' for when it finishes scrolling.
void setCanScroll(const bool scroll)
Set whether the text will scroll when overflowing.
~Text()
Destroys the Text element.
Render
Supported "on create" texture rendering options.
Definition: Texture.hpp:11
int y()
Returns y-coordinate of element.