Class Light2D
Casts light in a 2D environment.
- Inheritance
-
Light2D
- Derived
Remarks
Casts light in a 2D environment. A light is defined as a color, an energy value, a mode (see constants), and various other parameters (range and shadows-related).
See Also
Properties
blend_mode
The Light2D's blend mode. See BlendMode constants for values.
var blend_mode : int = 0
Property Value
Remarks
color
The Light2D's Color.
var color : Color = Color(1, 1, 1, 1)
Property Value
Remarks
editor_only
If true
, Light2D will only appear when editing the scene.
var editor_only : bool = false
Property Value
Remarks
enabled
If true
, Light2D will emit light.
var enabled : bool = true
Property Value
Remarks
energy
The Light2D's energy value. The larger the value, the stronger the light.
var energy : float = 1.0
Property Value
Remarks
range_item_cull_mask
The layer mask. Only objects with a matching light_mask will be affected by the Light2D. See also shadow_item_cull_mask, which affects which objects can cast shadows.
Note: range_item_cull_mask is ignored by DirectionalLight2D, which will always light a 2D node regardless of the 2D node's light_mask.
var range_item_cull_mask : int = 1
Property Value
Remarks
range_layer_max
Maximum layer value of objects that are affected by the Light2D.
var range_layer_max : int = 0
Property Value
Remarks
range_layer_min
Minimum layer value of objects that are affected by the Light2D.
var range_layer_min : int = 0
Property Value
Remarks
range_z_max
Maximum z
value of objects that are affected by the Light2D.
var range_z_max : int = 1024
Property Value
Remarks
range_z_min
Minimum z
value of objects that are affected by the Light2D.
var range_z_min : int = -1024
Property Value
Remarks
shadow_color
Color of shadows cast by the Light2D.
var shadow_color : Color = Color(0, 0, 0, 0)
Property Value
Remarks
shadow_enabled
If true
, the Light2D will cast shadows.
var shadow_enabled : bool = false
Property Value
Remarks
shadow_filter
Shadow filter type. See ShadowFilter for possible values.
var shadow_filter : int = 0
Property Value
Remarks
shadow_filter_smooth
Smoothing value for shadows. Higher values will result in softer shadows, at the cost of visible streaks that can appear in shadow rendering. shadow_filter_smooth only has an effect if shadow_filter is Light2D.SHADOW_FILTER_PCF5 or Light2D.SHADOW_FILTER_PCF13.
var shadow_filter_smooth : float = 0.0
Property Value
Remarks
shadow_item_cull_mask
The shadow mask. Used with LightOccluder2D to cast shadows. Only occluders with a matching light_mask will cast shadows. See also range_item_cull_mask, which affects which objects can receive the light.
var shadow_item_cull_mask : int = 1
Property Value
Remarks
Methods
get_height
Qualifiers: const
Returns the light's height, which is used in 2D normal mapping. See height and height.
float get_height
set_height(float)
void set_height(float height)
Parameters
height
float