C# Class Sharpcraft.Library.GUI.Label

A text label displayed on screen.
显示文件 Open project: SijmenSchoon/Sharpcraft Class Usage Examples

Public Properties

Property Type Description
Font Microsoft.Xna.Framework.Graphics.SpriteFont
ForeColor Microsoft.Xna.Framework.Color
Text string

Public Methods

Method Description
GetCenterPosition ( Vector2 source ) : Vector2

Get center position for this label based on a source rectangle.

GetCenterPosition ( Vector2 source, Vector2 offset ) : Vector2

Get center position for this label based on a source rectangle.

Label ( string text = null, SpriteFont font = null ) : Microsoft.Xna.Framework

Initialize a new label.

Label ( string text, SpriteFont font, Microsoft.Xna.Framework.Color foreColor ) : Microsoft.Xna.Framework

Initialize a new label.

Method Details

GetCenterPosition() public method

Get center position for this label based on a source rectangle.
public GetCenterPosition ( Vector2 source ) : Vector2
source Microsoft.Xna.Framework.Vector2 The source rectangle to get center position for.
return Microsoft.Xna.Framework.Vector2

GetCenterPosition() public method

Get center position for this label based on a source rectangle.
public GetCenterPosition ( Vector2 source, Vector2 offset ) : Vector2
source Microsoft.Xna.Framework.Vector2 The source rectangle to get center position for.
offset Microsoft.Xna.Framework.Vector2 defining X and Y offset for the label position.
return Microsoft.Xna.Framework.Vector2

Label() public method

Initialize a new label.
public Label ( string text = null, SpriteFont font = null ) : Microsoft.Xna.Framework
text string Text of the label.
font Microsoft.Xna.Framework.Graphics.SpriteFont Font to use for this label.
return Microsoft.Xna.Framework

Label() public method

Initialize a new label.
public Label ( string text, SpriteFont font, Microsoft.Xna.Framework.Color foreColor ) : Microsoft.Xna.Framework
text string Text of the label.
font Microsoft.Xna.Framework.Graphics.SpriteFont Font to use for this label.
foreColor Microsoft.Xna.Framework.Color Forecolor of this label.
return Microsoft.Xna.Framework

Property Details

Font public_oe property

The font to use for this label.
public SpriteFont,Microsoft.Xna.Framework.Graphics Font
return Microsoft.Xna.Framework.Graphics.SpriteFont

ForeColor public_oe property

Forecolor of this label (I.E: Text color).
public Color,Microsoft.Xna.Framework ForeColor
return Microsoft.Xna.Framework.Color

Text public_oe property

The label text.
public string Text
return string