Header menu logo Mibo

Command2D Module

Factory functions that create Command2D values.

Each function is inline and curried for partial application of styling parameters (layer, color) before the geometry argument.

Functions and values

Function or value Description

beginCamera layer camera

Full Usage: beginCamera layer camera

Parameters:
Returns: Command2D
Modifiers: inline

Begins a 2D camera transform. (layer) can be partially applied.

layer : int<MeasureProduct<RenderLayer, MeasureOne>>
camera : Camera2D
Returns: Command2D

beginCameraConfig layer config

Full Usage: beginCameraConfig layer config

Parameters:
Returns: Command2D
Modifiers: inline

Begins a 2D camera with viewport/clear config. (layer) can be partially applied.

layer : int<MeasureProduct<RenderLayer, MeasureOne>>
config : Camera2DConfig
Returns: Command2D

beginShader layer shader

Full Usage: beginShader layer shader

Parameters:
Returns: Command2D
Modifiers: inline

Begins a custom shader/effect block. (layer) can be partially applied.

layer : int<MeasureProduct<RenderLayer, MeasureOne>>
shader : Effect
Returns: Command2D

beginTarget layer target

Full Usage: beginTarget layer target

Parameters:
Returns: Command2D
Modifiers: inline

Begins rendering to a render target. (layer) can be partially applied.

layer : int<MeasureProduct<RenderLayer, MeasureOne>>
target : RenderTarget2D
Returns: Command2D

bezier (layer, color, thickness) (start, control, finish)

Full Usage: bezier (layer, color, thickness) (start, control, finish)

Parameters:
Returns: Command2D
Modifiers: inline

Quadratic bezier curve. (layer, color, thickness) can be partially applied.

layer : int<MeasureProduct<RenderLayer, MeasureOne>>
color : Color
thickness : float32
start : Vector2
control : Vector2
finish : Vector2
Returns: Command2D

circleGradient layer (centerX, centerY, radius, inner, outer)

Full Usage: circleGradient layer (centerX, centerY, radius, inner, outer)

Parameters:
Returns: Command2D
Modifiers: inline

Gradient circle. (layer) can be partially applied.

layer : int<MeasureProduct<RenderLayer, MeasureOne>>
centerX : int
centerY : int
radius : float32
inner : Color
outer : Color
Returns: Command2D

circleOutline (layer, color) (center, radius)

Full Usage: circleOutline (layer, color) (center, radius)

Parameters:
Returns: Command2D
Modifiers: inline

Circle outline. (layer, color) can be partially applied.

layer : int<MeasureProduct<RenderLayer, MeasureOne>>
color : Color
center : Vector2
radius : float32
Returns: Command2D

circleSector (layer, color) (center, radius, startAngle, endAngle, segments)

Full Usage: circleSector (layer, color) (center, radius, startAngle, endAngle, segments)

Parameters:
Returns: Command2D
Modifiers: inline

Filled circle sector (pie slice). (layer, color) can be partially applied.

layer : int<MeasureProduct<RenderLayer, MeasureOne>>
color : Color
center : Vector2
radius : float32
startAngle : float32
endAngle : float32
segments : int
Returns: Command2D

circleSectorOutline (layer, color) (center, radius, startAngle, endAngle, segments)

Full Usage: circleSectorOutline (layer, color) (center, radius, startAngle, endAngle, segments)

Parameters:
Returns: Command2D
Modifiers: inline

Circle sector outline. (layer, color) can be partially applied.

layer : int<MeasureProduct<RenderLayer, MeasureOne>>
color : Color
center : Vector2
radius : float32
startAngle : float32
endAngle : float32
segments : int
Returns: Command2D

clear layer color

Full Usage: clear layer color

Parameters:
Returns: Command2D
Modifiers: inline

Clears the current framebuffer to the given color.

layer : int<MeasureProduct<RenderLayer, MeasureOne>>
color : Color
Returns: Command2D

