Class ShapeGlow
A soft glow outside a shape's outline. Glow holds one; each draw call captures its values as it is made.
public sealed class ShapeGlow
- Inheritance
-
ShapeGlow
Examples
shapes.Glow.Set(8f, new Color(0, 0, 0, 200)); // a dark halo
shapes.DrawRing(cursor, Vector3.UnitY, 0.9f, Color.White);
shapes.Glow.Clear();
Remarks
The glow shows outside the shape only, under the fill and the border, and fades out quadratically from the border's outer edge over Width pixels at any distance. For a stroke-only ring or arc the shape is the stroke, so the glow sits on both sides of it.
Properties
Additive
Whether the glow adds its light to whatever is behind it rather than covering it. Off by default: a glow then behaves like a soft, translucent halo that can darken as well as lighten. On, it is a neon bloom that only ever brightens - a black glow adds nothing.
public bool Additive { get; set; }
Property Value
Color
The glow's colour, or null (the default) to glow in the outline colour. Its alpha is the
glow's strength at the outline: full alpha reads as a fatter stroke, 30 to 40 percent as neon.
public Color? Color { get; set; }
Property Value
Strength
How strong a glow in the outline colour is at the outline, 0 to 1. The default 1 reads as a
fatter stroke; 0.35f reads as neon. Ignored when Color is set.
public float Strength { get; set; }
Property Value
Width
Width of the glow in on-screen pixels. The default 0 draws none. A few pixels reads as a crisp halo and a few dozen as a neon bloom.
public float Width { get; set; }
Property Value
Methods
Clear()
No glow, back to the outline colour at full strength, and not additive.
public void Clear()
Set(float, Color?)
Sets both at once.
public void Set(float width, Color? color = null)