跳转到内容

FieldMeta

此内容尚不支持你的语言。

Defined in: ecs/component.ts:63

Per-field editor presentation metadata — the engine’s UPROPERTY analog. A component declares it once at its definition site; the editor’s inspector reads it via getComponentFieldMeta and renders the matching control, falling back to value-shape inference for any field without metadata. None of this is read by the runtime (which stores raw values); it is purely authoring policy co-located with the component so the inspector and the data never diverge.

optional advanced?: boolean

Defined in: ecs/component.ts:127


optional bitmask?: object

Defined in: ecs/component.ts:99

Render as a bitmask whose bit LABELS are resolved by the editor (e.g. named collision layers from project settings) rather than fixed here. bits is the count (default 32); source names the editor’s label provider.

optional bits?: number

optional source?: string


optional category?: string

Defined in: ecs/component.ts:126

Group under a category header; advanced tucks the field behind a fold.


optional curve?: boolean

Defined in: ecs/component.ts:84

Render as a scalar over-life curve editor (the field value is { keys: [...] }).


optional effectStack?: boolean

Defined in: ecs/component.ts:93

Render as a post-process effect stack (the field value is the effects array). The rows, their parameters and their ranges come from the effect registry, so an effect the engine gains is authorable without touching the editor.


optional enum?: readonly object[]

Defined in: ecs/component.ts:65

Render as a dropdown of these options; the stored value is the option’s int.


optional enumSource?: string

Defined in: ecs/component.ts:71

Render as a dropdown whose options are resolved by the editor from a named source (e.g. project sorting layers) — falls back to a plain number when the source yields none, so free-int editing survives a project with no named set.


optional flags?: readonly object[]

Defined in: ecs/component.ts:80

Render as a bitmask multi-select; each option is a single bit.


optional gradient?: boolean

Defined in: ecs/component.ts:82

Render as a color-gradient editor (the field value is { stops: [...] }).


optional label?: string

Defined in: ecs/component.ts:123

Human label / tooltip overriding the key-derived ones.


optional labelSource?: string

Defined in: ecs/component.ts:78

Names a registered source of LABELS for the entries of a LIST field: the inspector shows a row per entry under the name that source gives it (a morph weight under its shape’s name). The labels come from elsewhere — a mesh’s own targets — which is why the field cannot state them itself.


optional map?: boolean

Defined in: ecs/component.ts:89

Render as a key→value string map editor (the field value is Record<string,string>) — arbitrary user properties (e.g. a Marker’s gameplay data), like Tiled’s custom properties. Value-shape inference can’t tell a property map from any other object, so a field must opt in here.


optional max?: number

Defined in: ecs/component.ts:102


optional min?: number

Defined in: ecs/component.ts:101

Hard numeric range — clamps both typed entry and drag-scrub.


optional normalizedOf?: string

Defined in: ecs/component.ts:114

This field is a fraction of the named sibling, axis-wise (Sprite.pivot of Sprite.size), so the editor can offer a pixel view of it. The stored value stays the fraction. Authored normalized_of= at the C++ ES_PROPERTY site.


optional shownWhen?: object

Defined in: ecs/component.ts:121

The states of a sibling discriminator this field means anything in — a Spot’s cone angles to type: Spot. The inspector hides it elsewhere and leaves the stored value alone. Authored shown_when=<field>:<State> by NAME at the C++ ES_PROPERTY site; the names resolve to stored numbers when this is generated.

field: string

values: readonly number[]


optional slider?: boolean

Defined in: ecs/component.ts:106

Render the number as a slider; requires a finite min/max.


optional step?: number

Defined in: ecs/component.ts:104

Scrub/step granularity (per pixel for drag, per arrow for the input).


optional tooltip?: string

Defined in: ecs/component.ts:124


optional unit?: string

Defined in: ecs/component.ts:108

Unit shown after the resting value (e.g. ‘°’, ‘px’, ‘%’).