aego/lighting
Use SetEnabled to compare the lit image with the original albedo. SetDebug accepts lighting, normals or shadows; invalid names fault before changing the view. Enabled and Debug read the current view state. These calls do not edit material assets, scene components or gameplay state.
package demo
import (
"aego/lighting"
"aego/log"
)
script InspectLighting {
func Ready() {
lighting.SetEnabled(true)
lighting.SetDebug("normals")
log.Info("Lighting display: " + lighting.Debug())
}
}
Light components use the regular typed API and animation property paths. For example, Light2D.intensity, Light2D.range, Light2D.color and the cone angles can be animated with Tween or Animation. In the MaterialOverride track, select the declared Lit parameter by name: NormalStrength, EmissionIntensity or ReceiveShadows. A normal-map or cookie reference is a texture resource, not a numerical instance override.
A lamp in the platformer
Open examples/platformer, whose main level contains the canonical lighting demonstration. Its lamp sprites use emission for their own appearance and separate Light2D components to illuminate nearby surfaces. Platforms and walls supply manual shadow contours. HUD and menus remain Unlit. The project includes actual albedo, normal and height source assets with .meta identities.
Change a lamp's colour, height or range, then use Undo/Redo, Play and the registered lighting debug actions. Bloom on the main camera spreads bright lamp and spark pixels into a halo. The lamp’s Light2D illuminates neighbouring surfaces. Export this project for native or web using the normal strict export workflow. The website demo is built from the same platformer export, with no independently edited copy of its level.
On this page
Functions
| Debug | () string | Returns this world's view debug display: lighting, normals or shadows. |
| Enabled | () bool | Returns whether this world's current view applies lighting. |
| SetDebug | (mode string) | Selects the view debug display: lighting, normals or shadows. This does not mutate the scene. |
| SetEnabled | (enabled bool) | Enables or bypasses lighting in this world's current view without changing scene materials or simulation. |
Debug function
func Debug() string
Returns this world's view debug display: lighting, normals or shadows.
See the module example for this function in use.
Enabled function
func Enabled() bool
Returns whether this world's current view applies lighting.
See the module example for this function in use.
SetDebug function
func SetDebug(mode string)
Selects the view debug display: lighting, normals or shadows. This does not mutate the scene.
See the module example for this function in use.
SetEnabled function
func SetEnabled(enabled bool)
Enables or bypasses lighting in this world's current view without changing scene materials or simulation.
See the module example for this function in use.