Table of Contents

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

Position Vector2

Where the light is.

Color Color

The light's colour. Its alpha is its strength against veils.

Intensity float

How bright it is at its centre. 1 adds the light's full colour.

Radius float

How 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

Color

Cone

The cone the light shines in, or null to light every way.

public LightCone? Cone { get; init; }

Property Value

LightCone?

Intensity

How bright it is at its centre. 1 adds the light's full colour.

public float Intensity { get; init; }

Property Value

float

Position

Where the light is.

public Vector2 Position { get; init; }

Property Value

Vector2

Pulse

How the light pulses, or null for a steady light.

public LightPulse? Pulse { get; init; }

Property Value

LightPulse?

Radius

How far it reaches, in the same pixels as Position.

public float Radius { get; init; }

Property Value

float