C# Class Nez.PrimitiveBatch

batcher that draws vertex colored triangles
Inheritance: IDisposable
Afficher le fichier Open project: prime31/Nez Class Usage Examples

Méthodes publiques

Méthode Description
Dispose ( ) : void
PrimitiveBatch ( int bufferSize = 500 ) : System
addVertex ( Vector2 vertex, Color color, PrimitiveType primitiveType ) : void
begin ( ) : void

draws directly in screen space at full viewport size

begin ( Matrix &projection, Matrix &view ) : void

Begin is called to tell the PrimitiveBatch what kind of primitives will be drawn, and to prepare the graphics card to render those primitives. Use camera.projectionMatrix and camera.transformMatrix if the batch should be in camera space.

drawArrow ( Vector2 start, Vector2 end, float length, float width, bool drawStartIndicator, Color color ) : void
drawCircle ( Vector2 center, float radius, Color color, int circleSegments = 32 ) : void
drawPolygon ( Vector2 position, Vector2 vertices, Color color ) : void
drawPolygon ( Vector2 vertices, int count, Color color ) : void
drawRectangle ( Rectangle &rect, Color color ) : void
drawRectangle ( float x, float y, float width, float height, Color color ) : void
end ( ) : void

End is called once all the primitives have been drawn using AddVertex. it will call Flush to actually submit the draw call to the graphics card, and then tell the basic effect to end.

Méthodes protégées

Méthode Description
Dispose ( bool disposing ) : void

Private Methods

Méthode Description
flushLines ( ) : void
flushTriangles ( ) : void

Method Details

Dispose() public méthode

public Dispose ( ) : void
Résultat void

Dispose() protected méthode

protected Dispose ( bool disposing ) : void
disposing bool
Résultat void

PrimitiveBatch() public méthode

public PrimitiveBatch ( int bufferSize = 500 ) : System
bufferSize int
Résultat System

addVertex() public méthode

public addVertex ( Vector2 vertex, Color color, PrimitiveType primitiveType ) : void
vertex Vector2
color Color
primitiveType PrimitiveType
Résultat void

begin() public méthode

draws directly in screen space at full viewport size
public begin ( ) : void
Résultat void

begin() public méthode

Begin is called to tell the PrimitiveBatch what kind of primitives will be drawn, and to prepare the graphics card to render those primitives. Use camera.projectionMatrix and camera.transformMatrix if the batch should be in camera space.
public begin ( Matrix &projection, Matrix &view ) : void
projection Matrix The projection.
view Matrix The view.
Résultat void

drawArrow() public méthode

public drawArrow ( Vector2 start, Vector2 end, float length, float width, bool drawStartIndicator, Color color ) : void
start Vector2
end Vector2
length float
width float
drawStartIndicator bool
color Color
Résultat void

drawCircle() public méthode

public drawCircle ( Vector2 center, float radius, Color color, int circleSegments = 32 ) : void
center Vector2
radius float
color Color
circleSegments int
Résultat void

drawPolygon() public méthode

public drawPolygon ( Vector2 position, Vector2 vertices, Color color ) : void
position Vector2
vertices Vector2
color Color
Résultat void

drawPolygon() public méthode

public drawPolygon ( Vector2 vertices, int count, Color color ) : void
vertices Vector2
count int
color Color
Résultat void

drawRectangle() public méthode

public drawRectangle ( Rectangle &rect, Color color ) : void
rect Microsoft.Xna.Framework.Rectangle
color Color
Résultat void

drawRectangle() public méthode

public drawRectangle ( float x, float y, float width, float height, Color color ) : void
x float
y float
width float
height float
color Color
Résultat void

end() public méthode

End is called once all the primitives have been drawn using AddVertex. it will call Flush to actually submit the draw call to the graphics card, and then tell the basic effect to end.
public end ( ) : void
Résultat void