Scripting API

Scripting API

WorldLights2D

Struct in Abyss.Core, from Abyss.Core.

2D lights, as a game asks them: how lit a point is by its Global Light 2Ds and the Point Light 2Ds that reach it, through the shadows they are drawn with — what hides a character in darkness and shows it in light.

public readonly struct WorldLights2D

Remarks

A light hidden, or with no intensity, lights nothing; one on any layer counts, whichever cameras draw it. What is worked out is the world as it is when asked, the lights and what casts shadows where they are then.

Constructors

WorldLights2D

public WorldLights2D(World world)

2D lights, as a game asks them: how lit a point is by its Global Light 2Ds and the Point Light 2Ds that reach it, through the shadows they are drawn with — what hides a character in darkness and shows it in light.

Parameters

  • world: The world they are in.

A light hidden, or with no intensity, lights nothing; one on any layer counts, whichever cameras draw it. What is worked out is the world as it is when asked, the lights and what casts shadows where they are then.

Methods

LightAt

public Vector3 LightAt(Vector2 point)

How lit point is, linear red, green and blue: what multiplies what is drawn there, 1 as drawn, 0 dark, more than 1 brighter.

Parameters

  • point

Exceptions

  • AbyssException: AbyssStatus.InvalidLight for a point that is not one.

BrightnessAt

public float BrightnessAt(Vector2 point)

How bright point is: its light as an eye weighs red, green and blue, 1 as drawn and 0 dark. A character hidden below a game's own threshold, say a quarter.

Parameters

  • point

Exceptions