Skip to content

PointLight2D

Inherits: Light2D < Entity2D < CanvasItem < Entity < Object

Positional 2D light source.

Casts light in a 2D environment. This light’s shape is defined by a (usually grayscale) texture.

Type Name Default
float height 0.0
Vector2 offset Vector2(0, 0)
Texture2D texture
float texture_scale 1.0

height

float height = 0.0

The height of the light. Used with 2D normal mapping. The units are in pixels, e.g. if the height is 100, then it will illuminate an object 100 pixels away at a 45° angle to the plane.

offset

Vector2 offset = Vector2(0, 0)

The offset of the light’s texture.

texture

Texture2D texture

Texture2D used for the light’s appearance.

texture_scale

float texture_scale = 1.0

The texture’s scale factor.