C# Class XNATestBed.TextBox

Afficher le fichier Open project: ReticentJohn/Spring-Project-2011 Class Usage Examples

Méthodes publiques

Méthode Description
Draw ( SpriteBatch spriteBatch, bool hideOutOfBoundsText ) : void

Draw text and scroll buttons. Also specify if text out of the box's area should be hidden as soon as it touches an out of bounds area. (Leave false if you don't care about Y-area or you are already hiding the entire bounds with other images.)

LoadContent ( Microsoft.Xna.Framework.Content.ContentManager content, string fontChoice ) : void
TextBox ( Vector2 topLeftCorner, Vector2 bottomRightCorner, string heldText, Color textColor, int startingOffset ) : System

Create a text box to store a given string in its area, splitting it into separate lines if necessary.

Update ( ) : void

Check to see if scrolling buttons are clicked.

Private Methods

Méthode Description
FitTextToArea ( ) : void

Parse the full text string into multiple lines that fit inside the area. Not guaranteed to do so in a visually appealing way (yet); words may be chopped across new lines arbitrarily.

Method Details

Draw() public méthode

Draw text and scroll buttons. Also specify if text out of the box's area should be hidden as soon as it touches an out of bounds area. (Leave false if you don't care about Y-area or you are already hiding the entire bounds with other images.)
public Draw ( SpriteBatch spriteBatch, bool hideOutOfBoundsText ) : void
spriteBatch Microsoft.Xna.Framework.Graphics.SpriteBatch
hideOutOfBoundsText bool
Résultat void

LoadContent() public méthode

public LoadContent ( Microsoft.Xna.Framework.Content.ContentManager content, string fontChoice ) : void
content Microsoft.Xna.Framework.Content.ContentManager
fontChoice string
Résultat void

TextBox() public méthode

Create a text box to store a given string in its area, splitting it into separate lines if necessary.
public TextBox ( Vector2 topLeftCorner, Vector2 bottomRightCorner, string heldText, Color textColor, int startingOffset ) : System
topLeftCorner Vector2 The top left corner of the area this box will constrain text to.
bottomRightCorner Vector2 The bottom right corner of the area this box will constrain text to.
heldText string The full text to store in the box, which may or may not fit in its starting area by default.
textColor Color
startingOffset int How much the text should be scrolled initially.
Résultat System

Update() public méthode

Check to see if scrolling buttons are clicked.
public Update ( ) : void
Résultat void