C# 클래스 SadConsole.Consoles.SurfaceEditor

파일 보기 프로젝트 열기: Thraka/SadConsole 1 사용 예제들

공개 프로퍼티들

프로퍼티 타입 설명
TimesShiftedDown int
TimesShiftedLeft int
TimesShiftedRight int
TimesShiftedUp int
UsePrintProcessor bool

보호된 프로퍼티들

프로퍼티 타입 설명
textSurface ITextSurface

Private Properties

프로퍼티 타입 설명
PrintNoCheck void

공개 메소드들

메소드 설명
Clear ( ) : void

Clears the console data. Characters are reset to 0, the forground and background are set to default, and effect set to none.

Clear ( int x, int y ) : void

Clears a cell. Character is reset to 0, the forground and background is set to default, and effect is set to none.

ClearShiftValues ( ) : void
Fill ( Microsoft.Xna.Framework.Color foreground, Microsoft.Xna.Framework.Color background, int glyph, Microsoft.Xna.Framework.Graphics.SpriteEffects spriteEffect = null ) : Cell[]

Fills the console.

Fill ( Microsoft.Xna.Framework.Rectangle area, Microsoft.Xna.Framework.Color foreground, Microsoft.Xna.Framework.Color background, int glyph, Microsoft.Xna.Framework.Graphics.SpriteEffects spriteEffect = null ) : Cell[]

Fills the specified area.

FillWithRandomGarbage ( bool useEffect = false ) : void

Fills a console with random colors and glyphs.

GetBackground ( int x, int y ) : Microsoft.Xna.Framework.Color

Gets the background of a specified cell.

GetCellAppearance ( int x, int y ) : ICellAppearance

Gets the appearance of a cell.

GetEffect ( int x, int y ) : Effects.ICellEffect

Gets the effect of the specified cell.

GetForeground ( int x, int y ) : Microsoft.Xna.Framework.Color

Gets the foreground of a specified cell.

GetGlyph ( int x, int y ) : int

Gets the glyph of a specified cell.

GetSpriteEffect ( int x, int y ) : Microsoft.Xna.Framework.Graphics.SpriteEffects

Gets the sprite effect of a specified cell.

GetString ( int index, int length ) : string

Builds a string from the text surface.

GetString ( int x, int y, int length ) : string

Builds a string from the text surface from the specified coordinates.

GetStringColored ( int index, int length ) : ColoredString

Builds a string from the text surface.

GetStringColored ( int x, int y, int length ) : ColoredString

Builds a string from the text surface from the specified coordinates.

IsValidCell ( int index ) : bool

Tests if a cell is valid based on its index.

IsValidCell ( int x, int y ) : bool

Tests if a cell is valid based on its x,y position.

IsValidCell ( int x, int y, int &index ) : bool

Tests if a cell is valid based on its x,y position.

Print ( int x, int y, ColoredString text ) : void

Draws the string on the console at the specified location, wrapping if needed.

Print ( int x, int y, string text ) : void

Draws the string on the console at the specified location, wrapping if needed.

Print ( int x, int y, string text, ICellAppearance appearance, ICellEffect effect = null ) : void

Draws the string on the console at the specified location, wrapping if needed.

Print ( int x, int y, string text, Microsoft.Xna.Framework.Color foreground ) : void

Draws the string on the console at the specified location and color, wrapping if needed.

Print ( int x, int y, string text, Microsoft.Xna.Framework.Color foreground, Microsoft.Xna.Framework.Color background ) : void

Draws the string on the console at the specified location with the specified foreground and background color, wrapping if needed.

Print ( int x, int y, string text, Microsoft.Xna.Framework.Color foreground = null, Microsoft.Xna.Framework.Color background = null, Microsoft.Xna.Framework.Graphics.SpriteEffects spriteEffect = null ) : void

Draws the string on the console at the specified location with the specified settings.

SetBackground ( int x, int y, Microsoft.Xna.Framework.Color color ) : void

Changes the background of a cell to the specified color.

SetCellAppearance ( int x, int y, ICellAppearance appearance ) : void

Changes the appearance of the cell. The appearance represents the look of a cell and will first be cloned, then applied to the cell.

SetEffect ( IEnumerable cells, Effects effect ) : void

Changes the effect of a list of cells to the specified effect.

SetEffect ( int index, ICellEffect effect ) : void

