Struct Light2D
Casts light in a 2D environment.
struct Light2D
;
Light is defined by a (usually grayscale) texture, a color, an energy value, a mode (see constants), and various other parameters (range and shadows-related). Note: Light2D can also be used as a mask.
Properties
Name | Type | Description |
---|---|---|
color [get, set]
|
Color | The Light2D's Color .
|
editorOnly [get, set]
|
bool | If true , Light2D will only appear when editing the scene.
|
enabled [get, set]
|
bool | If true , Light2D will emit light.
|
energy [get, set]
|
double | The Light2D's energy value. The larger the value, the stronger the light. |
mode [get, set]
|
Light2D | The Light2D's mode. See mode constants for values.
|
offset [get, set]
|
Vector2 | The offset of the Light2D's texture .
|
rangeHeight [get, set]
|
double | The height of the Light2D. Used with 2D normal mapping. |
rangeItemCullMask [get, set]
|
long | The layer mask. Only objects with a matching mask will be affected by the Light2D. |
rangeLayerMax [get, set]
|
long | Maximum layer value of objects that are affected by the Light2D. |
rangeLayerMin [get, set]
|
long | Minimum layer value of objects that are affected by the Light2D. |
rangeZMax [get, set]
|
long | Maximum z value of objects that are affected by the Light2D.
|
rangeZMin [get, set]
|
long | Minimum z value of objects that are affected by the Light2D.
|
shadowBufferSize [get, set]
|
long | Shadow buffer size. |
shadowColor [get, set]
|
Color | Color of shadows cast by the Light2D.
|
shadowEnabled [get, set]
|
bool | If true , the Light2D will cast shadows.
|
shadowFilter [get, set]
|
Light2D | Shadow filter type. See shadowfilter for possible values.
|
shadowFilterSmooth [get, set]
|
double | Smoothing value for shadows. |
shadowGradientLength [get, set]
|
double | Smooth shadow gradient length. |
shadowItemCullMask [get, set]
|
long | The shadow mask. Used with LightOccluder2D to cast shadows. Only occluders with a matching light mask will cast shadows.
|
texture [get, set]
|
Texture | Texture used for the Light2D's appearance.
|
textureScale [get, set]
|
double | The texture 's scale factor.
|
Methods
Enums
Name | Description |
---|---|
Constants
|
|
Mode
|
|
ShadowFilter
|