Skip to content

API Type FieldChoices

github-actions[bot] edited this page Nov 24, 2026 · 1 revision

Type Alias: FieldChoices

type FieldChoices = 
  | readonly (string | number)[]
  | Readonly<Record<string, string | number>>
  | ((settings) => 
  | readonly (string | number)[]
  | Readonly<Record<string, string | number>>);

Defined in: src/engine/core/registry.ts:68

The values a field may take, shown as a dropdown in the editor (ADR 0042):

  • a list of values: ["dynamic", "kinematic", "static"] or [1, 2, 4];
  • an object of labels to values, such as a TypeScript enum: { Idle: 0, Run: 1 } (a numeric enum's reverse entries are skipped);
  • a function of the project settings, for lists that live there: (s) => s.render.sortingLayers, or labelled, (s) => ({ Default: 1, Enemy: 2 }) (label = key; every entry is kept).

Choices only guide the editor; scene files and scripts may still hold other values.

Clone this wiki locally