Attention: Here be dragons

This is the latest (unstable) version of this documentation, which may document features not available in or compatible with released stable versions of Godot.

PointLight2D

Inherits: Light2D < Node2D < CanvasItem < Node < Object

Positional 2D light source.

描述

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

教程

属性

float

height

0.0

Vector2

offset

Vector2(0, 0)

Texture2D

texture

float

texture_scale

1.0


Property Descriptions

float height = 0.0

  • void set_height ( float value )

  • float get_height ( )

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.


Vector2 offset = Vector2(0, 0)

  • void set_texture_offset ( Vector2 value )

  • Vector2 get_texture_offset ( )

The offset of the light's texture.


Texture2D texture

Texture2D used for the light's appearance.


float texture_scale = 1.0

  • void set_texture_scale ( float value )

  • float get_texture_scale ( )

The texture's scale factor.