C# Класс 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

]]>
Наследование: RenderableComponent
Показать файл Открыть проект Примеры использования класса

Открытые методы

Метод Описание
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

Приватные методы

Метод Описание
parseColor ( string hexString ) : Color
parseVector2 ( string vectorString ) : Vector2
wrapLine ( Vector2 position, List lineBuffer, HorizontalAlign alignment, float &currentLineHeight ) : Vector2

Описание методов

MarkupText() публичный Метод

public MarkupText ( ) : System
Результат System

MarkupText() публичный Метод

public MarkupText ( float textWidth ) : System
textWidth float
Результат System

compile() публичный Метод

compiles the current text to prepare it for rendering
public compile ( ) : void
Результат void

render() публичный Метод

renders the MarkupText
public render ( Graphics graphics, Camera camera ) : void
graphics Graphics Graphics.
camera Camera Camera.
Результат void

setConditional() публичный Метод

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.
Результат MarkupText

setFont() публичный Метод

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.
Результат MarkupText

setText() публичный Метод

sets the text used for the run. Text should be valid XML.
public setText ( string text ) : MarkupText
text string Text.
Результат MarkupText

setTextWidth() публичный Метод

sets the width that the run will fill
public setTextWidth ( float textWidth ) : MarkupText
textWidth float Width.
Результат MarkupText

setTexture() публичный Метод

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.
Результат MarkupText