C# Class Microsoft.Xna.Framework.PointExtensions

ファイルを表示 Open project: Thraka/SadConsole

Public Methods

Method Description
ConsoleLocationToWorld ( this point, int cellWidth, int cellHeight ) : Point

Translates a console cell position to where it appears on the screen in pixels.

ToIndex ( this point, int rowWidth ) : int

Translates an x,y position to an array index.

ToPositionMatrix ( this position, Point cellSize, bool absolutePositioning ) : Matrix

Creates a position matrix (in pixels) based on the position of a cell.

TranslateFont ( this point, Font sourceFont, Font targetFont ) : Point

Gets the cell coordinates of the targetFont based on a cell in the sourceFont.

WorldLocationToConsole ( this point, int cellWidth, int cellHeight ) : Point

Translates a pixel to where it appears on a console cell.

Method Details

ConsoleLocationToWorld() public static method

Translates a console cell position to where it appears on the screen in pixels.
public static ConsoleLocationToWorld ( this point, int cellWidth, int cellHeight ) : Point
point this The current cell position.
cellWidth int The width of a cell in pixels.
cellHeight int The height of a cell in pixels.
return Point

ToIndex() public static method

Translates an x,y position to an array index.
public static ToIndex ( this point, int rowWidth ) : int
point this The position.
rowWidth int How many columns in a row.
return int

ToPositionMatrix() public static method

Creates a position matrix (in pixels) based on the position of a cell.
public static ToPositionMatrix ( this position, Point cellSize, bool absolutePositioning ) : Matrix
position this The cell position.
cellSize Point The size of the cell in pixels.
absolutePositioning bool When true, indicates that the indicates pixels, not cell coordinates.
return Matrix

TranslateFont() public static method

Gets the cell coordinates of the targetFont based on a cell in the sourceFont.
public static TranslateFont ( this point, Font sourceFont, Font targetFont ) : Point
point this The position of the cell in the .
sourceFont SadConsole.Font The source font translating from.
targetFont SadConsole.Font The target font translating to.
return Point

WorldLocationToConsole() public static method

Translates a pixel to where it appears on a console cell.
public static WorldLocationToConsole ( this point, int cellWidth, int cellHeight ) : Point
point this The current world position.
cellWidth int The width of a cell in pixels.
cellHeight int The height of a cell in pixels.
return Point