reckfellENGINE

DirectionalLight2D

Directional 2D light from a distance.

On this page
class DirectionalLight2DReckfellSharpInherits Light2D

Directional 2D light from a distance.

A directional light is a type of 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: 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 CanvasItem.LightMask.

Declarations checked against C# SDK 1.0.0. Expand a name to see declarations and documentation.

Constructors1

DirectionalLight2DConstructor
# DirectionalLight2D
C#
public DirectionalLight2D();

Properties2

HeightProperty
# Height
C#
public float Height { get; set; }

The height of the light. Used with 2D normal mapping. Ranges from 0 (parallel to the plane) to 1 (perpendicular to the plane).

MaxDistanceProperty
# MaxDistance
C#
public float MaxDistance { get; set; }

The maximum distance from the camera center objects can be before their shadows are culled (in pixels). Decreasing this value can prevent objects located outside the camera from casting shadows (while also improving performance). Camera2D.Zoom is not taken into account by DirectionalLight2D.MaxDistance, which means that at higher zoom values, shadows will appear to fade out sooner when zooming onto a given point.

Methods2

GetMaxDistancefloat
# GetMaxDistance
C#
public float GetMaxDistance();
Returns float
SetMaxDistancevoid
# SetMaxDistance
C#
public void SetMaxDistance(float pixels);
Parameters
NameTypeDefault
pixelsfloat—
Reckfell Engine documentationBack to top ↑
QUICK LINKSGetting startedEntity hierarchyC# & .NET 10Scenes and prefabs
Reckfell guides and full API K
reckfellENGINE
RECKFELL ACCOUNT

Sign in

Sign in to your Reckfell account.

One account for the entire Reckfell platform.