C# 클래스 Nez.Textures.Subtexture

represents a single element in a texture atlas consisting of a texture and the source rectangle for the frame
파일 보기 프로젝트 열기: prime31/Nez 1 사용 예제들

공개 프로퍼티들

프로퍼티 타입 설명
center Vector2
origin Vector2
sourceRect Microsoft.Xna.Framework.Rectangle
texture2D Microsoft.Xna.Framework.Graphics.Texture2D

공개 메소드들

메소드 설명
Subtexture ( Microsoft.Xna.Framework.Graphics.Texture2D texture ) : Microsoft.Xna.Framework
Subtexture ( Microsoft.Xna.Framework.Graphics.Texture2D texture, Rectangle sourceRect ) : Microsoft.Xna.Framework
Subtexture ( Microsoft.Xna.Framework.Graphics.Texture2D texture, Rectangle sourceRect, Vector2 origin ) : Microsoft.Xna.Framework
Subtexture ( Microsoft.Xna.Framework.Graphics.Texture2D texture, float x, float y, float width, float height ) : Microsoft.Xna.Framework

convenience constructor that casts floats to ints for the sourceRect

Subtexture ( Microsoft.Xna.Framework.Graphics.Texture2D texture, int x, int y, int width, int height ) : Microsoft.Xna.Framework
ToString ( ) : string
clone ( ) : Subtexture

clones the Subtexture

generateNinePatchRects ( Rectangle renderRect, Rectangle destArray, int marginLeft, int marginRight, int marginTop, int marginBottom ) : void

generates nine patch Rectangles. destArray should have 9 elements. renderRect is the final area in which the nine patch will be rendered. To just get the source rects for rendering pass in the Subtexture.sourceRect. Pass in a larger Rectangle to get final destination rendering Rectangles.

subtexturesFromAtlas ( Microsoft.Xna.Framework.Graphics.Texture2D texture, int cellWidth, int cellHeight, int cellOffset, int maxCellsToInclude = int.MaxValue ) : List

provides a List of subtextures given an atlas with equally spaced rows/columns of sprites

메소드 상세

Subtexture() 공개 메소드

public Subtexture ( Microsoft.Xna.Framework.Graphics.Texture2D texture ) : Microsoft.Xna.Framework
texture Microsoft.Xna.Framework.Graphics.Texture2D
리턴 Microsoft.Xna.Framework

Subtexture() 공개 메소드

public Subtexture ( Microsoft.Xna.Framework.Graphics.Texture2D texture, Rectangle sourceRect ) : Microsoft.Xna.Framework
texture Microsoft.Xna.Framework.Graphics.Texture2D
sourceRect Microsoft.Xna.Framework.Rectangle
리턴 Microsoft.Xna.Framework

Subtexture() 공개 메소드

public Subtexture ( Microsoft.Xna.Framework.Graphics.Texture2D texture, Rectangle sourceRect, Vector2 origin ) : Microsoft.Xna.Framework
texture Microsoft.Xna.Framework.Graphics.Texture2D
sourceRect Microsoft.Xna.Framework.Rectangle
origin Vector2
리턴 Microsoft.Xna.Framework

Subtexture() 공개 메소드

convenience constructor that casts floats to ints for the sourceRect
public Subtexture ( Microsoft.Xna.Framework.Graphics.Texture2D texture, float x, float y, float width, float height ) : Microsoft.Xna.Framework
texture Microsoft.Xna.Framework.Graphics.Texture2D Texture.
x float The x coordinate.
y float The y coordinate.
width float Width.
height float Height.
리턴 Microsoft.Xna.Framework

Subtexture() 공개 메소드

public Subtexture ( Microsoft.Xna.Framework.Graphics.Texture2D texture, int x, int y, int width, int height ) : Microsoft.Xna.Framework
texture Microsoft.Xna.Framework.Graphics.Texture2D
x int
y int
width int
height int
리턴 Microsoft.Xna.Framework

ToString() 공개 메소드

public ToString ( ) : string
리턴 string

clone() 공개 메소드

clones the Subtexture
public clone ( ) : Subtexture
리턴 Subtexture

generateNinePatchRects() 공개 메소드

generates nine patch Rectangles. destArray should have 9 elements. renderRect is the final area in which the nine patch will be rendered. To just get the source rects for rendering pass in the Subtexture.sourceRect. Pass in a larger Rectangle to get final destination rendering Rectangles.
public generateNinePatchRects ( Rectangle renderRect, Rectangle destArray, int marginLeft, int marginRight, int marginTop, int marginBottom ) : void
renderRect Microsoft.Xna.Framework.Rectangle Render rect.
destArray Microsoft.Xna.Framework.Rectangle Destination array.
marginLeft int Margin left.
marginRight int Margin right.
marginTop int Margin top.
marginBottom int Margin bottom.
리턴 void

subtexturesFromAtlas() 공개 정적인 메소드

provides a List of subtextures given an atlas with equally spaced rows/columns of sprites
public static subtexturesFromAtlas ( Microsoft.Xna.Framework.Graphics.Texture2D texture, int cellWidth, int cellHeight, int cellOffset, int maxCellsToInclude = int.MaxValue ) : List
texture Microsoft.Xna.Framework.Graphics.Texture2D Texture.
cellWidth int Cell width.
cellHeight int Cell height.
cellOffset int the first cell to include while processing. 0 based indexing.
maxCellsToInclude int Max cells to included.
리턴 List

프로퍼티 상세

center 공개적으로 프로퍼티

center of the sourceRect if it had a 0,0 origin. This is basically the center in sourceRect-space.
public Vector2 center
리턴 Vector2

origin 공개적으로 프로퍼티

the origin that a RenderableComponent should use when using this Subtexture. Defaults to the center.
public Vector2 origin
리턴 Vector2

sourceRect 공개적으로 프로퍼티

rectangle in the Texture2D for this element
public Rectangle,Microsoft.Xna.Framework sourceRect
리턴 Microsoft.Xna.Framework.Rectangle

texture2D 공개적으로 프로퍼티

the actual Texture2D
public Texture2D,Microsoft.Xna.Framework.Graphics texture2D
리턴 Microsoft.Xna.Framework.Graphics.Texture2D