Table of Contents

Class PointLight2D

Namespace
LibGFX.Graphics.Lights
Assembly
LibGFX.dll

Represents a 2D point light in the scene.

public class PointLight2D : Light, IIdentifier, ISerialization
Inheritance
PointLight2D
Implements
Inherited Members

Constructors

PointLight2D()

Initializes a new instance of the PointLight2D class.

public PointLight2D()

PointLight2D(Vector2, Vector3, float, float)

Creates a new instance of the PointLight2D class.

public PointLight2D(Vector2 position, Vector3 color, float radius, float intensity)

Parameters

position Vector2
color Vector3
radius float
intensity float

Properties

HasShadowMap

Determines if the light has a shadow map.

public override bool HasShadowMap { get; }

Property Value

bool

Radius

The Radius of the light.

public float Radius { get; set; }

Property Value

float

Methods

Deserialize(JObject, SerializationContext, Func<JObject, bool>)

Populates the object's properties from the specified JSON object using the provided serialization context.

public override void Deserialize(JObject obj, SerializationContext serializationContext, Func<JObject, bool> callback = null)

Parameters

obj JObject
serializationContext SerializationContext

A SerializationContext that provides context or settings for the deserialization process.

callback Func<JObject, bool>

Dispose(IRenderDevice)

Releases all resources used by the object and performs any necessary cleanup using the specified render device.

public override void Dispose(IRenderDevice renderer)

Parameters

renderer IRenderDevice

The render device to use for releasing graphics resources. Cannot be null.

Remarks

Call this method when the object is no longer needed to free associated resources. After calling this method, the object should not be used.

Init(IRenderDevice)

Initializes the object using the specified render device.

public override void Init(IRenderDevice renderer)

Parameters

renderer IRenderDevice

The render device to use for initialization. Cannot be null.

Serialize(JsonWriter, SerializationContext, Action<JsonWriter>)

Serializes the current light object to a JSON representation suitable for storage or transmission.

public override void Serialize(JsonWriter writer, SerializationContext serializationContext, Action<JsonWriter> callback = null)

Parameters

writer JsonWriter
serializationContext SerializationContext

The context that provides information and services required for serialization.

callback Action<JsonWriter>

ToStruct()

Converts the light data to a structure for use in the shader.

public Point2DLightData ToStruct()

Returns

Point2DLightData