Light2D

Casts light in a 2D environment.

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 that Light2D can be used as a mask.

@GodotBaseClass
struct Light2D {}

Members

Aliases

BaseClasses
alias BaseClasses = AliasSeq!(typeof(_GODOT_base), typeof(_GODOT_base).BaseClasses)
Undocumented in source.

Enums

Constants
enum Constants
Mode
enum Mode
ShadowFilter
enum ShadowFilter

Functions

getColor
Color getColor()
getEnergy
double getEnergy()
getHeight
double getHeight()
getItemCullMask
long getItemCullMask()
getItemShadowCullMask
long getItemShadowCullMask()
getLayerRangeMax
long getLayerRangeMax()
getLayerRangeMin
long getLayerRangeMin()
getMode
Light2D.Mode getMode()
getShadowBufferSize
long getShadowBufferSize()
getShadowColor
Color getShadowColor()
getShadowFilter
Light2D.ShadowFilter getShadowFilter()
getShadowGradientLength
double getShadowGradientLength()
getShadowSmooth
double getShadowSmooth()
getTexture
Ref!Texture getTexture()
getTextureOffset
Vector2 getTextureOffset()
getTextureScale
double getTextureScale()
getZRangeMax
long getZRangeMax()
getZRangeMin
long getZRangeMin()
isEditorOnly
bool isEditorOnly()
isEnabled
bool isEnabled()
isShadowEnabled
bool isShadowEnabled()
opAssign
Light2D opAssign(T n)
Undocumented in source. Be warned that the author may not have intended to support it.
opEquals
bool opEquals(Light2D other)
Undocumented in source. Be warned that the author may not have intended to support it.
opEquals
bool opEquals(typeof(null) n)
Undocumented in source. Be warned that the author may not have intended to support it.
setColor
void setColor(Color color)
setEditorOnly
void setEditorOnly(bool editor_only)
setEnabled
void setEnabled(bool enabled)
setEnergy
void setEnergy(double energy)
setHeight
void setHeight(double height)
setItemCullMask
void setItemCullMask(long item_cull_mask)
setItemShadowCullMask
void setItemShadowCullMask(long item_shadow_cull_mask)
setLayerRangeMax
void setLayerRangeMax(long layer)
setLayerRangeMin
void setLayerRangeMin(long layer)
setMode
void setMode(long mode)
setShadowBufferSize
void setShadowBufferSize(long size)
setShadowColor
void setShadowColor(Color shadow_color)
setShadowEnabled
void setShadowEnabled(bool enabled)
setShadowFilter
void setShadowFilter(long filter)
setShadowGradientLength
void setShadowGradientLength(double multiplier)
setShadowSmooth
void setShadowSmooth(double smooth)
setTexture
void setTexture(Texture texture)
setTextureOffset
void setTextureOffset(Vector2 texture_offset)
setTextureScale
void setTextureScale(double texture_scale)
setZRangeMax
void setZRangeMax(long z)
setZRangeMin
void setZRangeMin(long z)

Mixins

__anonymous
mixin baseCasts
Undocumented in source.

Properties

color
Color color [@property getter]
Color color [@property setter]

The Light2D's Color.

editorOnly
bool editorOnly [@property getter]
bool editorOnly [@property setter]

If true Light2D will only appear when editing the scene. Default value: false.

enabled
bool enabled [@property getter]
bool enabled [@property setter]

If true Light2D will emit light. Default value: true.

energy
double energy [@property getter]
double energy [@property setter]

The Light2D's energy value. The larger the value, the stronger the light.

mode
Light2D.Mode mode [@property getter]
long mode [@property setter]

The Light2D's mode. See MODE_* constants for values.

offset
Vector2 offset [@property getter]
Vector2 offset [@property setter]

The offset of the Light2D's texture.

rangeHeight
double rangeHeight [@property getter]
double rangeHeight [@property setter]

The height of the Light2D. Used with 2D normal mapping.

rangeItemCullMask
long rangeItemCullMask [@property getter]
long rangeItemCullMask [@property setter]

The layer mask. Only objects with a matching mask will be affected by the Light2D.

rangeLayerMax
long rangeLayerMax [@property getter]
long rangeLayerMax [@property setter]

Maximum layer value of objects that are affected by the Light2D. Default value: 0.

rangeLayerMin
long rangeLayerMin [@property getter]
long rangeLayerMin [@property setter]

Minimum layer value of objects that are affected by the Light2D. Default value: 0.

rangeZMax
long rangeZMax [@property getter]
long rangeZMax [@property setter]

Maximum Z value of objects that are affected by the Light2D. Default value: 1024.

rangeZMin
long rangeZMin [@property getter]
long rangeZMin [@property setter]

Minimum z value of objects that are affected by the Light2D. Default value: -1024.

shadowBufferSize
long shadowBufferSize [@property getter]
long shadowBufferSize [@property setter]

Shadow buffer size. Default value: 2048.

shadowColor
Color shadowColor [@property getter]
Color shadowColor [@property setter]

Color of shadows cast by the Light2D.

shadowEnabled
bool shadowEnabled [@property getter]
bool shadowEnabled [@property setter]

If true the Light2D will cast shadows. Default value: false.

shadowFilter
Light2D.ShadowFilter shadowFilter [@property getter]
long shadowFilter [@property setter]

Shadow filter type. Use SHADOW_FILTER_* constants to set shadow_filter. Default value: None.

shadowFilterSmooth
double shadowFilterSmooth [@property getter]
double shadowFilterSmooth [@property setter]

Smoothing value for shadows.

shadowGradientLength
double shadowGradientLength [@property getter]
double shadowGradientLength [@property setter]

Smooth shadow gradient length.

shadowItemCullMask
long shadowItemCullMask [@property getter]
long shadowItemCullMask [@property setter]

The shadow mask. Used with LightOccluder2D to cast shadows. Only occluders with a matching shadow mask will cast shadows.

textureScale
double textureScale [@property getter]
double textureScale [@property setter]

The texture's scale factor.

Static functions

_new
Light2D _new()
Undocumented in source. Be warned that the author may not have intended to support it.

Static variables

_classBindingInitialized
bool _classBindingInitialized;
Undocumented in source.

Structs

_classBinding
struct _classBinding
Undocumented in source.

Unions

__anonymous
union __anonymous
Undocumented in source.

Variables

_GODOT_internal_name
enum string _GODOT_internal_name;
Undocumented in source.

Mixed In Members

From mixin baseCasts

as
To as()
Undocumented in source. Be warned that the author may not have intended to support it.
as
To as()
Undocumented in source. Be warned that the author may not have intended to support it.
as
ToRef as()
Undocumented in source. Be warned that the author may not have intended to support it.
opCast
template opCast(To)
Undocumented in source.
opCast
template opCast(To)
Undocumented in source.
opCast
template opCast(ToRef)
Undocumented in source.
opCast
void* opCast()
Undocumented in source. Be warned that the author may not have intended to support it.
opCast
godot_object opCast()
Undocumented in source. Be warned that the author may not have intended to support it.
opCast
bool opCast()
Undocumented in source. Be warned that the author may not have intended to support it.

Meta