C# Класс XNATestBed.TextBox

Показать файл Открыть проект Примеры использования класса

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

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

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

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

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

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

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

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

public LoadContent ( Microsoft.Xna.Framework.Content.ContentManager content, string fontChoice ) : void
content Microsoft.Xna.Framework.Content.ContentManager
fontChoice string
Результат void

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

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

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

Check to see if scrolling buttons are clicked.
public Update ( ) : void
Результат void