Gondwana Game Engine Development (master) - 2.6.1
Gondwana is a cross-platform 2.5D game and rendering engine written in C#/.NET 8. It provides fine-grained control over rendering, timing, and scene composition, with built-in support for parallax, z-ordering, pixel overhang, collision detection, and particle effects. Gondwana targets desktop and web platforms using SkiaSharp for graphics and pluggable audio backends for desktop and browser targets.
Loading...
Searching...
No Matches
Gondwana.Drawing.Direct.DirectLightLayer Class Referencesealed

Convenience owner for a group of scene-layer radial lights. More...

Inheritance diagram for Gondwana.Drawing.Direct.DirectLightLayer:

Public Member Functions

 DirectLightLayer (RenderSurfaceHostBase renderSurfaceHost, SceneLayer sceneLayer)
 Initializes a new light owner for the given render surface and scene layer.
DirectRadialLight AddTorchLight (PointF centerWorldPx, float radiusWorldPx, Color? color=null, string? nickname=null)
 Creates a warm, screen-blended torch-style light.
bool Remove (DirectRadialLight light)
 Removes and disposes a light owned by this layer.
void Clear ()
 Disposes every light owned by this layer.
void Dispose ()

Properties

RenderSurfaceHostBase RenderSurfaceHost [get]
 Gets the render surface host used by lights created from this owner.
SceneLayer SceneLayer [get]
 Gets the scene layer where lights are drawn.
IReadOnlyList< DirectRadialLight > Lights [get]
 Gets the lights owned by this layer.
int DefaultZOrder = 10_000 [get, set]
 Gets or sets the Z-order assigned to newly-created lights.

Events

Action< DirectRadialLight >? LightAdded
 Occurs after a light has been added to this owner.
Action< DirectRadialLight >? LightRemoving
 Occurs before a light is disposed and removed from this owner.

Detailed Description

Convenience owner for a group of scene-layer radial lights.

This is intentionally not a new SceneLayer type. Each light is still a bounded DirectRadialLight registered with DirectDrawingManager, so the existing scene-layer drawable query can include only lights whose world bounds intersect the dirty world rect.

Use this class when a game wants a clear logical owner for torch/lamp lights without changing the renderer's composition model.

Definition at line 22 of file DirectLightLayer.cs.

Constructor & Destructor Documentation

◆ DirectLightLayer()

Gondwana.Drawing.Direct.DirectLightLayer.DirectLightLayer ( RenderSurfaceHostBase renderSurfaceHost,
SceneLayer sceneLayer )

Initializes a new light owner for the given render surface and scene layer.

Parameters
renderSurfaceHostThe render-surface host that owns the drawing.
sceneLayerThe scene layer that owns the content.

Definition at line 41 of file DirectLightLayer.cs.

Member Function Documentation

◆ AddTorchLight()

DirectRadialLight Gondwana.Drawing.Direct.DirectLightLayer.AddTorchLight ( PointF centerWorldPx,
float radiusWorldPx,
Color? color = null,
string? nickname = null )

Creates a warm, screen-blended torch-style light.

Parameters
centerWorldPxThe center in world pixels.
radiusWorldPxThe radius in world pixels.
colorThe color to apply.
nicknameAn optional name used to identify the object.
Returns
The radial light added to the light layer.

Definition at line 75 of file DirectLightLayer.cs.

◆ Clear()

void Gondwana.Drawing.Direct.DirectLightLayer.Clear ( )

Disposes every light owned by this layer.

Definition at line 119 of file DirectLightLayer.cs.

◆ Dispose()

void Gondwana.Drawing.Direct.DirectLightLayer.Dispose ( )

Definition at line 128 of file DirectLightLayer.cs.

◆ Remove()

bool Gondwana.Drawing.Direct.DirectLightLayer.Remove ( DirectRadialLight light)

Removes and disposes a light owned by this layer.

Parameters
lightThe light.
Returns
true if the entry was found and removed; otherwise, false.

Definition at line 106 of file DirectLightLayer.cs.

Property Documentation

◆ DefaultZOrder

int Gondwana.Drawing.Direct.DirectLightLayer.DefaultZOrder = 10_000
getset

Gets or sets the Z-order assigned to newly-created lights.

Definition at line 65 of file DirectLightLayer.cs.

◆ Lights

IReadOnlyList<DirectRadialLight> Gondwana.Drawing.Direct.DirectLightLayer.Lights
get

Gets the lights owned by this layer.

Definition at line 60 of file DirectLightLayer.cs.

◆ RenderSurfaceHost

RenderSurfaceHostBase Gondwana.Drawing.Direct.DirectLightLayer.RenderSurfaceHost
get

Gets the render surface host used by lights created from this owner.

Definition at line 50 of file DirectLightLayer.cs.

◆ SceneLayer

SceneLayer Gondwana.Drawing.Direct.DirectLightLayer.SceneLayer
get

Gets the scene layer where lights are drawn.

Definition at line 55 of file DirectLightLayer.cs.

Event Documentation

◆ LightAdded

Action<DirectRadialLight>? Gondwana.Drawing.Direct.DirectLightLayer.LightAdded

Occurs after a light has been added to this owner.

Definition at line 29 of file DirectLightLayer.cs.

◆ LightRemoving

Action<DirectRadialLight>? Gondwana.Drawing.Direct.DirectLightLayer.LightRemoving

Occurs before a light is disposed and removed from this owner.

Definition at line 34 of file DirectLightLayer.cs.