C# Class Nez.MarkupText

MarkupText lets you set fonts, textures and conditionals and provide some XML text to render that uses them. You must first set the fonts, textures and conditionals before you can use them in your markup. Lorem Ipsum

Some more text with color in the middle

Images are inlined too

conditions can be negated as well isTrue isnt trueisTrue is true

]]>
Inheritance: RenderableComponent
Afficher le fichier Open project: prime31/Nez Class Usage Examples

Méthodes publiques

Méthode Description
MarkupText ( ) : System
MarkupText ( float textWidth ) : System
compile ( ) : void

compiles the current text to prepare it for rendering

render ( Graphics graphics, Camera camera ) : void

renders the MarkupText

setConditional ( string name, bool conditional ) : MarkupText

sets a conditional which can be used in an if tag with a condition attribute. It is also valid to negate the condition by prepending a ! to the name in the if tag

setFont ( string name, IFont font ) : MarkupText

sets a font that can be used in a text tag via the font attribute

setText ( string text ) : MarkupText

sets the text used for the run. Text should be valid XML.

setTextWidth ( float textWidth ) : MarkupText

sets the width that the run will fill

setTexture ( string name, Microsoft.Xna.Framework.Graphics.Texture2D texture ) : MarkupText

sets a texture which can be used in an img tag via the source attribute

Private Methods

Méthode Description
parseColor ( string hexString ) : Color
parseVector2 ( string vectorString ) : Vector2
wrapLine ( Vector2 position, List lineBuffer, HorizontalAlign alignment, float &currentLineHeight ) : Vector2

Method Details

MarkupText() public méthode

public MarkupText ( ) : System
Résultat System

MarkupText() public méthode

public MarkupText ( float textWidth ) : System
textWidth float
Résultat System

compile() public méthode

compiles the current text to prepare it for rendering
public compile ( ) : void
Résultat void

render() public méthode

renders the MarkupText
public render ( Graphics graphics, Camera camera ) : void
graphics Graphics Graphics.
camera Camera Camera.
Résultat void

setConditional() public méthode

sets a conditional which can be used in an if tag with a condition attribute. It is also valid to negate the condition by prepending a ! to the name in the if tag
public setConditional ( string name, bool conditional ) : MarkupText
name string Name.
conditional bool Conditional.
Résultat MarkupText

setFont() public méthode

sets a font that can be used in a text tag via the font attribute
public setFont ( string name, IFont font ) : MarkupText
name string Name.
font IFont Font.
Résultat MarkupText

setText() public méthode

sets the text used for the run. Text should be valid XML.
public setText ( string text ) : MarkupText
text string Text.
Résultat MarkupText

setTextWidth() public méthode

sets the width that the run will fill
public setTextWidth ( float textWidth ) : MarkupText
textWidth float Width.
Résultat MarkupText

setTexture() public méthode

sets a texture which can be used in an img tag via the source attribute
public setTexture ( string name, Microsoft.Xna.Framework.Graphics.Texture2D texture ) : MarkupText
name string Name.
texture Microsoft.Xna.Framework.Graphics.Texture2D Texture.
Résultat MarkupText