sfString Class Reference

#include <String.hpp>

Inheritance diagram for sfString:

sfDrawable List of all members.

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)

Detailed Description

sfString defines a graphic 2D text, that can be drawn on screen

Definition at line 39 of file String.hpp.


Constructor & Destructor Documentation

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

Parameters:
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.


Member Function Documentation

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)

Parameters:
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

Parameters:
Width : Returned width of string
Height : Returned height of string

Definition at line 127 of file String.cpp.

References Font, Size, and Text.

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.


The documentation for this class was generated from the following files:
Generated for SFML by  doxygen 1.5.2