C# Class XnaConsole.XnaConsoleComponent

This class creates a graphical text console for running code while executing a game.
Inheritance: Microsoft.Xna.Framework.DrawableGameComponent
Afficher le fichier Open project: WCell/WCell-Terrain Class Usage Examples

Méthodes publiques

Méthode Description
Chomp ( string str ) : string

Returns a string with one less character at the end

Clear ( ) : void

Clears the output.

ClearHistory ( ) : void

Clears the command history.

Draw ( GameTime gameTime ) : void

Draws the console

DrawCursor ( double now ) : string

Used to draw the cursor

IsOpen ( ) : bool

Is this console open?

Open ( ) : void

Opens the console

Prompt ( string str, InputHandler callback ) : void

Prompts for input asynchronously via callback

Render ( string output ) : List

Renders a list of strings to the console

Update ( GameTime gameTime ) : void

Updates

Write ( string str ) : void

Write to the console

WriteLine ( string str ) : void

Write a line to the console

XnaConsoleComponent ( Microsoft.Xna.Framework.Game game, SpriteFont font ) : System

Initializes a new instance of the class, which creates a console for executing commands while running a game.

Private Methods

Méthode Description
GetStringFromKeyState ( double elapsedTime ) : string

Takes keyboard input and returns certain characters as a string

IsKeyPressed ( Keys key ) : bool
KeyPressWithRepeat ( Keys key, double elapsedTime ) : bool
WrapLine ( string line, int columns ) : List

This takes a single string and splits it at the newlines and the specified number of columns

WrapLines ( string lines, int columns ) : List

This takes an array of strings and splits each of them every newline and specified number of columns

Method Details

Chomp() public méthode

Returns a string with one less character at the end
public Chomp ( string str ) : string
str string String to chomp
Résultat string

Clear() public méthode

Clears the output.
public Clear ( ) : void
Résultat void

ClearHistory() public méthode

Clears the command history.
public ClearHistory ( ) : void
Résultat void

Draw() public méthode

Draws the console
public Draw ( GameTime gameTime ) : void
gameTime Microsoft.Xna.Framework.GameTime gameTime
Résultat void

DrawCursor() public méthode

Used to draw the cursor
public DrawCursor ( double now ) : string
now double Current time
Résultat string

IsOpen() public méthode

Is this console open?
public IsOpen ( ) : bool
Résultat bool

Open() public méthode

Opens the console
public Open ( ) : void
Résultat void

Prompt() public méthode

Prompts for input asynchronously via callback
public Prompt ( string str, InputHandler callback ) : void
str string
callback InputHandler
Résultat void

Render() public méthode

Renders a list of strings to the console
public Render ( string output ) : List
output string String to render
Résultat List

Update() public méthode

Updates
public Update ( GameTime gameTime ) : void
gameTime Microsoft.Xna.Framework.GameTime Not Sure
Résultat void

Write() public méthode

Write to the console
public Write ( string str ) : void
str string
Résultat void

WriteLine() public méthode

Write a line to the console
public WriteLine ( string str ) : void
str string
Résultat void

XnaConsoleComponent() public méthode

Initializes a new instance of the class, which creates a console for executing commands while running a game.
public XnaConsoleComponent ( Microsoft.Xna.Framework.Game game, SpriteFont font ) : System
game Microsoft.Xna.Framework.Game
font Microsoft.Xna.Framework.Graphics.SpriteFont
Résultat System