Skip to content

PointsAttribute

namespace Griff.Scenes;
public sealed class PointsAttribute : FieldEditorAttribute

Marks a string property as a list of points, “x y” pairs separated by semicolons (“4 0; 4 3; 0 3”): the Inspector lists them a row each, with X and Y to set, and adds, removes and reorders them. The Scene view puts a handle on each where it knows what they’re relative to (a mover’s path, a polygon’s corners).

public bool Cells { get; init; }

They’re whole cells of a grid (a grid patrol’s), so they take whole numbers.

public bool FromStart { get; init; }

They’re a path from where the entity is placed, whose start (0 0) comes first without being listed.

public int Least { get; init; }

The fewest it can have, e.g. 3 for a polygon’s corners. Removing stops there.

public override string Describe()
public override string? Problem(Component component, object? value)
public static IReadOnlyList<Vector2> Read(string? text)

Reads “x y; x y” (see ParsePoints).