C# Class Rome.TextBox

Mostra file Open project: ReticentJohn/Spring-Project-2011

Public Methods

Method 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

Method 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 method

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
return void

LoadContent() public method

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

TextBox() public method

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.
return System

Update() public method

Check to see if scrolling buttons are clicked.
public Update ( ) : void
return void