#include <String.hpp>
Inheritance diagram for sfString:
Public Member Functions | |
sfString (const std::string &Str="", const std::string &FontName="", const sfColor &Col=sfColor::White, float X=0.f, float Y=0.f, float Rot=0.f, float Si=32.f) | |
void | GetSize (float &Width, float &Height) const |
Static Public Member Functions | |
static void | PreloadFont (const std::string &FontName, float CharSize) |
Public Attributes | |
std::string | Text |
Text to display. | |
std::string | Font |
Font used to display string. | |
sfColor | Color |
Text color. | |
float | Left |
Left position of text on screen. | |
float | Top |
Top position of text on screen. | |
float | Rotation |
Orientation of text (in degrees). | |
float | Size |
Size of characters (in pixels) (must be strictly positive). | |
Protected Member Functions | |
virtual void | Render (sfRenderWindow &Window) |
Definition at line 39 of file String.hpp.
sfString::sfString | ( | const std::string & | Str = "" , |
|
const std::string & | FontName = "" , |
|||
const sfColor & | Col = sfColor::White , |
|||
float | X = 0.f , |
|||
float | Y = 0.f , |
|||
float | Rot = 0.f , |
|||
float | Si = 32.f | |||
) |
Default constructor
Str | : Text assigned to the string | |
FontName | : Font used to draw the string ("" by default - use default font) | |
Col | : Color of the sprite (white by default) | |
X | : Left coordinate of the sprite (0 by default) | |
Y | : Top coordinate of the sprite (0 by default) | |
Rot | : Orientation of the sprite (in degrees) (0 by default) | |
Si | : Characters size, in pixels (32 by default) |
Definition at line 37 of file String.cpp.
void sfString::PreloadFont | ( | const std::string & | FontName, | |
float | CharSize | |||
) | [static] |
Preload a bitmap font (otherwise, it is done the first time the font is drawn)
FontName | : Font to load | |
CharSize | : Requested character size |
Definition at line 53 of file String.cpp.
void sfString::GetSize | ( | float & | Width, | |
float & | Height | |||
) | const |
Get string size on screen
Width | : Returned width of string | |
Height | : Returned height of string |
Definition at line 127 of file String.cpp.
void sfString::Render | ( | sfRenderWindow & | Window | ) | [protected, virtual] |
/see sfDrawable::Render
Implements sfDrawable.
Definition at line 63 of file String.cpp.
References sfColor::Alpha, sfColor::Blue, sfRect< T >::Bottom, Color, Font, sfColor::Green, sfRect< T >::Left, Left, sfColor::Red, sfRect< T >::Right, Rotation, Size, Text, sfRect< T >::Top, and Top.