Header menu logo Mibo

LineBatch Module

A simple batcher for drawing line primitives in 2D and 3D.

Lines use VertexPositionColor and are drawn with PrimitiveType.LineList.

Types

Type Description

State

Functions and values

Function or value Description

addCircle2D center radius segments color state

Full Usage: addCircle2D center radius segments color state

Parameters:

Adds a 2D circle outline to the batch.

center : Vector2
radius : float32
segments : int
color : Color
state : State

addLine p1 p2 color state

Full Usage: addLine p1 p2 color state

Parameters:

Adds a single line segment to the batch.

p1 : Vector3
p2 : Vector3
color : Color
state : State

addLine2D p1 p2 color state

Full Usage: addLine2D p1 p2 color state

Parameters:

Adds a 2D line segment to the batch.

p1 : Vector2
p2 : Vector2
color : Color
state : State

addLines vertices lineCount state

Full Usage: addLines vertices lineCount state

Parameters:
    vertices : VertexPositionColor[] - Array of vertices (2 per line segment).
    lineCount : int - Number of line segments to add.
    state : State

Adds multiple line segments from a pre-built vertex array.

vertices : VertexPositionColor[]

Array of vertices (2 per line segment).

lineCount : int

Number of line segments to add.

state : State

addRect2D rect color state

Full Usage: addRect2D rect color state

Parameters:

Adds a 2D rectangle outline to the batch.

rect : Rectangle
color : Color
state : State

begin' state

Full Usage: begin' state

Parameters:
Modifiers: inline

Begin a batch.

state : State

create graphicsDevice

Full Usage: create graphicsDevice

Parameters:
Returns: State

Creates a new line batcher.

graphicsDevice : GraphicsDevice
Returns: State

dispose state

Full Usage: dispose state

Parameters:

Return pooled arrays. Call when the batch is no longer needed.

state : State

end' effect state

Full Usage: end' effect state

Parameters:
Modifiers: inline

Ends the batch and flushes all draw commands to the GPU.

effect : Effect
state : State

flush effect state

Full Usage: flush effect state

Parameters:

Flushes the current batch to the GPU.

Effect passes are applied by the caller; this only issues the draw call.

effect : Effect
state : State

Type something to start searching.