Changes the effect of a cell to the specified effect.

SetEffect ( int x, int y, Effects effect ) : void

Changes the effect of a cell to the specified effect.

SetForeground ( int x, int y, Microsoft.Xna.Framework.Color color ) : void

Changes the foreground of a specified cell to a new color.

SetGlyph ( int x, int y, int glyph ) : void

Changes the glyph of a specified cell to a new value.

SetGlyph ( int x, int y, int glyph, Microsoft.Xna.Framework.Color foreground ) : void

Changes the glyph, foreground, and background of a cell.

SetGlyph ( int x, int y, int glyph, Microsoft.Xna.Framework.Color foreground, Microsoft.Xna.Framework.Color background ) : void

Changes the glyph, foreground, and background of a cell.

SetGlyph ( int x, int y, int glyph, Microsoft.Xna.Framework.Color foreground, Microsoft.Xna.Framework.Color background, ICellEffect effect ) : void

Changes the glyph, foreground, background, and effect of a cell.

SetPixels ( Microsoft.Xna.Framework.Color pixels ) : void

Sets each background of a cell to the array of colors. Must be the same length as this cell surface.

SetSpriteEffect ( int x, int y, Microsoft.Xna.Framework.Graphics.SpriteEffects spriteEffect ) : void

Sets the sprite effect of a specified cell.

ShiftDown ( ) : void

Scrolls all the console data down by one.

ShiftDown ( int amount, bool wrap = false ) : void

Scrolls all the console data down by the specified amount of rows.

ShiftLeft ( ) : void

Scrolls all the console data left by one.

ShiftLeft ( int amount, bool wrap = false ) : void

Scrolls all the console data left by the specified amount.

ShiftRight ( ) : void

Scrolls all the console data right by one.

ShiftRight ( int amount, bool wrap = false ) : void

Scrolls all the console data right by the specified amount.

ShiftUp ( ) : void

Scrolls all the console data up by one.

ShiftUp ( int amount, bool wrap = false ) : void

Scrolls all the console data up by the specified amount of rows.

SurfaceEditor ( ITextSurface surface ) : System

Creates a new cell surface that can be resized and also have its textSurface.Cells resized.

You must set the Font property before rendering this cell surface.

this ( int index ) : Cell

Gets a cell by index.

this ( int x, int y ) : Cell

Gets a cell based on it's coordinates on the surface.

보호된 메소드들

메소드 설명
OnSurfaceChanged ( ITextSurface oldSurface, ITextSurface newSurface ) : void

Called when the TextSurface property is changed. Sets Effects to a new instance of EffectsManager.

비공개 메소드들

메소드 설명
PrintNoCheck ( int index, ColoredString text ) : void

메소드 상세

Clear() 공개 메소드

Clears the console data. Characters are reset to 0, the forground and background are set to default, and effect set to none.
public Clear ( ) : void
리턴 void

Clear() 공개 메소드

Clears a cell. Character is reset to 0, the forground and background is set to default, and effect is set to none.
public Clear ( int x, int y ) : void
x int The x location of the cell.
y int The y location of the cell.
리턴 void

ClearShiftValues() 공개 메소드

public ClearShiftValues ( ) : void
리턴 void

Fill() 공개 메소드

Fills the console.
public Fill ( Microsoft.Xna.Framework.Color foreground, Microsoft.Xna.Framework.Color background, int glyph, Microsoft.Xna.Framework.Graphics.SpriteEffects spriteEffect = null ) : Cell[]
foreground Microsoft.Xna.Framework.Color Foregorund of every cell. If null, skips.
background Microsoft.Xna.Framework.Color Foregorund of every cell. If null, skips.
glyph int Glyph of every cell. If null, skips.
spriteEffect Microsoft.Xna.Framework.Graphics.SpriteEffects Sprite effect of every cell. If null, skips.
리턴 Cell[]

Fill() 공개 메소드

Fills the specified area.
public Fill ( Microsoft.Xna.Framework.Rectangle area, Microsoft.Xna.Framework.Color foreground, Microsoft.Xna.Framework.Color background, int glyph, Microsoft.Xna.Framework.Graphics.SpriteEffects spriteEffect = null ) : Cell[]
area Microsoft.Xna.Framework.Rectangle The area to fill.
foreground Microsoft.Xna.Framework.Color Foregorund of every cell. If null, skips.
background Microsoft.Xna.Framework.Color Foregorund of every cell. If null, skips.
glyph int Glyph of every cell. If null, skips.
spriteEffect Microsoft.Xna.Framework.Graphics.SpriteEffects Sprite effect of every cell. If null, skips.
리턴 Cell[]