clearScissor layer

Full Usage: clearScissor layer

Parameters:
Returns: Command2D
Modifiers: inline

Disables the scissor rectangle.

layer : int<MeasureProduct<RenderLayer, MeasureOne>>
Returns: Command2D

drawImmediate layer action

Full Usage: drawImmediate layer action

Parameters:
Returns: Command2D
Modifiers: inline

Flushes the SpriteBatch, exits camera, runs the action, then restores state. (layer) can be partially applied.

layer : int<MeasureProduct<RenderLayer, MeasureOne>>
action : unit -> unit
Returns: Command2D

ellipseOutline (layer, color) (centerX, centerY, radiusH, radiusV)

Full Usage: ellipseOutline (layer, color) (centerX, centerY, radiusH, radiusV)

Parameters:
Returns: Command2D
Modifiers: inline

Ellipse outline. (layer, color) can be partially applied.

layer : int<MeasureProduct<RenderLayer, MeasureOne>>
color : Color
centerX : int
centerY : int
radiusH : float32
radiusV : float32
Returns: Command2D

endCamera layer

Full Usage: endCamera layer

Parameters:
Returns: Command2D
Modifiers: inline

Ends the current 2D camera transform.

layer : int<MeasureProduct<RenderLayer, MeasureOne>>
Returns: Command2D

endShader layer

Full Usage: endShader layer

Parameters:
Returns: Command2D
Modifiers: inline

Ends the current shader block.

layer : int<MeasureProduct<RenderLayer, MeasureOne>>
Returns: Command2D

endTarget layer

Full Usage: endTarget layer

Parameters:
Returns: Command2D
Modifiers: inline

Ends the current render target and resumes back-buffer rendering.

layer : int<MeasureProduct<RenderLayer, MeasureOne>>
Returns: Command2D

fillCircle (layer, color) (center, radius)

Full Usage: fillCircle (layer, color) (center, radius)

Parameters:
Returns: Command2D
Modifiers: inline

Filled circle. (layer, color) can be partially applied.

layer : int<MeasureProduct<RenderLayer, MeasureOne>>
color : Color
center : Vector2
radius : float32
Returns: Command2D

fillEllipse (layer, color) (centerX, centerY, radiusH, radiusV)

Full Usage: fillEllipse (layer, color) (centerX, centerY, radiusH, radiusV)

Parameters:
Returns: Command2D
Modifiers: inline

Filled ellipse. (layer, color) can be partially applied.

layer : int<MeasureProduct<RenderLayer, MeasureOne>>
color : Color
centerX : int
centerY : int
radiusH : float32
radiusV : float32
Returns: Command2D

fillPoly (layer, color) (center, sides, radius, rotation)

Full Usage: fillPoly (layer, color) (center, sides, radius, rotation)

Parameters:
Returns: Command2D
Modifiers: inline

Filled regular polygon. (layer, color) can be partially applied.

layer : int<MeasureProduct<RenderLayer, MeasureOne>>
color : Color
center : Vector2
sides : int
radius : float32
rotation : float32
Returns: Command2D

fillRect (layer, color) rect

Full Usage: fillRect (layer, color) rect

Parameters:
Returns: Command2D
Modifiers: inline

Filled rectangle. (layer, color) can be partially applied.

layer : int<MeasureProduct<RenderLayer, MeasureOne>>
color : Color
rect : Rectangle
Returns: Command2D

fillRectRounded (layer, color, roundness, segments) rect

Full Usage: fillRectRounded (layer, color, roundness, segments) rect

Parameters:
Returns: Command2D
Modifiers: inline

Filled rounded rectangle. (layer, color, roundness, segments) can be partially applied.

layer : int<MeasureProduct<RenderLayer, MeasureOne>>
color : Color
roundness : float32
segments : int
rect : Rectangle
Returns: Command2D

fillRing (layer, color) (center, innerR, outerR, startAngle, endAngle, segments)

