C# Class Fusion.Engine.Graphics.SpriteLayer

Inheritance: System.DisposableBase
Mostra file Open project: demiurghg/FusionEngine Class Usage Examples

Public Methods

Method Description
Clear ( ) : void

Clears all sprites.

Draw ( Texture texture, Rectangle dstRect, Color color, int clipRectIndex ) : void

Adds a sprite to a batch of sprites for rendering using the specified texture, destination rectangle, and color.

Draw ( Texture texture, Rectangle dstRect, Rectangle srcRect, Color color, int clipRectIndex ) : void

Draw ( Texture texture, Rectangle dstRect, Rectangle srcRect, int offsetX, int offsetY, Color color, int clipRectIndex ) : void

Draw ( Texture texture, RectangleF dstRect, Color color, int clipRectIndex ) : void

Adds a sprite to a batch of sprites for rendering using the specified texture, destination rectangle, and color.

Draw ( Texture texture, RectangleF dstRect, RectangleF srcRect, Color color, int clipRectIndex ) : void

Adds a sprite to a batch of sprites for rendering using the specified texture, destination rectangle, source rectangle, and color.

Draw ( Texture srv, float x, float y, float w, float h, Color color, int clipRectIndex ) : void

Draw axis-aligned quad with stretched texture.

DrawBeam ( Texture srv, Vector2 p0, Vector2 p1, Color color0, Color color1, float width, float scale = 1, float offset, int clipRectIndex ) : void

Draws beam.

DrawDebugString ( Texture fontTexture, float x, float y, string text, Color color, float scale, int clipRectIndex ) : void

Draw string using specified font texture, position, text and color. Font texture should contain character glyphs arranged in grid 16x16. Only ASCII is supported.

DrawDebugString ( Texture fontTexture, float x, float y, string text, Color color, int clipRectIndex ) : void

Draw string using specified font texture, position, text and color. Font texture should contain character glyphs arranged in grid 16x16. Only ASCII is supported.

DrawSprite ( Texture srv, float x, float y, float size, float angle, Color color, int clipRectIndex ) : void

Draw rotated square with specified position, width, height and rotation angle.

DrawSprite ( Texture srv, float x, float y, float width, float height, float angle, Color color, int clipRectIndex ) : void

Draw rotated rectangle with specified position, width, height and rotation angle.

DrawUV ( Texture srv, Vector3 leftTopCorner, Vector3 rightBottomCorner, Color color, float u, float v, float tw, float th, int clipRectIndex ) : void

DrawUV ( Texture srv, float x, float y, float w, float h, Color color, float u, float v, float tw, float th, int clipRectIndex ) : void

Draw axis-aligned quad with specified UV coordinates.

PushQuad ( Texture texture, SpriteVertex v0, SpriteVertex v1, SpriteVertex v2, SpriteVertex v3 ) : void

ReallocGpuBuffers ( int newCapacity ) : void

SetClipRectangle ( int index, Rectangle rectangle, Color color ) : void

SetTransform ( Vector2 offset, Vector2 pivot, float angle ) : void

SetTransform ( float x, float y ) : void

SpriteLayer ( RenderSystem rs, int capacity ) : System

Ctor

Protected Methods

Method Description
Dispose ( bool disposing ) : void

Private Methods

Method Description
Draw ( GameTime gameTime, StereoEye stereoEye ) : void

DrawQuad ( Texture texture, SpriteVertex v0, SpriteVertex v1, SpriteVertex v2, SpriteVertex v3 ) : void

Draws arbitrary quad with specified vertices.

Method Details

Clear() public method

Clears all sprites.
public Clear ( ) : void
return void

Dispose() protected method

protected Dispose ( bool disposing ) : void
disposing bool
return void

Draw() public method

Adds a sprite to a batch of sprites for rendering using the specified texture, destination rectangle, and color.
public Draw ( Texture texture, Rectangle dstRect, Color color, int clipRectIndex ) : void
texture Texture
dstRect Rectangle
color Color
clipRectIndex int
return void

Draw() public method

public Draw ( Texture texture, Rectangle dstRect, Rectangle srcRect, Color color, int clipRectIndex ) : void
texture Texture
dstRect Rectangle
srcRect Rectangle
color Color
clipRectIndex int
return void

Draw() public method

public Draw ( Texture texture, Rectangle dstRect, Rectangle srcRect, int offsetX, int offsetY, Color color, int clipRectIndex ) : void
texture Texture
dstRect Rectangle
srcRect Rectangle
offsetX int
offsetY int
color Color
clipRectIndex int
return void

