Trail
namespace Griff.Scenes;
public sealed class Trail : Component, IDrawableLeaves fading copies of its entity’s Sprite behind as it moves: dashes, speed, ghosts, bullets with streaks. Copies are left every Interval seconds while it moves at least MinSpeed.
This is a component: its saved properties are on its component page.
Properties
Section titled “Properties”public Color Color { get; set; }A color painted over the copies, e.g. a cyan dash. Transparent keeps the sprite’s own look.
Copies
Section titled “Copies”public IReadOnlyList<TrailCopy> Copies { get; }The copies on screen, oldest first.
Emitting
Section titled “Emitting”public bool Emitting { get; set; }Untick it (from a script, say at the end of a dash) to stop leaving copies; those already left still fade.
public float Fade { get; set; }Seconds each copy takes to fade away.
Interval
Section titled “Interval”public float Interval { get; set; }Seconds between copies.
MinSpeed
Section titled “MinSpeed”public float MinSpeed { get; set; }Only leave copies while moving at least this fast, in world units per second: just the dash, not the walk.
Opacity
Section titled “Opacity”public float Opacity { get; set; }How see-through a fresh copy is, from 0 (invisible) to 1 (as solid as the sprite).
Methods
Section titled “Methods”OpacityOf
Section titled “OpacityOf”public float OpacityOf(TrailCopy copy)How solid a copy is now: Opacity fading to nothing over Fade.