24 private readonly List<DirectRadialLight> _lights = [];
43 RenderSurfaceHost = renderSurfaceHost ??
throw new ArgumentNullException(nameof(renderSurfaceHost));
44 SceneLayer = sceneLayer ??
throw new ArgumentNullException(nameof(sceneLayer));
60 public IReadOnlyList<DirectRadialLight>
Lights => _lights;
79 string? nickname =
null)
82 color ?? Color.FromArgb(180, 255, 190, 80),
90 BlendMode = SKBlendMode.Screen,
91 HotspotRadiusRatio = 0.06f,
92 MidpointRadiusRatio = 0.55f,
93 MidpointIntensityRatio = 0.35f
108 if (!_lights.Remove(light))
121 foreach (var light
in _lights.ToArray())
void Dispose()
Releases all resources used by this DirectDrawingBase instance.
Action< DirectRadialLight >? LightRemoving
Occurs before a light is disposed and removed from this owner.
int DefaultZOrder
Gets or sets the Z-order assigned to newly-created lights.
IReadOnlyList< DirectRadialLight > Lights
Gets the lights owned by this layer.
void Clear()
Disposes every light owned by this layer.
DirectRadialLight AddTorchLight(PointF centerWorldPx, float radiusWorldPx, Color? color=null, string? nickname=null)
Creates a warm, screen-blended torch-style light.
RenderSurfaceHostBase RenderSurfaceHost
Gets the render surface host used by lights created from this owner.
Action< DirectRadialLight >? LightAdded
Occurs after a light has been added to this owner.
bool Remove(DirectRadialLight light)
Removes and disposes a light owned by this layer.
DirectLightLayer(RenderSurfaceHostBase renderSurfaceHost, SceneLayer sceneLayer)
Initializes a new light owner for the given render surface and scene layer.
SceneLayer SceneLayer
Gets the scene layer where lights are drawn.
Draws a bounded, radial light effect as a scene-layer direct drawing.
Represents a base class for hosting a render surface, providing functionality for managing rendering ...