C# 클래스 XnaConsole.XnaConsoleComponent

This class creates a graphical text console for running code while executing a game.
상속: Microsoft.Xna.Framework.DrawableGameComponent
파일 보기 프로젝트 열기: WCell/WCell-Terrain 1 사용 예제들

공개 메소드들

메소드 설명
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.

비공개 메소드들

메소드 설명
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

메소드 상세

Chomp() 공개 메소드

Returns a string with one less character at the end
public Chomp ( string str ) : string
str string String to chomp
리턴 string

Clear() 공개 메소드

Clears the output.
public Clear ( ) : void
리턴 void

ClearHistory() 공개 메소드

Clears the command history.
public ClearHistory ( ) : void
리턴 void

Draw() 공개 메소드

Draws the console
public Draw ( GameTime gameTime ) : void
gameTime Microsoft.Xna.Framework.GameTime gameTime
리턴 void

DrawCursor() 공개 메소드

Used to draw the cursor
public DrawCursor ( double now ) : string
now double Current time
리턴 string

IsOpen() 공개 메소드

Is this console open?
public IsOpen ( ) : bool
리턴 bool

Open() 공개 메소드

Opens the console
public Open ( ) : void
리턴 void

Prompt() 공개 메소드

Prompts for input asynchronously via callback
public Prompt ( string str, InputHandler callback ) : void
str string
callback InputHandler
리턴 void

Render() 공개 메소드

Renders a list of strings to the console
public Render ( string output ) : List
output string String to render
리턴 List

Update() 공개 메소드

Updates
public Update ( GameTime gameTime ) : void
gameTime Microsoft.Xna.Framework.GameTime Not Sure
리턴 void

Write() 공개 메소드

Write to the console
public Write ( string str ) : void
str string
리턴 void

WriteLine() 공개 메소드

Write a line to the console
public WriteLine ( string str ) : void
str string
리턴 void

XnaConsoleComponent() 공개 메소드

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
리턴 System