Draw() public method

Adds a sprite to a batch of sprites for rendering using the specified texture, destination rectangle, and color.
public Draw ( Texture texture, RectangleF dstRect, Color color, int clipRectIndex ) : void
texture Texture
dstRect RectangleF
color Color
clipRectIndex int
return void

Draw() public method

Adds a sprite to a batch of sprites for rendering using the specified texture, destination rectangle, source rectangle, and color.
public Draw ( Texture texture, RectangleF dstRect, RectangleF srcRect, Color color, int clipRectIndex ) : void
texture Texture
dstRect RectangleF
srcRect RectangleF
color Color
clipRectIndex int
return void

Draw() public method

Draw axis-aligned quad with stretched texture.
public Draw ( Texture srv, float x, float y, float w, float h, Color color, int clipRectIndex ) : void
srv Texture
x float
y float
w float
h float
color Color
clipRectIndex int
return void

DrawBeam() public method

Draws beam.
public DrawBeam ( Texture srv, Vector2 p0, Vector2 p1, Color color0, Color color1, float width, float scale = 1, float offset, int clipRectIndex ) : void
srv Texture
p0 Vector2
p1 Vector2
color0 Color
color1 Color
width float
scale float
offset float
clipRectIndex int
return void

DrawDebugString() public method

Draw string using specified font texture, position, text and color. Font texture should contain character glyphs arranged in grid 16x16. Only ASCII is supported.
public DrawDebugString ( Texture fontTexture, float x, float y, string text, Color color, float scale, int clipRectIndex ) : void
fontTexture Texture
x float
y float
text string
color Color
scale float
clipRectIndex int
return void

DrawDebugString() public method

Draw string using specified font texture, position, text and color. Font texture should contain character glyphs arranged in grid 16x16. Only ASCII is supported.
public DrawDebugString ( Texture fontTexture, float x, float y, string text, Color color, int clipRectIndex ) : void
fontTexture Texture
x float
y float
text string
color Color
clipRectIndex int
return void

DrawSprite() public method

Draw rotated square with specified position, width, height and rotation angle.
public DrawSprite ( Texture srv, float x, float y, float size, float angle, Color color, int clipRectIndex ) : void
srv Texture
x float
y float
size float
angle float
color Color
clipRectIndex int
return void

DrawSprite() public method

Draw rotated rectangle with specified position, width, height and rotation angle.
public DrawSprite ( Texture srv, float x, float y, float width, float height, float angle, Color color, int clipRectIndex ) : void
srv Texture
x float
y float
width float
height float
angle float
color Color
clipRectIndex int
return void

DrawUV() public method

public DrawUV ( Texture srv, Vector3 leftTopCorner, Vector3 rightBottomCorner, Color color, float u, float v, float tw, float th, int clipRectIndex ) : void
srv Texture
leftTopCorner Vector3
rightBottomCorner Vector3
color Color
u float
v float
tw float
th float
clipRectIndex int
return void

DrawUV() public method

Draw axis-aligned quad with specified UV coordinates.
public DrawUV ( Texture srv, float x, float y, float w, float h, Color color, float u, float v, float tw, float th, int clipRectIndex ) : void
srv Texture
x float
y float
w float
h float
color Color
u float
v float
tw float
th float
clipRectIndex int
return void

PushQuad() public method

public PushQuad ( Texture texture, SpriteVertex v0, SpriteVertex v1, SpriteVertex v2, SpriteVertex v3 ) : void
texture Texture
v0 SpriteVertex
v1 SpriteVertex
v2 SpriteVertex
v3 SpriteVertex
return void

ReallocGpuBuffers() public method

public ReallocGpuBuffers ( int newCapacity ) : void
newCapacity int
return void

SetClipRectangle() public method

public SetClipRectangle ( int index, Rectangle rectangle, Color color ) : void
index int
rectangle Rectangle
color Color
return void

SetTransform() public method

public SetTransform ( Vector2 offset, Vector2 pivot, float angle ) : void
offset Vector2
pivot Vector2
angle float
return void

SetTransform() public method

public SetTransform ( float x, float y ) : void
x float
y float
return void

SpriteLayer() public method

Ctor
public SpriteLayer ( RenderSystem rs, int capacity ) : System
rs RenderSystem
capacity int Number of sprites
return System