C# Класс Nez.PrimitiveBatch

batcher that draws vertex colored triangles
Наследование: IDisposable
Показать файл Открыть проект Примеры использования класса

Открытые методы

Метод Описание
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.

Защищенные методы

Метод Описание
Dispose ( bool disposing ) : void

Приватные методы

Метод Описание
flushLines ( ) : void
flushTriangles ( ) : void

Описание методов

Dispose() публичный Метод

public Dispose ( ) : void
Результат void

Dispose() защищенный Метод

protected Dispose ( bool disposing ) : void
disposing bool
Результат void

PrimitiveBatch() публичный Метод

public PrimitiveBatch ( int bufferSize = 500 ) : System
bufferSize int
Результат System

addVertex() публичный Метод

public addVertex ( Vector2 vertex, Color color, PrimitiveType primitiveType ) : void
vertex Vector2
color Color
primitiveType PrimitiveType
Результат void

begin() публичный Метод

draws directly in screen space at full viewport size
public begin ( ) : void
Результат void

begin() публичный Метод

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.
Результат void

drawArrow() публичный Метод

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
Результат void

drawCircle() публичный Метод

public drawCircle ( Vector2 center, float radius, Color color, int circleSegments = 32 ) : void
center Vector2
radius float
color Color
circleSegments int
Результат void

drawPolygon() публичный Метод

public drawPolygon ( Vector2 position, Vector2 vertices, Color color ) : void
position Vector2
vertices Vector2
color Color
Результат void

drawPolygon() публичный Метод

public drawPolygon ( Vector2 vertices, int count, Color color ) : void
vertices Vector2
count int
color Color
Результат void

drawRectangle() публичный Метод

public drawRectangle ( Rectangle &rect, Color color ) : void
rect Microsoft.Xna.Framework.Rectangle
color Color
Результат void

drawRectangle() публичный Метод

public drawRectangle ( float x, float y, float width, float height, Color color ) : void
x float
y float
width float
height float
color Color
Результат void

end() публичный Метод

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
Результат void