Skip to content

GraphicsAPI reference

Class ParticleSpec

Namespace: MicroEngine.Graphics
Assembly: MicroEngine.Graphics2D.dll
Guide: Graphics

How a burst of particles looks and moves. Ranges are (min, max).

C#
public sealed record ParticleSpec : IEquatable<ParticleSpec>

Inheritance

object ← ParticleSpec

Implements

IEquatable<ParticleSpec>

Constructors

ParticleSpec()

C#
public ParticleSpec()

Properties

Angle

Emission angle range in radians (0 = right, -PI/2 = up).

C#
public (float Min, float Max) Angle { get; init; }

Property Value

(float Min, float Max)

Drag

Velocity multiplier per second (1 = no drag).

C#
public float Drag { get; init; }

Property Value

float

EndColor

Colour at death, blended linearly from StartColor (transparent white by default).

C#
public Color EndColor { get; init; }

Property Value

Color

Gravity

Downward acceleration in pixels per second squared (0 by default; negative values rise).

C#
public float Gravity { get; init; }

Property Value

float

Life

Lifetime range in seconds (0.3 to 0.6 by default).

C#
public (float Min, float Max) Life { get; init; }

Property Value

(float Min, float Max)

Round

Draws circles instead of pixel-aligned squares.

C#
public bool Round { get; init; }

Property Value

bool

Size

Size in pixels at birth and at death (2 to 1 by default). Particles smaller than 0.2 pixels are not drawn.

C#
public (float Start, float End) Size { get; init; }

Property Value

(float Start, float End)

Speed

Initial speed range in pixels per second (20 to 60 by default).

C#
public (float Min, float Max) Speed { get; init; }

Property Value

(float Min, float Max)

Spread

Random spread of the spawn position around the emit point.

C#
public float Spread { get; init; }

Property Value

float

StartColor

Colour at birth (white by default).

C#
public Color StartColor { get; init; }

Property Value

Color

Methods

<Clone>$()

C#
public ParticleSpec <Clone>$()

Returns

ParticleSpec

Equals(object?)

C#
public override bool Equals(object? obj)

Parameters

obj object?

Returns

bool

Equals(ParticleSpec?)

C#
public bool Equals(ParticleSpec? other)

Parameters

other ParticleSpec?

Returns

bool

GetHashCode()

C#
public override int GetHashCode()

Returns

int

ToString()

C#
public override string ToString()

Returns

string

Operators

operator ==(ParticleSpec?, ParticleSpec?)

C#
public static bool operator ==(ParticleSpec? left, ParticleSpec? right)

Parameters

left ParticleSpec?

right ParticleSpec?

Returns

bool

operator !=(ParticleSpec?, ParticleSpec?)

C#
public static bool operator !=(ParticleSpec? left, ParticleSpec? right)

Parameters

left ParticleSpec?

right ParticleSpec?

Returns

bool