Skip to content

DirectionAttribute

namespace Griff.Scenes;
public sealed class DirectionAttribute : FieldEditorAttribute

Marks a Vector2 as a direction, e.g. which way a shooter fires or a bouncer launches: (0, 1) is up and (1, 0) right. The Inspector adds a compass of the eight ways to pick from, and with Distance Handles (D) the Scene view draws it as an arrow from the entity with a knob to drag round.

public override string FitsText { get; }
public string? None { get; init; }

What (0, 0) means, for a direction that may be none, e.g. “straight away from its middle”: the compass offers it.

public bool Turned { get; init; }

It’s in the entity’s own space, turned with it (a plunger’s, a bumper’s), rather than the world’s: the Scene view draws it turned, and a drag sets it back in the entity’s own.

public override string Describe()
public override bool Fits(Type type)