Vixen
02b45cc4
csharp
public abstract class ComponentDrawer<TValue> where TValue : struct

A row of numeric boxes, one per component, each labelled with its axis.

No guide page documents this yet — the page shows what the code says about itself.

Remarks

One drawer for every fixed-width vector. Two, three or four boxes differ only in how many there are and what the boxes are called, and three near-identical drawers is three places for a mixed-value bug to hide in.

⚠ Mixed is per component. Twenty objects that agree on X and differ on Y show a number and a dash, not two dashes — because the thing the user wants to know is which axis they disagree about, and blanking the row throws that away. This is the affordance that is most often skipped and most missed.

Fields and properties (1)

  • protected abstract IReadOnlyList<string> Axes

    What each box is called.

Methods (5)

  • protected abstract float Component(TValue value, int axis)

    Pulls a component out of a value.

  • protected abstract TValue Replace(TValue value, int axis, float component)

    Puts a component back into a value.

  • public virtual bool CanDraw(InspectorMember member)

    Whether this drawer can edit a member.

  • public UiElement Build(InspectorField field, UiElement parent)

    Makes the controls, once.

  • public void Show(InspectorField field, UiElement editor)

    Puts the current value into controls that already exist.

Used by (4)

  • QuaternionDrawerVixen.Editor.Inspector
  • Vector2DrawerVixen.Editor.Inspector
  • Vector3DrawerVixen.Editor.Inspector
  • Vector4DrawerVixen.Editor.Inspector