FillWithRandomGarbage() 공개 메소드

Fills a console with random colors and glyphs.
public FillWithRandomGarbage ( bool useEffect = false ) : void
useEffect bool
리턴 void

GetBackground() 공개 메소드

Gets the background of a specified cell.
public GetBackground ( int x, int y ) : Microsoft.Xna.Framework.Color
x int The x location of the cell.
y int The y location of the cell.
리턴 Microsoft.Xna.Framework.Color

GetCellAppearance() 공개 메소드

Gets the appearance of a cell.
public GetCellAppearance ( int x, int y ) : ICellAppearance
x int The x location of the cell.
y int The y location of the cell.
리턴 ICellAppearance

GetEffect() 공개 메소드

Gets the effect of the specified cell.
public GetEffect ( int x, int y ) : Effects.ICellEffect
x int The x location of the cell.
y int The y location of the cell.
리턴 Effects.ICellEffect

GetForeground() 공개 메소드

Gets the foreground of a specified cell.
public GetForeground ( int x, int y ) : Microsoft.Xna.Framework.Color
x int The x location of the cell.
y int The y location of the cell.
리턴 Microsoft.Xna.Framework.Color

GetGlyph() 공개 메소드

Gets the glyph of a specified cell.
public GetGlyph ( int x, int y ) : int
x int The x location of the cell.
y int The y location of the cell.
리턴 int

GetSpriteEffect() 공개 메소드

Gets the sprite effect of a specified cell.
public GetSpriteEffect ( int x, int y ) : Microsoft.Xna.Framework.Graphics.SpriteEffects
x int The x location of the cell.
y int The y location of the cell.
리턴 Microsoft.Xna.Framework.Graphics.SpriteEffects

GetString() 공개 메소드

Builds a string from the text surface.
public GetString ( int index, int length ) : string
index int Where to start getting characters from.
length int How many characters to fill the string with.
리턴 string

GetString() 공개 메소드

Builds a string from the text surface from the specified coordinates.
public GetString ( int x, int y, int length ) : string
x int The x position of the surface to start at.
y int The y position of the surface to start at.
length int How many characters to fill the string with.
리턴 string

GetStringColored() 공개 메소드

Builds a string from the text surface.
public GetStringColored ( int index, int length ) : ColoredString
index int Where to start getting characters from.
length int How many characters to fill the string with.
리턴 ColoredString

GetStringColored() 공개 메소드

Builds a string from the text surface from the specified coordinates.
public GetStringColored ( int x, int y, int length ) : ColoredString
x int The x position of the surface to start at.
y int The y position of the surface to start at.
length int How many characters to fill the string with.
리턴 ColoredString

IsValidCell() 공개 메소드

Tests if a cell is valid based on its index.
public IsValidCell ( int index ) : bool
index int The index to test.
리턴 bool

IsValidCell() 공개 메소드

Tests if a cell is valid based on its x,y position.
public IsValidCell ( int x, int y ) : bool
x int The x coordinate of the cell to test.
y int The y coordinate of the cell to test.
리턴 bool

IsValidCell() 공개 메소드

Tests if a cell is valid based on its x,y position.
public IsValidCell ( int x, int y, int &index ) : bool
x int The x coordinate of the cell to test.
y int The y coordinate of the cell to test.
index int If the cell is valid, the index of the cell when found.
리턴 bool

OnSurfaceChanged() 보호된 메소드

Called when the TextSurface property is changed. Sets Effects to a new instance of EffectsManager.
protected OnSurfaceChanged ( ITextSurface oldSurface, ITextSurface newSurface ) : void
oldSurface ITextSurface The previous text surface.
newSurface ITextSurface The new text surface.
리턴 void

Print() 공개 메소드

Draws the string on the console at the specified location, wrapping if needed.
public Print ( int x, int y, ColoredString text ) : void
x int X location of the text.
y int Y location of the text.
text ColoredString The string to display.
리턴 void

Print() 공개 메소드

Draws the string on the console at the specified location, wrapping if needed.
public Print ( int x, int y, string text ) : void
x int X location of the text.
y int Y location of the text.
text string The string to display.
리턴 void

