String.h File Reference

#include <SFML/Config.h>
#include <SFML/Graphics/BlendMode.h>
#include <SFML/Graphics/Color.h>
#include <SFML/Graphics/Rect.h>

Go to the source code of this file.


Typedefs

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

Functions

CSFML_API sfStringsfString_Create ()
 Create a new string.
CSFML_API void sfString_Destroy (sfString *String)
 Destroy an existing string.
CSFML_API void sfString_SetLeft (sfString *String, float Left)
 Set the left position of a string.
CSFML_API void sfString_SetTop (sfString *String, float Top)
 Set the top position of a string.
CSFML_API void sfString_SetPosition (sfString *String, float Left, float Top)
 Set the position of a string.
CSFML_API void sfString_SetScaleX (sfString *String, float Scale)
 Set the horizontal scale of a string.
CSFML_API void sfString_SetScaleY (sfString *String, float Scale)
 Set the vertical scale of a string.
CSFML_API void sfString_SetScale (sfString *String, float ScaleX, float ScaleY)
 Set the scale of a string.
CSFML_API void sfString_SetRotation (sfString *String, float Rotation)
 Set the orientation of a string.
CSFML_API void sfString_SetRotationCenter (sfString *String, float X, float Y)
 Set the center of rotation of a string, in coordinates relative to it.
CSFML_API void sfString_SetColor (sfString *String, sfColor Color)
 Set the color of a string.
CSFML_API void sfString_SetBlendMode (sfString *String, sfBlendMode Mode)
 Set the blending mode for a string.
CSFML_API float sfString_GetLeft (sfString *String)
 Get the left position of a string.
CSFML_API float sfString_GetTop (sfString *String)
 Get the top position of a string.
CSFML_API float sfString_GetScaleX (sfString *String)
 Get the horizontal scale of a string.
CSFML_API float sfString_GetScaleY (sfString *String)
 Get the vertical scale of a string.
CSFML_API float sfString_GetRotation (sfString *String)
 Get the orientation of a string.
CSFML_API sfColor sfString_GetColor (sfString *String)
 Get the color of a string.
CSFML_API sfBlendMode sfString_GetBlendMode (sfString *String)
 Get the current blending mode of a string.
CSFML_API void sfString_Move (sfString *String, float OffsetX, float OffsetY)
 Move a string.
CSFML_API void sfString_Scale (sfString *String, float FactorX, float FactorY)
 Scale a string.
CSFML_API void sfString_Rotate (sfString *String, float Angle)
 Rotate a string.
CSFML_API void sfString_PreloadFont (const char *Font, float Size, const wchar_t *Charset)
 Preload a bitmap font (otherwise, it is done the first time the font is drawn).
CSFML_API void sfString_SetText (sfString *String, const char *Text)
 Set the text of a string (from a multibyte string).
CSFML_API void sfString_SetUnicodeText (sfString *String, const wchar_t *Text)
 Set the text of a string (from a unicode string).
CSFML_API void sfString_SetFont (sfString *String, const char *Font)
 Set the font of a string.
CSFML_API void sfString_SetSize (sfString *String, float Size)
 Set the size of a string.
CSFML_API const wchar_t * sfString_GetUnicodeText (sfString *String)
 Get the text of a string (returns a unicode string).
CSFML_API const char * sfString_GetText (sfString *String)
 Get the text of a string (returns a multibyte string).
CSFML_API const char * sfString_GetFont (sfString *String)
 Get the font used by a string.
CSFML_API float sfString_GetSize (sfString *String)
 Get the size of the characters of a string.
CSFML_API sfFloatRect sfString_GetRect (sfString *String)
 Get the bounding rectangle of a string on screen.

Typedef Documentation

typedef struct sfString sfString

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

Definition at line 40 of file String.h.


Function Documentation

CSFML_API sfString* sfString_Create (  ) 

Create a new string.

Returns:
A new sfString object, or NULL if it failed

CSFML_API void sfString_Destroy ( sfString String  ) 

Destroy an existing string.

Parameters:
String : String to delete

CSFML_API sfBlendMode sfString_GetBlendMode ( sfString String  ) 

Get the current blending mode of a string.

Parameters:
String : String to read
Returns:
Current blending mode

CSFML_API sfColor sfString_GetColor ( sfString String  ) 

Get the color of a string.

Parameters:
String : String to read
Returns:
Current color

CSFML_API const char* sfString_GetFont ( sfString String  ) 

Get the font used by a string.

Parameters:
String : String to read
Returns:
Font name

CSFML_API float sfString_GetLeft ( sfString String  ) 

Get the left position of a string.

Parameters:
String : String to read
Returns:
Current left position

CSFML_API sfFloatRect sfString_GetRect ( sfString String  ) 

Get the bounding rectangle of a string on screen.

Parameters:
String : String to read
Returns:
Rectangle contaning the string in screen coordinates

