Struct PointLight
- Namespace
- BSGameLib.Game
- Assembly
- BSGameLib.Game.dll
A light. Position is in the logical pixels sprites are drawn in, the ones a sprite's destination rectangle uses, so it stays put when the window or the render target is scaled.
public readonly record struct PointLight : IEquatable<PointLight>
- Implements
- Inherited Members
Remarks
Color's red, green and blue are what the light adds; its alpha is how strongly it clears a Veil sprite.
Set Pulse to make it pulse and Cone to make it a spotlight:
new PointLight(position, color, 1.5f, 200f) { Cone = new LightCone(new Vector2(0, 1), 40f) }.
Constructors
PointLight(Vector2, Color, float, float)
A light. Position is in the logical pixels sprites are drawn in, the ones a sprite's destination rectangle uses, so it stays put when the window or the render target is scaled.
public PointLight(Vector2 Position, Color Color, float Intensity, float Radius)
Parameters
PositionVector2Where the light is.
ColorColorThe light's colour. Its alpha is its strength against veils.
IntensityfloatHow bright it is at its centre. 1 adds the light's full colour.
RadiusfloatHow far it reaches, in the same pixels as
Position.
Remarks
Color's red, green and blue are what the light adds; its alpha is how strongly it clears a Veil sprite.
Set Pulse to make it pulse and Cone to make it a spotlight:
new PointLight(position, color, 1.5f, 200f) { Cone = new LightCone(new Vector2(0, 1), 40f) }.
Properties
Color
The light's colour. Its alpha is its strength against veils.
public Color Color { get; init; }
Property Value
Cone
The cone the light shines in, or null to light every way.
public LightCone? Cone { get; init; }
Property Value
Intensity
How bright it is at its centre. 1 adds the light's full colour.
public float Intensity { get; init; }
Property Value
Position
Where the light is.
public Vector2 Position { get; init; }
Property Value
Pulse
How the light pulses, or null for a steady light.
public LightPulse? Pulse { get; init; }
Property Value
Radius
How far it reaches, in the same pixels as Position.
public float Radius { get; init; }