Documentation
¶
Overview ¶
A directional light is a type of graphics.gd/classdb/Light2D node that models an infinite number of parallel rays covering the entire scene. It is used for lights with strong intensity that are located far away from the scene (for example: to model sunlight or moonlight).
Light is emitted in the +Y direction of the node's global basis. For an unrotated light, this means that the light is emitted downwards. The position of the node is ignored; only the basis is used to determine light direction.
Note: graphics.gd/classdb/DirectionalLight2D does not support light cull masks (but it supports shadow cull masks). It will always light up 2D nodes, regardless of the 2D node's graphics.gd/classdb/CanvasItem.Instance.LightMask.
Index ¶
- type Advanced
- type Any
- type Extension
- func (self *Extension[T]) AsCanvasItem() CanvasItem.Instance
- func (self *Extension[T]) AsDirectionalLight2D() Instance
- func (self *Extension[T]) AsLight2D() Light2D.Instance
- func (self *Extension[T]) AsNode() Node.Instance
- func (self *Extension[T]) AsNode2D() Node2D.Instance
- func (self *Extension[T]) AsObject() [1]gd.Object
- type ID
- type Instance
- func (self Instance) AsCanvasItem() CanvasItem.Instance
- func (self Instance) AsDirectionalLight2D() Instance
- func (self Instance) AsLight2D() Light2D.Instance
- func (self Instance) AsNode() Node.Instance
- func (self Instance) AsNode2D() Node2D.Instance
- func (self Instance) AsObject() [1]gd.Object
- func (self Instance) ID() ID
- func (self Instance) MaxDistance() Float.X
- func (self Instance) SetMaxDistance(value Float.X)
- func (self *Instance) SetObject(obj [1]gd.Object) bool
- func (self Instance) Virtual(name string) reflect.Value
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Advanced ¶
type Advanced = class
Advanced exposes a 1:1 low-level instance of the class, undocumented, for those who know what they are doing.
type Extension ¶
Extension can be embedded in a new struct to create an extension of this class. T should be the type that is embedding this Extension
func (*Extension[T]) AsCanvasItem ¶
func (self *Extension[T]) AsCanvasItem() CanvasItem.Instance
func (*Extension[T]) AsDirectionalLight2D ¶
type ID ¶
ID is a typed object ID (reference) to an instance of this class, use it to store references to objects with unknown lifetimes, as an ID will not panic on use if the underlying object has been destroyed.
type Instance ¶
type Instance [1]gdclass.DirectionalLight2D
Instance of the class with convieniently typed arguments and results.
var Nil Instance
Nil is a nil/null instance of the class. Equivalent to the zero value.
func (Instance) AsCanvasItem ¶
func (self Instance) AsCanvasItem() CanvasItem.Instance