CSFML_API float sfString_GetRotation ( sfString String  ) 

Get the orientation of a string.

Parameters:
String : String to read
Returns:
Current rotation, in degrees

CSFML_API float sfString_GetScaleX ( sfString String  ) 

Get the horizontal scale of a string.

Parameters:
String : String to read
Returns:
Current X scale factor (always positive)

CSFML_API float sfString_GetScaleY ( sfString String  ) 

Get the vertical scale of a string.

Parameters:
String : String to read
Returns:
Current Y scale factor (always positive)

CSFML_API float sfString_GetSize ( sfString String  ) 

Get the size of the characters of a string.

Parameters:
String : String to read
Returns:
Size of the characters

CSFML_API const char* sfString_GetText ( sfString String  ) 

Get the text of a string (returns a multibyte string).

Parameters:
String : String to read
Returns:
Text

CSFML_API float sfString_GetTop ( sfString String  ) 

Get the top position of a string.

Parameters:
String : String to read
Returns:
Current top position

CSFML_API const wchar_t* sfString_GetUnicodeText ( sfString String  ) 

Get the text of a string (returns a unicode string).

Parameters:
String : String to read
Returns:
Text

CSFML_API void sfString_Move ( sfString String,
float  OffsetX,
float  OffsetY 
)

Move a string.

Parameters:
String : String to modify
OffsetX : Offset on the X axis
OffsetY : Offset on the Y axis

CSFML_API void sfString_PreloadFont ( const char *  Font,
float  Size,
const wchar_t *  Charset 
)

Preload a bitmap font (otherwise, it is done the first time the font is drawn).

Parameters:
Font : Font to load
Size : Requested character size
Charset : Characters set to generate (just pass NULL or empty string to get the ASCII range [31, 255])

CSFML_API void sfString_Rotate ( sfString String,
float  Angle 
)

Rotate a string.

Parameters:
String : String to modify
Angle : Angle of rotation, in degrees

CSFML_API void sfString_Scale ( sfString String,
float  FactorX,
float  FactorY 
)

Scale a string.

Parameters:
String : String to modify
FactorX : Horizontal scaling factor (must be strictly positive)
FactorY : Vertical scaling factor (must be strictly positive)

CSFML_API void sfString_SetBlendMode ( sfString String,
sfBlendMode  Mode 
)

Set the blending mode for a string.

Parameters:
String : String to modify
Mode : New blending mode

CSFML_API void sfString_SetColor ( sfString String,
sfColor  Color 
)

Set the color of a string.

Parameters:
String : String to modify
Color : New color

CSFML_API void sfString_SetFont ( sfString String,
const char *  Font 
)

Set the font of a string.

Parameters:
String : String to modify
Font : Font filename

CSFML_API void sfString_SetLeft ( sfString String,
float  Left 
)

Set the left position of a string.

Parameters:
String : String to modify
Left : New left coordinate

CSFML_API void sfString_SetPosition ( sfString String,
float  Left,
float  Top 
)

Set the position of a string.

Parameters:
String : String to modify
Left : New left coordinate
Top : New top coordinate

CSFML_API void sfString_SetRotation ( sfString String,
float  Rotation 
)

Set the orientation of a string.

Parameters:
String : String to modify
Rotation : Angle of rotation, in degrees

CSFML_API void sfString_SetRotationCenter ( sfString String,
float  X,
float  Y 
)

Set the center of rotation of a string, in coordinates relative to it.

Parameters:
String : String to modify
X : X coordinate of the center of rotation
Y : Y coordinate of the center of rotation

CSFML_API void sfString_SetScale ( sfString String,
float  ScaleX,
float  ScaleY 
)

Set the scale of a string.

Parameters:
String : String to modify
ScaleX : New horizontal scale (must be strictly positive)
ScaleY : New vertical scale (must be strictly positive)

CSFML_API void sfString_SetScaleX ( sfString String,
float  Scale 
)

Set the horizontal scale of a string.

Parameters:
String : String to modify
Scale : New scale (must be strictly positive)

CSFML_API void sfString_SetScaleY ( sfString String,
float  Scale 
)

Set the vertical scale of a string.

Parameters:
String : String to modify
Scale : New scale (must be strictly positive)

CSFML_API void sfString_SetSize ( sfString String,
float  Size 
)

Set the size of a string.

Parameters:
String : String to modify
Size : New size, in pixels

CSFML_API void sfString_SetText ( sfString String,
const char *  Text 
)

Set the text of a string (from a multibyte string).

Parameters:
String : String to modify
Text : New text

CSFML_API void sfString_SetTop ( sfString String,
float  Top 
)

Set the top position of a string.

Parameters:
String : String to modify
Top : New top coordinate

CSFML_API void sfString_SetUnicodeText ( sfString String,
const wchar_t *  Text 
)

Set the text of a string (from a unicode string).

Parameters:
String : String to modify
Text : New text