C# Class Nez.NezSpriteFont

Inheritance: IFont
Show file Open project: prime31/Nez Class Usage Examples

Public Methods

Method Description
IFont ( Batcher batcher, StringBuilder text, Vector2 position, Color color, float rotation, Vector2 origin, Vector2 scale, SpriteEffects effect, float depth ) : void
IFont ( Batcher batcher, string text, Vector2 position, Color color, float rotation, Vector2 origin, Vector2 scale, SpriteEffects effect, float depth ) : void
NezSpriteFont ( SpriteFont font ) : System
drawInto ( Batcher batcher, FontCharacterSource &text, Vector2 position, Color color, float rotation, Vector2 origin, Vector2 scale, SpriteEffects effect, float depth ) : void
hasCharacter ( char c ) : bool

checks to see if a BitmapFontRegion exists for the char

measureString ( StringBuilder text ) : Vector2

Returns the size of the contents of a StringBuilder when rendered in this font.

measureString ( string text ) : Vector2

Returns the size of a string when rendered in this font.

measureString ( FontCharacterSource &text, Vector2 &size ) : void
tryGetFontRegionForChar ( char c, SpriteFont &fontGlyph, bool useDefaultRegionIfNotPresent = false ) : bool

gets the BitmapFontRegion for the given char optionally substituting the default region if it isnt present.

Method Details

IFont() public method

public IFont ( Batcher batcher, StringBuilder text, Vector2 position, Color color, float rotation, Vector2 origin, Vector2 scale, SpriteEffects effect, float depth ) : void
batcher Batcher
text StringBuilder
position Vector2
color Color
rotation float
origin Vector2
scale Vector2
effect SpriteEffects
depth float
return void

IFont() public method

public IFont ( Batcher batcher, string text, Vector2 position, Color color, float rotation, Vector2 origin, Vector2 scale, SpriteEffects effect, float depth ) : void
batcher Batcher
text string
position Vector2
color Color
rotation float
origin Vector2
scale Vector2
effect SpriteEffects
depth float
return void

NezSpriteFont() public method

public NezSpriteFont ( SpriteFont font ) : System
font Microsoft.Xna.Framework.Graphics.SpriteFont
return System

drawInto() public method

public drawInto ( Batcher batcher, FontCharacterSource &text, Vector2 position, Color color, float rotation, Vector2 origin, Vector2 scale, SpriteEffects effect, float depth ) : void
batcher Batcher
text FontCharacterSource
position Vector2
color Color
rotation float
origin Vector2
scale Vector2
effect SpriteEffects
depth float
return void

hasCharacter() public method

checks to see if a BitmapFontRegion exists for the char
public hasCharacter ( char c ) : bool
c char C.
return bool

measureString() public method

Returns the size of the contents of a StringBuilder when rendered in this font.
public measureString ( StringBuilder text ) : Vector2
text StringBuilder The text to measure.
return Vector2

measureString() public method

Returns the size of a string when rendered in this font.
public measureString ( string text ) : Vector2
text string The text to measure.
return Vector2

measureString() public method

public measureString ( FontCharacterSource &text, Vector2 &size ) : void
text FontCharacterSource
size Vector2
return void

tryGetFontRegionForChar() public method

gets the BitmapFontRegion for the given char optionally substituting the default region if it isnt present.
public tryGetFontRegionForChar ( char c, SpriteFont &fontGlyph, bool useDefaultRegionIfNotPresent = false ) : bool
c char C.
fontGlyph Microsoft.Xna.Framework.Graphics.SpriteFont
useDefaultRegionIfNotPresent bool If set to true use default region if not present.
return bool