Full Usage: fillRing (layer, color) (center, innerR, outerR, startAngle, endAngle, segments)

Parameters:
Returns: Command2D
Modifiers: inline

Filled ring / arc. (layer, color) can be partially applied.

layer : int<MeasureProduct<RenderLayer, MeasureOne>>
color : Color
center : Vector2
innerR : float32
outerR : float32
startAngle : float32
endAngle : float32
segments : int
Returns: Command2D

line (layer, color) (start, finish)

Full Usage: line (layer, color) (start, finish)

Parameters:
Returns: Command2D
Modifiers: inline

1-pixel line. (layer, color) can be partially applied.

layer : int<MeasureProduct<RenderLayer, MeasureOne>>
color : Color
start : Vector2
finish : Vector2
Returns: Command2D

lineStrip (layer, color) points

Full Usage: lineStrip (layer, color) points

Parameters:
Returns: Command2D
Modifiers: inline

Connected line segments. (layer, color) can be partially applied.

layer : int<MeasureProduct<RenderLayer, MeasureOne>>
color : Color
points : Vector2[]
Returns: Command2D

lineThick (layer, color, thickness) (start, finish)

Full Usage: lineThick (layer, color, thickness) (start, finish)

Parameters:
Returns: Command2D
Modifiers: inline

Line with custom thickness. (layer, color, thickness) can be partially applied.

layer : int<MeasureProduct<RenderLayer, MeasureOne>>
color : Color
thickness : float32
start : Vector2
finish : Vector2
Returns: Command2D

particles layer texture particleData particleCount

Full Usage: particles layer texture particleData particleCount

Parameters:
Returns: Command2D
Modifiers: inline

Creates a batched particle render command.

layer : int<MeasureProduct<RenderLayer, MeasureOne>>
texture : Texture2D
particleData : Particle2D[]
particleCount : int
Returns: Command2D

polyOutline (layer, color, thickness) (center, sides, radius, rotation)

Full Usage: polyOutline (layer, color, thickness) (center, sides, radius, rotation)

Parameters:
Returns: Command2D
Modifiers: inline

Regular polygon outline with thickness. (layer, color, thickness) can be partially applied.

layer : int<MeasureProduct<RenderLayer, MeasureOne>>
color : Color
thickness : float32
center : Vector2
sides : int
radius : float32
rotation : float32
Returns: Command2D

rectGradient layer (rect, tl, bl, tr, br)

Full Usage: rectGradient layer (rect, tl, bl, tr, br)

Parameters:
Returns: Command2D
Modifiers: inline

4-corner gradient rectangle. (layer) can be partially applied.

layer : int<MeasureProduct<RenderLayer, MeasureOne>>
rect : Rectangle
tl : Color
bl : Color
tr : Color
br : Color
Returns: Command2D

rectGradientH layer (x, y, w, h, left, right)

Full Usage: rectGradientH layer (x, y, w, h, left, right)

Parameters:
Returns: Command2D
Modifiers: inline

Horizontal gradient rectangle. (layer) can be partially applied.

layer : int<MeasureProduct<RenderLayer, MeasureOne>>
x : int
y : int
w : int
h : int
left : Color
right : Color
Returns: Command2D

rectGradientV layer (x, y, w, h, top, bottom)

Full Usage: rectGradientV layer (x, y, w, h, top, bottom)

Parameters:
Returns: Command2D
Modifiers: inline

Vertical gradient rectangle. (layer) can be partially applied.

layer : int<MeasureProduct<RenderLayer, MeasureOne>>
x : int
y : int
w : int
h : int
top : Color
bottom : Color
Returns: Command2D

rectOutline (layer, color, thickness) rect

Full Usage: rectOutline (layer, color, thickness) rect

Parameters:
Returns: Command2D
Modifiers: inline

Rectangle outline with thickness. (layer, color, thickness) can be partially applied.