Print() 공개 메소드

Draws the string on the console at the specified location, wrapping if needed.
public Print ( int x, int y, string text, ICellAppearance appearance, ICellEffect effect = null ) : void
x int X location of the text.
y int Y location of the text.
text string The string to display.
appearance ICellAppearance The appearance of the cell
effect ICellEffect An optional effect to apply to the printed cells.
리턴 void

Print() 공개 메소드

Draws the string on the console at the specified location and color, wrapping if needed.
public Print ( int x, int y, string text, Microsoft.Xna.Framework.Color foreground ) : void
x int X location of the text.
y int Y location of the text.
text string The string to display.
foreground Microsoft.Xna.Framework.Color Sets the foreground of all characters in the text.
리턴 void

Print() 공개 메소드

Draws the string on the console at the specified location with the specified foreground and background color, wrapping if needed.
public Print ( int x, int y, string text, Microsoft.Xna.Framework.Color foreground, Microsoft.Xna.Framework.Color background ) : void
x int X location of the text.
y int Y location of the text.
text string The string to display.
foreground Microsoft.Xna.Framework.Color Sets the foreground of all characters in the text.
background Microsoft.Xna.Framework.Color Sets the background of all characters in the text.
리턴 void

Print() 공개 메소드

Draws the string on the console at the specified location with the specified settings.
public Print ( int x, int y, string text, Microsoft.Xna.Framework.Color foreground = null, Microsoft.Xna.Framework.Color background = null, Microsoft.Xna.Framework.Graphics.SpriteEffects spriteEffect = null ) : void
x int X location of the text.
y int Y location of the text.
text string The string to display.
foreground Microsoft.Xna.Framework.Color Sets the foreground of all characters in the text.
background Microsoft.Xna.Framework.Color Sets the background of all characters in the text.
spriteEffect Microsoft.Xna.Framework.Graphics.SpriteEffects The sprite effect to set on the cell.
리턴 void

SetBackground() 공개 메소드

Changes the background of a cell to the specified color.
public SetBackground ( int x, int y, Microsoft.Xna.Framework.Color color ) : void
x int The x location of the cell.
y int The y location of the cell.
color Microsoft.Xna.Framework.Color The desired color of the cell.
리턴 void

SetCellAppearance() 공개 메소드

Changes the appearance of the cell. The appearance represents the look of a cell and will first be cloned, then applied to the cell.
public SetCellAppearance ( int x, int y, ICellAppearance appearance ) : void
x int The x location of the cell.
y int The y location of the cell.
appearance ICellAppearance The desired appearance of the cell. A null value cannot be passed.
리턴 void

SetEffect() 공개 메소드

Changes the effect of a list of cells to the specified effect.
public SetEffect ( IEnumerable cells, Effects effect ) : void
cells IEnumerable The cells for the effect.
effect Effects The desired effect.
리턴 void

SetEffect() 공개 메소드

Changes the effect of a cell to the specified effect.
public SetEffect ( int index, ICellEffect effect ) : void
index int Index of the cell.
effect ICellEffect The desired effect.
리턴 void

SetEffect() 공개 메소드

Changes the effect of a cell to the specified effect.
public SetEffect ( int x, int y, Effects effect ) : void
x int The x location of the cell.
y int The y location of the cell.
effect Effects The desired effect.
리턴 void

SetForeground() 공개 메소드

Changes the foreground of a specified cell to a new color.
public SetForeground ( int x, int y, Microsoft.Xna.Framework.Color color ) : void
x int The x location of the cell.
y int The y location of the cell.
color Microsoft.Xna.Framework.Color The desired color of the cell.
리턴 void

SetGlyph() 공개 메소드

Changes the glyph of a specified cell to a new value.
public SetGlyph ( int x, int y, int glyph ) : void
x int The x location of the cell.
y int The y location of the cell.
glyph int The desired glyph of the cell.
리턴 void

SetGlyph() 공개 메소드

Changes the glyph, foreground, and background of a cell.
public SetGlyph ( int x, int y, int glyph, Microsoft.Xna.Framework.Color foreground ) : void
x int The x location of the cell.
y int The y location of the cell.
glyph int The desired glyph.
foreground Microsoft.Xna.Framework.Color The desired foreground.
리턴 void

SetGlyph() 공개 메소드

