C# Class TiaraFramework.Component.Shape

Show file Open project: TiaraGames/TiaraFramework

Public Methods

Method Description
GetDiamond ( Vector2 position, int width, int height, Color color, float depth, Microsoft.Xna.Framework.Game game ) : Sprite

返回一个菱形Sprite,旋转中心在中心

GetDiamond ( int width, int height, Color color, Microsoft.Xna.Framework.Game game ) : Microsoft.Xna.Framework.Graphics.Texture2D

返回一个菱形Texture2D

GetHollowRectangle ( Rectangle rect, Color color, int border, float depth, Microsoft.Xna.Framework.Game game ) : Sprite

返回一个空心矩形Sprite

GetHollowRectangle ( Vector2 position, int width, int height, int border, Color color, float depth, Microsoft.Xna.Framework.Game game ) : Sprite

返回一个空心矩形Sprite

GetHollowRectangle ( int width, int height, int border, Color color, Microsoft.Xna.Framework.Game game ) : Microsoft.Xna.Framework.Graphics.Texture2D

返回一个空心矩形Texture2D

GetLine ( Vector2 position, Vector2 vecLine, Color color, float depth, Microsoft.Xna.Framework.Game game ) : Sprite

返回1像素宽的直线Sprite, 旋转中心在左上角

GetLine ( Vector2 vecLine, Color color, Microsoft.Xna.Framework.Game game ) : Microsoft.Xna.Framework.Graphics.Texture2D

返回1像素宽的直线Texture2D

GetRectangle ( Rectangle rect, Color color, float depth, Microsoft.Xna.Framework.Game game ) : Sprite

返回一个实心矩形Sprite

GetRectangle ( Vector2 position, int width, int height, Color color, float depth, Microsoft.Xna.Framework.Game game ) : Sprite

返回一个实心矩形Sprite

GetRectangle ( int width, int height, Color color, Microsoft.Xna.Framework.Game game ) : Microsoft.Xna.Framework.Graphics.Texture2D

返回一个实心矩形Texture2D

GetRound ( Vector2 O, int R, Color color, float Depth, Microsoft.Xna.Framework.Game game ) : Sprite

返回一个实心圆Sprite,旋转中心在圆心。

GetRound ( int R, Color color, Microsoft.Xna.Framework.Game game ) : Microsoft.Xna.Framework.Graphics.Texture2D

返回一个实心圆Texture2D

Private Methods

Method Description
IndexToVector2 ( int i, int width ) : Vector2

字节位置转换为二维坐标,Y轴正方向朝下

Vector2ToIndex ( Vector2 pos, int width ) : int

二维坐标转换为字节位置,Y轴正方向朝下

Method Details

GetDiamond() public static method

返回一个菱形Sprite,旋转中心在中心
public static GetDiamond ( Vector2 position, int width, int height, Color color, float depth, Microsoft.Xna.Framework.Game game ) : Sprite
position Vector2
width int
height int
color Color
depth float
game Microsoft.Xna.Framework.Game
return Sprite

GetDiamond() public static method

返回一个菱形Texture2D
public static GetDiamond ( int width, int height, Color color, Microsoft.Xna.Framework.Game game ) : Microsoft.Xna.Framework.Graphics.Texture2D
width int
height int
color Color
game Microsoft.Xna.Framework.Game
return Microsoft.Xna.Framework.Graphics.Texture2D

GetHollowRectangle() public static method

返回一个空心矩形Sprite
public static GetHollowRectangle ( Rectangle rect, Color color, int border, float depth, Microsoft.Xna.Framework.Game game ) : Sprite
rect Microsoft.Xna.Framework.Rectangle
color Color
border int
depth float
game Microsoft.Xna.Framework.Game
return Sprite

GetHollowRectangle() public static method

返回一个空心矩形Sprite
public static GetHollowRectangle ( Vector2 position, int width, int height, int border, Color color, float depth, Microsoft.Xna.Framework.Game game ) : Sprite
position Vector2
width int
height int
border int
color Color
depth float
game Microsoft.Xna.Framework.Game
return Sprite

GetHollowRectangle() public static method

返回一个空心矩形Texture2D
public static GetHollowRectangle ( int width, int height, int border, Color color, Microsoft.Xna.Framework.Game game ) : Microsoft.Xna.Framework.Graphics.Texture2D
width int
height int
border int
color Color
game Microsoft.Xna.Framework.Game
return Microsoft.Xna.Framework.Graphics.Texture2D

GetLine() public static method

返回1像素宽的直线Sprite, 旋转中心在左上角
public static GetLine ( Vector2 position, Vector2 vecLine, Color color, float depth, Microsoft.Xna.Framework.Game game ) : Sprite
position Vector2
vecLine Vector2
color Color
depth float
game Microsoft.Xna.Framework.Game
return Sprite

GetLine() public static method

返回1像素宽的直线Texture2D
public static GetLine ( Vector2 vecLine, Color color, Microsoft.Xna.Framework.Game game ) : Microsoft.Xna.Framework.Graphics.Texture2D
vecLine Vector2
color Color
game Microsoft.Xna.Framework.Game
return Microsoft.Xna.Framework.Graphics.Texture2D

GetRectangle() public static method

返回一个实心矩形Sprite
public static GetRectangle ( Rectangle rect, Color color, float depth, Microsoft.Xna.Framework.Game game ) : Sprite
rect Microsoft.Xna.Framework.Rectangle
color Color
depth float
game Microsoft.Xna.Framework.Game
return Sprite

GetRectangle() public static method

返回一个实心矩形Sprite
public static GetRectangle ( Vector2 position, int width, int height, Color color, float depth, Microsoft.Xna.Framework.Game game ) : Sprite
position Vector2
width int
height int
color Color
depth float
game Microsoft.Xna.Framework.Game
return Sprite

GetRectangle() public static method

返回一个实心矩形Texture2D
public static GetRectangle ( int width, int height, Color color, Microsoft.Xna.Framework.Game game ) : Microsoft.Xna.Framework.Graphics.Texture2D
width int
height int
color Color
game Microsoft.Xna.Framework.Game
return Microsoft.Xna.Framework.Graphics.Texture2D

GetRound() public static method

返回一个实心圆Sprite,旋转中心在圆心。
public static GetRound ( Vector2 O, int R, Color color, float Depth, Microsoft.Xna.Framework.Game game ) : Sprite
O Vector2
R int
color Color
Depth float
game Microsoft.Xna.Framework.Game
return Sprite

GetRound() public static method

返回一个实心圆Texture2D
public static GetRound ( int R, Color color, Microsoft.Xna.Framework.Game game ) : Microsoft.Xna.Framework.Graphics.Texture2D
R int
color Color
game Microsoft.Xna.Framework.Game
return Microsoft.Xna.Framework.Graphics.Texture2D