LightCommands Module
Factory functions that create lighting Command2D values.
Light-accumulation commands mutate the LightContext2D
eagerly and return a NoopLight purely for layer-sort ordering.
Functions and values
| Function or value |
Description
|
Full Usage:
addDirectionalLight lightCtx layer light
Parameters:
LightContext2D
layer : int<MeasureProduct<RenderLayer, MeasureOne>>
light : DirectionalLight2D
Returns: Command2D
Modifiers: inline |
Adds a directional light. Mutates the context eagerly.
|
Full Usage:
addOccluder lightCtx layer occluder
Parameters:
LightContext2D
layer : int<MeasureProduct<RenderLayer, MeasureOne>>
occluder : Occluder2D
Returns: Command2D
Modifiers: inline |
Adds an occluder segment. Mutates the context eagerly.
|
Full Usage:
addPointLight lightCtx layer light
Parameters:
LightContext2D
layer : int<MeasureProduct<RenderLayer, MeasureOne>>
light : PointLight2D
Returns: Command2D
Modifiers: inline |
Adds a point light. Mutates the context eagerly.
|
Full Usage:
disableShadows lightCtx layer
Parameters:
LightContext2D
layer : int<MeasureProduct<RenderLayer, MeasureOne>>
Returns: Command2D
Modifiers: inline |
Disables shadows. Mutates the context eagerly.
|
Full Usage:
enableShadows lightCtx layer
Parameters:
LightContext2D
layer : int<MeasureProduct<RenderLayer, MeasureOne>>
Returns: Command2D
Modifiers: inline |
Enables shadows. Mutates the context eagerly.
|
Full Usage:
endLighting lightCtx layer
Parameters:
LightContext2D
layer : int<MeasureProduct<RenderLayer, MeasureOne>>
Returns: Command2D
Modifiers: inline |
Ends the current lighting block, marking uniforms dirty.
|
Full Usage:
litAnimatedSprite lightCtx layer dest animSprite
Parameters:
LightContext2D
layer : int<MeasureProduct<RenderLayer, MeasureOne>>
dest : Rectangle
animSprite : AnimatedSprite
Returns: Command2D
Modifiers: inline |
Draws an animated sprite with the current lighting state. Automatically extracts texture, source rect, origin, rotation, color, and normal map from the AnimatedSprite and its SpriteSheet. Handles FlipX/FlipY by negating the source rect width/height.
|
Full Usage:
litSprite lightCtx sprite
Parameters:
LightContext2D
sprite : SpriteState
Returns: Command2D
Modifiers: inline |
|
Full Usage:
setAmbient lightCtx (layer, ambient)
Parameters:
LightContext2D
layer : int<MeasureProduct<RenderLayer, MeasureOne>>
ambient : AmbientLight2D
Returns: Command2D
Modifiers: inline |
Sets the ambient light color. Mutates the context eagerly.
|
Mibo