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
|
Full Usage:
beginCamera layer camera
Parameters:
int<MeasureProduct<RenderLayer, MeasureOne>>
camera : Camera2D
Returns: Command2D
Modifiers: inline |
Begins a 2D camera transform. (layer) can be partially applied.
|
Full Usage:
beginCameraConfig layer config
Parameters:
int<MeasureProduct<RenderLayer, MeasureOne>>
config : Camera2DConfig
Returns: Command2D
Modifiers: inline |
Begins a 2D camera with viewport/clear config. (layer) can be partially applied.
|
Full Usage:
beginShader layer shader
Parameters:
int<MeasureProduct<RenderLayer, MeasureOne>>
shader : Effect
Returns: Command2D
Modifiers: inline |
Begins a custom shader/effect block. (layer) can be partially applied.
|
Full Usage:
beginTarget layer target
Parameters:
int<MeasureProduct<RenderLayer, MeasureOne>>
target : RenderTarget2D
Returns: Command2D
Modifiers: inline |
Begins rendering to a render target. (layer) can be partially applied.
|
Full Usage:
bezier (layer, color, thickness) (start, control, finish)
Parameters:
int<MeasureProduct<RenderLayer, MeasureOne>>
color : Color
thickness : float32
start : Vector2
control : Vector2
finish : Vector2
Returns: Command2D
Modifiers: inline |
Quadratic bezier curve. (layer, color, thickness) can be partially applied.
|
Full Usage:
circleGradient layer (centerX, centerY, radius, inner, outer)
Parameters:
int<MeasureProduct<RenderLayer, MeasureOne>>
centerX : int
centerY : int
radius : float32
inner : Color
outer : Color
Returns: Command2D
Modifiers: inline |
Gradient circle. (layer) can be partially applied.
|
Full Usage:
circleOutline (layer, color) (center, radius)
Parameters:
int<MeasureProduct<RenderLayer, MeasureOne>>
color : Color
center : Vector2
radius : float32
Returns: Command2D
Modifiers: inline |
Circle outline. (layer, color) can be partially applied.
|
Full Usage:
circleSector (layer, color) (center, radius, startAngle, endAngle, segments)
Parameters:
int<MeasureProduct<RenderLayer, MeasureOne>>
color : Color
center : Vector2
radius : float32
startAngle : float32
endAngle : float32
segments : int
Returns: Command2D
Modifiers: inline |
Filled circle sector (pie slice). (layer, color) can be partially applied.
|
Full Usage:
circleSectorOutline (layer, color) (center, radius, startAngle, endAngle, segments)
Parameters:
int<MeasureProduct<RenderLayer, MeasureOne>>
color : Color
center : Vector2
radius : float32
startAngle : float32
endAngle : float32
segments : int
Returns: Command2D
Modifiers: inline |
Circle sector outline. (layer, color) can be partially applied.
|
Full Usage:
clear layer color
Parameters:
int<MeasureProduct<RenderLayer, MeasureOne>>
color : Color
Returns: Command2D
Modifiers: inline |
Clears the current framebuffer to the given color.
|
Full Usage:
clearScissor layer
Parameters:
int<MeasureProduct<RenderLayer, MeasureOne>>
Returns: Command2D
Modifiers: inline |
Disables the scissor rectangle.
|
Full Usage:
drawImmediate layer action
Parameters:
int<MeasureProduct<RenderLayer, MeasureOne>>
action : unit -> unit
Returns: Command2D
Modifiers: inline |
Flushes the SpriteBatch, exits camera, runs the action, then restores state. (layer) can be partially applied.
|
Full Usage:
ellipseOutline (layer, color) (centerX, centerY, radiusH, radiusV)
Parameters:
int<MeasureProduct<RenderLayer, MeasureOne>>
color : Color
centerX : int
centerY : int
radiusH : float32
radiusV : float32
Returns: Command2D
Modifiers: inline |
Ellipse outline. (layer, color) can be partially applied.
|
Full Usage:
endCamera layer
Parameters:
int<MeasureProduct<RenderLayer, MeasureOne>>
Returns: Command2D
Modifiers: inline |
Ends the current 2D camera transform.
|
Full Usage:
endShader layer
Parameters:
int<MeasureProduct<RenderLayer, MeasureOne>>
Returns: Command2D
Modifiers: inline |
Ends the current shader block.
|
Full Usage:
endTarget layer
Parameters:
int<MeasureProduct<RenderLayer, MeasureOne>>
Returns: Command2D
Modifiers: inline |
Ends the current render target and resumes back-buffer rendering.
|
Full Usage:
fillCircle (layer, color) (center, radius)
Parameters:
int<MeasureProduct<RenderLayer, MeasureOne>>
color : Color
center : Vector2
radius : float32
Returns: Command2D
Modifiers: inline |
Filled circle. (layer, color) can be partially applied.
|
Full Usage:
fillEllipse (layer, color) (centerX, centerY, radiusH, radiusV)
Parameters:
int<MeasureProduct<RenderLayer, MeasureOne>>
color : Color
centerX : int
centerY : int
radiusH : float32
radiusV : float32
Returns: Command2D
Modifiers: inline |
Filled ellipse. (layer, color) can be partially applied.
|
Full Usage:
fillPoly (layer, color) (center, sides, radius, rotation)
Parameters:
int<MeasureProduct<RenderLayer, MeasureOne>>
color : Color
center : Vector2
sides : int
radius : float32
rotation : float32
Returns: Command2D
Modifiers: inline |
Filled regular polygon. (layer, color) can be partially applied.
|
Full Usage:
fillRect (layer, color) rect
Parameters:
int<MeasureProduct<RenderLayer, MeasureOne>>
color : Color
rect : Rectangle
Returns: Command2D
Modifiers: inline |
Filled rectangle. (layer, color) can be partially applied.
|
Full Usage:
fillRectRounded (layer, color, roundness, segments) rect
Parameters:
int<MeasureProduct<RenderLayer, MeasureOne>>
color : Color
roundness : float32
segments : int
rect : Rectangle
Returns: Command2D
Modifiers: inline |
Filled rounded rectangle. (layer, color, roundness, segments) can be partially applied.
|
Full Usage:
fillRing (layer, color) (center, innerR, outerR, startAngle, endAngle, segments)
Parameters:
int<MeasureProduct<RenderLayer, MeasureOne>>
color : Color
center : Vector2
innerR : float32
outerR : float32
startAngle : float32
endAngle : float32
segments : int
Returns: Command2D
Modifiers: inline |
Filled ring / arc. (layer, color) can be partially applied.
|
Full Usage:
line (layer, color) (start, finish)
Parameters:
int<MeasureProduct<RenderLayer, MeasureOne>>
color : Color
start : Vector2
finish : Vector2
Returns: Command2D
Modifiers: inline |
1-pixel line. (layer, color) can be partially applied.
|
Full Usage:
lineStrip (layer, color) points
Parameters:
int<MeasureProduct<RenderLayer, MeasureOne>>
color : Color
points : Vector2[]
Returns: Command2D
Modifiers: inline |
Connected line segments. (layer, color) can be partially applied.
|
Full Usage:
lineThick (layer, color, thickness) (start, finish)
Parameters:
int<MeasureProduct<RenderLayer, MeasureOne>>
color : Color
thickness : float32
start : Vector2
finish : Vector2
Returns: Command2D
Modifiers: inline |
Line with custom thickness. (layer, color, thickness) can be partially applied.
|
Full Usage:
particles layer texture particleData particleCount
Parameters:
int<MeasureProduct<RenderLayer, MeasureOne>>
texture : Texture2D
particleData : Particle2D[]
particleCount : int
Returns: Command2D
Modifiers: inline |
Creates a batched particle render command.
|
Full Usage:
polyOutline (layer, color, thickness) (center, sides, radius, rotation)
Parameters:
int<MeasureProduct<RenderLayer, MeasureOne>>
color : Color
thickness : float32
center : Vector2
sides : int
radius : float32
rotation : float32
Returns: Command2D
Modifiers: inline |
Regular polygon outline with thickness. (layer, color, thickness) can be partially applied.
|
Full Usage:
rectGradient layer (rect, tl, bl, tr, br)
Parameters:
int<MeasureProduct<RenderLayer, MeasureOne>>
rect : Rectangle
tl : Color
bl : Color
tr : Color
br : Color
Returns: Command2D
Modifiers: inline |
4-corner gradient rectangle. (layer) can be partially applied.
|
Full Usage:
rectGradientH layer (x, y, w, h, left, right)
Parameters:
int<MeasureProduct<RenderLayer, MeasureOne>>
x : int
y : int
w : int
h : int
left : Color
right : Color
Returns: Command2D
Modifiers: inline |
Horizontal gradient rectangle. (layer) can be partially applied.
|
Full Usage:
rectGradientV layer (x, y, w, h, top, bottom)
Parameters:
int<MeasureProduct<RenderLayer, MeasureOne>>
x : int
y : int
w : int
h : int
top : Color
bottom : Color
Returns: Command2D
Modifiers: inline |
Vertical gradient rectangle. (layer) can be partially applied.
|
Full Usage:
rectOutline (layer, color, thickness) rect
Parameters:
int<MeasureProduct<RenderLayer, MeasureOne>>
color : Color
thickness : float32
rect : Rectangle
Returns: Command2D
Modifiers: inline |
Rectangle outline with thickness. (layer, color, thickness) can be partially applied.
|
Full Usage:
rectRoundedOutline (layer, color, roundness, segments, thickness) rect
Parameters:
int<MeasureProduct<RenderLayer, MeasureOne>>
color : Color
roundness : float32
segments : int
thickness : float32
rect : Rectangle
Returns: Command2D
Modifiers: inline |
Rounded rectangle outline with thickness. (layer, color, roundness, segments, thickness) can be partially applied.
|
Full Usage:
ringOutline (layer, color) (center, innerR, outerR, startAngle, endAngle, segments)
Parameters:
int<MeasureProduct<RenderLayer, MeasureOne>>
color : Color
center : Vector2
innerR : float32
outerR : float32
startAngle : float32
endAngle : float32
segments : int
Returns: Command2D
Modifiers: inline |
Ring / arc outline. (layer, color) can be partially applied.
|
Full Usage:
setBlend layer mode
Parameters:
int<MeasureProduct<RenderLayer, MeasureOne>>
mode : BlendMode
Returns: Command2D
Modifiers: inline |
Sets the active blend mode. (layer) can be partially applied.
|
Full Usage:
setLineWidth layer width
Parameters:
int<MeasureProduct<RenderLayer, MeasureOne>>
width : float32
Returns: Command2D
Modifiers: inline |
Sets the default line width for thick line primitives.
|
Full Usage:
setScissor layer (x, y, w, h)
Parameters:
int<MeasureProduct<RenderLayer, MeasureOne>>
x : int
y : int
w : int
h : int
Returns: Command2D
Modifiers: inline |
Enables a scissor rectangle. (layer) can be partially applied.
|
Full Usage:
setViewport layer (x, y, w, h)
Parameters:
int<MeasureProduct<RenderLayer, MeasureOne>>
x : int
y : int
w : int
h : int
Returns: Command2D
Modifiers: inline |
Sets the device viewport. (layer) can be partially applied.
|
|
|
|
|
Full Usage:
triangle (layer, color) (v1, v2, v3)
Parameters:
int<MeasureProduct<RenderLayer, MeasureOne>>
color : Color
v1 : Vector2
v2 : Vector2
v3 : Vector2
Returns: Command2D
Modifiers: inline |
Filled triangle from 3 vertices. (layer, color) can be partially applied.
|
Full Usage:
triangleFan (layer, color) points
Parameters:
int<MeasureProduct<RenderLayer, MeasureOne>>
color : Color
points : Vector2[]
Returns: Command2D
Modifiers: inline |
Filled triangle fan. (layer, color) can be partially applied.
|
Full Usage:
triangleStrip (layer, color) points
Parameters:
int<MeasureProduct<RenderLayer, MeasureOne>>
color : Color
points : Vector2[]
Returns: Command2D
Modifiers: inline |
Filled triangle strip. (layer, color) can be partially applied.
|
Mibo