Class PointLight2D
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
Properties
HasShadowMap
Determines if the light has a shadow map.
public override bool HasShadowMap { get; }
Property Value
Radius
The Radius of the light.
public float Radius { get; set; }
Property Value
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
objJObjectserializationContextSerializationContextA SerializationContext that provides context or settings for the deserialization process.
callbackFunc<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
rendererIRenderDeviceThe 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
rendererIRenderDeviceThe 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
writerJsonWriterserializationContextSerializationContextThe context that provides information and services required for serialization.
callbackAction<JsonWriter>
ToStruct()
Converts the light data to a structure for use in the shader.
public Point2DLightData ToStruct()