C# Class SFML.Graphics.Text

This class defines a graphical 2D text, that can be drawn on screen
See also the note on coordinates and undistorted rendering in SFML.Graphics.Transformable.
Inheritance: Transformable, Drawable
Datei anzeigen Open project: SFML/SFML.Net Class Usage Examples

Private Properties

Property Type Description
sfRenderTexture_drawText void
sfRenderWindow_drawText void
sfText_copy System.IntPtr
sfText_create System.IntPtr
sfText_destroy void
sfText_findCharacterPos Vector2f
sfText_getCharacterSize uint
sfText_getColor System.Color
sfText_getFillColor System.Color
sfText_getLocalBounds FloatRect
sfText_getOutlineColor System.Color
sfText_getOutlineThickness float
sfText_getRect FloatRect
sfText_getString System.IntPtr
sfText_getStyle Styles
sfText_getUnicodeString System.IntPtr
sfText_setCharacterSize void
sfText_setColor void
sfText_setFillColor void
sfText_setFont void
sfText_setOutlineColor void
sfText_setOutlineThickness void
sfText_setStyle void
sfText_setUnicodeString void

Public Methods

Method Description
Draw ( RenderTarget target, RenderStates states ) : void

Draw the text to a render target

FindCharacterPos ( uint index ) : Vector2f

Return the visual position of the Index-th character of the text, in coordinates relative to the text (note : translation, origin, rotation and scale are not applied)

GetGlobalBounds ( ) : FloatRect

Get the global bounding rectangle of the entity. The returned rectangle is in global coordinates, which means that it takes in account the transformations (translation, rotation, scale, ...) that are applied to the entity. In other words, this function returns the bounds of the sprite in the global 2D world's coordinate system.

GetLocalBounds ( ) : FloatRect

Get the local bounding rectangle of the entity. The returned rectangle is in local coordinates, which means that it ignores the transformations (translation, rotation, scale, ...) that are applied to the entity. In other words, this function returns the bounds of the entity in the entity's coordinate system.

Text ( ) : System

Default constructor

Text ( Text copy ) : System

Construct the text from another text

Text ( string str, Font font ) : System

Construct the text from a string and a font

Text ( string str, Font font, uint characterSize ) : System

Construct the text from a string, font and size

ToString ( ) : string

Provide a string describing the object

Protected Methods

Method Description
Destroy ( bool disposing ) : void

Handle the destruction of the object

Private Methods

Method Description
sfRenderTexture_drawText ( IntPtr CPointer, IntPtr Text, RenderStates &states ) : void
sfRenderWindow_drawText ( IntPtr CPointer, IntPtr Text, RenderStates &states ) : void
sfText_copy ( IntPtr Text ) : IntPtr
sfText_create ( ) : IntPtr
sfText_destroy ( IntPtr CPointer ) : void
sfText_findCharacterPos ( IntPtr CPointer, uint Index ) : Vector2f
sfText_getCharacterSize ( IntPtr CPointer ) : uint
sfText_getColor ( IntPtr CPointer ) : System.Color
sfText_getFillColor ( IntPtr CPointer ) : System.Color
sfText_getLocalBounds ( IntPtr CPointer ) : FloatRect
sfText_getOutlineColor ( IntPtr CPointer ) : System.Color
sfText_getOutlineThickness ( IntPtr CPointer ) : float
sfText_getRect ( IntPtr CPointer ) : FloatRect
sfText_getString ( IntPtr CPointer ) : IntPtr
sfText_getStyle ( IntPtr CPointer ) : Styles
sfText_getUnicodeString ( IntPtr CPointer ) : IntPtr
sfText_setCharacterSize ( IntPtr CPointer, uint Size ) : void
sfText_setColor ( IntPtr CPointer, System.Color Color ) : void
sfText_setFillColor ( IntPtr CPointer, System.Color Color ) : void
sfText_setFont ( IntPtr CPointer, IntPtr Font ) : void
sfText_setOutlineColor ( IntPtr CPointer, System.Color Color ) : void
sfText_setOutlineThickness ( IntPtr CPointer, float thickness ) : void
sfText_setStyle ( IntPtr CPointer, Styles Style ) : void
sfText_setUnicodeString ( IntPtr CPointer, IntPtr Text ) : void

Method Details

Destroy() protected method

Handle the destruction of the object
protected Destroy ( bool disposing ) : void
disposing bool Is the GC disposing the object, or is it an explicit call ?
return void

Draw() public method

Draw the text to a render target
public Draw ( RenderTarget target, RenderStates states ) : void
target RenderTarget Render target to draw to
states RenderStates Current render states
return void

FindCharacterPos() public method

Return the visual position of the Index-th character of the text, in coordinates relative to the text (note : translation, origin, rotation and scale are not applied)
public FindCharacterPos ( uint index ) : Vector2f
index uint Index of the character
return Vector2f

GetGlobalBounds() public method

Get the global bounding rectangle of the entity. The returned rectangle is in global coordinates, which means that it takes in account the transformations (translation, rotation, scale, ...) that are applied to the entity. In other words, this function returns the bounds of the sprite in the global 2D world's coordinate system.
public GetGlobalBounds ( ) : FloatRect
return FloatRect

GetLocalBounds() public method

Get the local bounding rectangle of the entity. The returned rectangle is in local coordinates, which means that it ignores the transformations (translation, rotation, scale, ...) that are applied to the entity. In other words, this function returns the bounds of the entity in the entity's coordinate system.
public GetLocalBounds ( ) : FloatRect
return FloatRect

Text() public method

Default constructor
public Text ( ) : System
return System

Text() public method

Construct the text from another text
public Text ( Text copy ) : System
copy Text Text to copy
return System

Text() public method

Construct the text from a string and a font
public Text ( string str, Font font ) : System
str string String to display
font Font Font to use
return System

Text() public method

Construct the text from a string, font and size
public Text ( string str, Font font, uint characterSize ) : System
str string String to display
font Font Font to use
characterSize uint Base characters size
return System

ToString() public method

Provide a string describing the object
public ToString ( ) : string
return string