Changes the glyph, foreground, and background of a cell.
public SetGlyph ( int x, int y, int glyph, Microsoft.Xna.Framework.Color foreground, Microsoft.Xna.Framework.Color background ) : void
x int The x location of the cell.
y int The y location of the cell.
glyph int The desired glyph.
foreground Microsoft.Xna.Framework.Color The desired foreground.
background Microsoft.Xna.Framework.Color The desired background.
리턴 void

SetGlyph() 공개 메소드

Changes the glyph, foreground, background, and effect of a cell.
public SetGlyph ( int x, int y, int glyph, Microsoft.Xna.Framework.Color foreground, Microsoft.Xna.Framework.Color background, ICellEffect effect ) : void
x int The x location of the cell.
y int The y location of the cell.
glyph int The desired glyph.
foreground Microsoft.Xna.Framework.Color The desired foreground.
background Microsoft.Xna.Framework.Color The desired background.
effect ICellEffect Sets the effect of the cell
리턴 void

SetPixels() 공개 메소드

Sets each background of a cell to the array of colors. Must be the same length as this cell surface.
public SetPixels ( Microsoft.Xna.Framework.Color pixels ) : void
pixels Microsoft.Xna.Framework.Color The colors to place.
리턴 void

SetSpriteEffect() 공개 메소드

Sets the sprite effect of a specified cell.
public SetSpriteEffect ( int x, int y, Microsoft.Xna.Framework.Graphics.SpriteEffects spriteEffect ) : void
x int The x location of the cell.
y int The y location of the cell.
spriteEffect Microsoft.Xna.Framework.Graphics.SpriteEffects The sprite effect of the cell.
리턴 void

ShiftDown() 공개 메소드

Scrolls all the console data down by one.
public ShiftDown ( ) : void
리턴 void

ShiftDown() 공개 메소드

Scrolls all the console data down by the specified amount of rows.
public ShiftDown ( int amount, bool wrap = false ) : void
amount int How many rows to shift.
wrap bool
리턴 void

ShiftLeft() 공개 메소드

Scrolls all the console data left by one.
public ShiftLeft ( ) : void
리턴 void

ShiftLeft() 공개 메소드

Scrolls all the console data left by the specified amount.
public ShiftLeft ( int amount, bool wrap = false ) : void
amount int How much to scroll.
wrap bool
리턴 void

ShiftRight() 공개 메소드

Scrolls all the console data right by one.
public ShiftRight ( ) : void
리턴 void

ShiftRight() 공개 메소드

Scrolls all the console data right by the specified amount.
public ShiftRight ( int amount, bool wrap = false ) : void
amount int How much to scroll.
wrap bool
리턴 void

ShiftUp() 공개 메소드

Scrolls all the console data up by one.
public ShiftUp ( ) : void
리턴 void

ShiftUp() 공개 메소드

Scrolls all the console data up by the specified amount of rows.
public ShiftUp ( int amount, bool wrap = false ) : void
amount int How many rows to shift.
wrap bool
리턴 void

SurfaceEditor() 공개 메소드

Creates a new cell surface that can be resized and also have its textSurface.Cells resized.
You must set the Font property before rendering this cell surface.
public SurfaceEditor ( ITextSurface surface ) : System
surface ITextSurface
리턴 System

this() 공개 메소드

Gets a cell by index.
public this ( int index ) : Cell
index int The index of the cell.
리턴 Cell

this() 공개 메소드

Gets a cell based on it's coordinates on the surface.
public this ( int x, int y ) : Cell
x int The X coordinate.
y int The Y coordinate.
리턴 Cell

프로퍼티 상세

TimesShiftedDown 공개적으로 프로퍼티

public int TimesShiftedDown
리턴 int

TimesShiftedLeft 공개적으로 프로퍼티

public int TimesShiftedLeft
리턴 int

TimesShiftedRight 공개적으로 프로퍼티

public int TimesShiftedRight
리턴 int

TimesShiftedUp 공개적으로 프로퍼티

public int TimesShiftedUp
리턴 int

UsePrintProcessor 공개적으로 프로퍼티

When true, the ColoredString.Parse(string, int, ITextSurface, ParseCommandStacks) command is used to print strings.
public bool UsePrintProcessor
리턴 bool

textSurface 보호되어 있는 프로퍼티

protected ITextSurface textSurface
리턴 ITextSurface