layer : int<MeasureProduct<RenderLayer, MeasureOne>>
color : Color
thickness : float32
rect : Rectangle
Returns: Command2D

rectRoundedOutline (layer, color, roundness, segments, thickness) rect

Full Usage: rectRoundedOutline (layer, color, roundness, segments, thickness) rect

Parameters:
Returns: Command2D
Modifiers: inline

Rounded rectangle outline with thickness. (layer, color, roundness, segments, thickness) can be partially applied.

layer : int<MeasureProduct<RenderLayer, MeasureOne>>
color : Color
roundness : float32
segments : int
thickness : float32
rect : Rectangle
Returns: Command2D

ringOutline (layer, color) (center, innerR, outerR, startAngle, endAngle, segments)

Full Usage: ringOutline (layer, color) (center, innerR, outerR, startAngle, endAngle, segments)

Parameters:
Returns: Command2D
Modifiers: inline

Ring / arc outline. (layer, color) can be partially applied.

layer : int<MeasureProduct<RenderLayer, MeasureOne>>
color : Color
center : Vector2
innerR : float32
outerR : float32
startAngle : float32
endAngle : float32
segments : int
Returns: Command2D

setBlend layer mode

Full Usage: setBlend layer mode

Parameters:
Returns: Command2D
Modifiers: inline

Sets the active blend mode. (layer) can be partially applied.

layer : int<MeasureProduct<RenderLayer, MeasureOne>>
mode : BlendMode
Returns: Command2D

setLineWidth layer width

Full Usage: setLineWidth layer width

Parameters:
Returns: Command2D
Modifiers: inline

Sets the default line width for thick line primitives.

layer : int<MeasureProduct<RenderLayer, MeasureOne>>
width : float32
Returns: Command2D

setScissor layer (x, y, w, h)

Full Usage: setScissor layer (x, y, w, h)

Parameters:
Returns: Command2D
Modifiers: inline

Enables a scissor rectangle. (layer) can be partially applied.

layer : int<MeasureProduct<RenderLayer, MeasureOne>>
x : int
y : int
w : int
h : int
Returns: Command2D

setViewport layer (x, y, w, h)

Full Usage: setViewport layer (x, y, w, h)

Parameters:
Returns: Command2D
Modifiers: inline

Sets the device viewport. (layer) can be partially applied.

layer : int<MeasureProduct<RenderLayer, MeasureOne>>
x : int
y : int
w : int
h : int
Returns: Command2D

sprite state

Full Usage: sprite state

Parameters:
Returns: Command2D
Modifiers: inline

Creates a sprite command from a pre-configured SpriteState.

state : SpriteState
Returns: Command2D

text state

Full Usage: text state

Parameters:
Returns: Command2D
Modifiers: inline

Creates a text command from a pre-configured TextState.

state : TextState
Returns: Command2D

triangle (layer, color) (v1, v2, v3)

Full Usage: triangle (layer, color) (v1, v2, v3)

Parameters:
Returns: Command2D
Modifiers: inline

Filled triangle from 3 vertices. (layer, color) can be partially applied.

layer : int<MeasureProduct<RenderLayer, MeasureOne>>
color : Color
v1 : Vector2
v2 : Vector2
v3 : Vector2
Returns: Command2D

triangleFan (layer, color) points

Full Usage: triangleFan (layer, color) points

Parameters:
Returns: Command2D
Modifiers: inline

Filled triangle fan. (layer, color) can be partially applied.

layer : int<MeasureProduct<RenderLayer, MeasureOne>>
color : Color
points : Vector2[]
Returns: Command2D

triangleStrip (layer, color) points

Full Usage: triangleStrip (layer, color) points

Parameters:
Returns: Command2D
Modifiers: inline

Filled triangle strip. (layer, color) can be partially applied.

layer : int<MeasureProduct<RenderLayer, MeasureOne>>
color : Color
points : Vector2[]
Returns: Command2D

Type something to start searching.