C# Class Sparrow.Textures.SubTexture

A SubTexture represents a section of another texture. This is achieved solely by manipulation of texture coordinates, making the class very efficient. Note that it is OK to create subtextures of subtextures.
Inheritance: Texture
ファイルを表示 Open project: fmotagarcia/sparrow-sharp Class Usage Examples

Public Methods

Method Description
AdjustPositions ( VertexData vertexData, uint startIndex, uint count ) : void
AdjustTexCoords ( VertexData vertexData, uint startIndex, uint count ) : void
AdjustVertexData ( VertexData vertexData, uint startIndex, uint count ) : void
SubTexture ( Texture texture, Rectangle region = null, Rectangle frame = null, bool rotated = false ) : System

Initializes a subtexture with a region (in points) of another texture, using a frame rectangle to place the texture within an image. If 'rotated' is 'true', the subtexture will show the base region rotated by 90 degrees (CCW). If frame is null, it will use the whole texture.

Protected Methods

Method Description
Init ( Texture texture, Rectangle region = null, Rectangle frame = null, bool rotated = false ) : void
SubTexture ( ) : System

Private Methods

Method Description
TransformVector2 ( Matrix matrix, System.Vector2 vector ) : System.Vector2

Method Details

AdjustPositions() public method

public AdjustPositions ( VertexData vertexData, uint startIndex, uint count ) : void
vertexData Sparrow.Utils.VertexData
startIndex uint
count uint
return void

AdjustTexCoords() public method

public AdjustTexCoords ( VertexData vertexData, uint startIndex, uint count ) : void
vertexData Sparrow.Utils.VertexData
startIndex uint
count uint
return void

AdjustVertexData() public method

public AdjustVertexData ( VertexData vertexData, uint startIndex, uint count ) : void
vertexData Sparrow.Utils.VertexData
startIndex uint
count uint
return void

Init() protected method

protected Init ( Texture texture, Rectangle region = null, Rectangle frame = null, bool rotated = false ) : void
texture Texture
region Sparrow.Geom.Rectangle
frame Sparrow.Geom.Rectangle
rotated bool
return void

SubTexture() protected method

protected SubTexture ( ) : System
return System

SubTexture() public method

Initializes a subtexture with a region (in points) of another texture, using a frame rectangle to place the texture within an image. If 'rotated' is 'true', the subtexture will show the base region rotated by 90 degrees (CCW). If frame is null, it will use the whole texture.
public SubTexture ( Texture texture, Rectangle region = null, Rectangle frame = null, bool rotated = false ) : System
texture Texture
region Sparrow.Geom.Rectangle
frame Sparrow.Geom.Rectangle
rotated bool
return System