Represents a string of sprites in the SUNENGINE.
More...
#include <SpriteString.h>
|
|
| SpriteString (const SpriteString &)=delete |
| |
|
SpriteString & | operator= (const SpriteString &)=delete |
| |
| | SpriteString (SpriteFont *font, std::string text, float x, float y) |
| | Constructor for SpriteString with a font, text, and position.
|
| |
| float | GetWidth () |
| | Gets the width of the sprite string.
|
| |
| float | GetHeight () |
| | Gets the height of the sprite string.
|
| |
| void | SetPosition (float x, float y) |
| | Sets the position of the sprite string.
|
| |
| float | GetPosX () const |
| | Gets the x-coordinate of the position.
|
| |
| float | GetPosY () const |
| | Gets the y-coordinate of the position.
|
| |
| void | SetCollection (SpriteFont *font, std::string text, float x, float y) |
| | Sets the collection of sprites for the string.
|
| |
| void | UpdateCollection (SpriteFont *font, std::string text, float x, float y) |
| | Updates the collection of sprites for the string.
|
| |
| void | UpdateCollection (std::string text, float x, float y) |
| | Updates the collection of sprites for the string.
|
| |
|
void | Render () |
| | Renders the sprite string.
|
| |
| void | SetScaleFactor (float x, float y) |
| | Sets the scale factor for the sprite string.
|
| |
| void | SetScalePixel (float x, float y) |
| | Sets the scale of the sprite string in pixels.
|
| |
| int | GetLines () const |
| | Sets the scale of the sprite string in pixels.
|
| |
| float | GetScaleX () const |
| | Gets the scale factor in the x direction.
|
| |
| float | GetScaleY () const |
| | Gets the scale factor in the y direction.
|
| |
| void | SetAngleDegrees (float degrees) |
| | Sets the angle of the sprite string in degrees.
|
| |
| void | SetAngleRadians (float radians) |
| | Sets the angle of the sprite string in radians.
|
| |
| void | SetOrigin (float x, float y) |
| | Sets the origin of the sprite string.
|
| |
| std::string | GetText () const |
| | Gets the current text of the sprite string.
|
| |
|
|
using | GlyphIt = std::list<Glyph*>::iterator |
| | Iterator type for the glyph list.
|
| |
|
|
std::list< Glyph * > | GlyphList |
| | List of glyphs representing the string.
|
| |
|
SpriteFont * | pFont |
| | Pointer to the SpriteFont used for rendering the string.
|
| |
|
float | originX |
| | The x-coordinate of the origin.
|
| |
|
float | originY |
| | The y-coordinate of the origin.
|
| |
|
float | posX |
| | The x-coordinate of the position.
|
| |
|
float | posY |
| | The y-coordinate of the position.
|
| |
|
int | width |
| | The width of the sprite string.
|
| |
|
int | height |
| | The height of the sprite string.
|
| |
|
float | scaleX |
| | The scale factor in the x direction.
|
| |
|
float | scaleY |
| | The scale factor in the y direction.
|
| |
|
int | lines |
| | The number of lines in the sprite string.
|
| |
|
float | angle |
| | The angle of the sprite string in radians.
|
| |
|
std::string | currentText |
| | The current text in the sprite string.
|
| |
Represents a string of sprites in the SUNENGINE.
The SpriteString class is responsible for managing and rendering a string of sprites in the SUNENGINE. It provides methods to set the position, update the collection of sprites, and render the string.
◆ SpriteString()
| SpriteString::SpriteString |
( |
SpriteFont * | font, |
|
|
std::string | text, |
|
|
float | x, |
|
|
float | y ) |
Constructor for SpriteString with a font, text, and position.
- Parameters
-
| font | Pointer to the SpriteFont to be used. |
| text | The text to be rendered. |
| x | The x-coordinate of the position. |
| y | The y-coordinate of the position. |
◆ GetHeight()
| float SpriteString::GetHeight |
( |
| ) |
|
Gets the height of the sprite string.
- Returns
- The height of the sprite string.
◆ GetLines()
| int SpriteString::GetLines |
( |
| ) |
const |
Sets the scale of the sprite string in pixels.
- Parameters
-
| x | The width in pixels. |
| y | The height in pixels. |
◆ GetPosX()
| float SpriteString::GetPosX |
( |
| ) |
const |
Gets the x-coordinate of the position.
- Returns
- The x-coordinate of the position.
◆ GetPosY()
| float SpriteString::GetPosY |
( |
| ) |
const |
Gets the y-coordinate of the position.
- Returns
- The y-coordinate of the position.
◆ GetScaleX()
| float SpriteString::GetScaleX |
( |
| ) |
const |
Gets the scale factor in the x direction.
- Returns
- The scale factor in the x direction.
◆ GetScaleY()
| float SpriteString::GetScaleY |
( |
| ) |
const |
Gets the scale factor in the y direction.
- Returns
- The scale factor in the y direction.
◆ GetText()
| std::string SpriteString::GetText |
( |
| ) |
const |
Gets the current text of the sprite string.
- Returns
- The current text as a string.
◆ GetWidth()
| float SpriteString::GetWidth |
( |
| ) |
|
Gets the width of the sprite string.
- Returns
- The width of the sprite string.
◆ SetAngleDegrees()
| void SpriteString::SetAngleDegrees |
( |
float | degrees | ) |
|
Sets the angle of the sprite string in degrees.
- Parameters
-
| degrees | The angle in degrees. |
◆ SetAngleRadians()
| void SpriteString::SetAngleRadians |
( |
float | radians | ) |
|
Sets the angle of the sprite string in radians.
- Parameters
-
| radians | The angle in radians. |
◆ SetCollection()
| void SpriteString::SetCollection |
( |
SpriteFont * | font, |
|
|
std::string | text, |
|
|
float | x, |
|
|
float | y ) |
Sets the collection of sprites for the string.
- Parameters
-
| font | Pointer to the SpriteFont to be used. |
| text | The text to be rendered. |
| x | The x-coordinate of the position. |
| y | The y-coordinate of the position. |
◆ SetOrigin()
| void SpriteString::SetOrigin |
( |
float | x, |
|
|
float | y ) |
Sets the origin of the sprite string.
- Parameters
-
| x | The x-coordinate of the origin. |
| y | The y-coordinate of the origin. |
◆ SetPosition()
| void SpriteString::SetPosition |
( |
float | x, |
|
|
float | y ) |
Sets the position of the sprite string.
- Parameters
-
| x | The x-coordinate of the position. |
| y | The y-coordinate of the position. |
◆ SetScaleFactor()
| void SpriteString::SetScaleFactor |
( |
float | x, |
|
|
float | y ) |
Sets the scale factor for the sprite string.
- Parameters
-
| x | The scale factor in the x direction. |
| y | The scale factor in the y direction. |
◆ SetScalePixel()
| void SpriteString::SetScalePixel |
( |
float | x, |
|
|
float | y ) |
Sets the scale of the sprite string in pixels.
- Parameters
-
| x | The width in pixels. |
| y | The height in pixels. |
◆ UpdateCollection() [1/2]
| void SpriteString::UpdateCollection |
( |
SpriteFont * | font, |
|
|
std::string | text, |
|
|
float | x, |
|
|
float | y ) |
Updates the collection of sprites for the string.
- Parameters
-
| font | Pointer to the SpriteFont to be used. |
| text | The text to be rendered. |
| x | The x-coordinate of the position. |
| y | The y-coordinate of the position. |
◆ UpdateCollection() [2/2]
| void SpriteString::UpdateCollection |
( |
std::string | text, |
|
|
float | x, |
|
|
float | y ) |
Updates the collection of sprites for the string.
- Parameters
-
| text | The text to be rendered. |
| x | The x-coordinate of the position. |
| y | The y-coordinate of the position. |
The documentation for this class was generated from the following files: