FieldMeta
此内容尚不支持你的语言。
Defined in: ecs/component.ts:60
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.
Properties
Section titled “Properties”advanced?
Section titled “advanced?”
optionaladvanced?:boolean
Defined in: ecs/component.ts:113
bitmask?
Section titled “bitmask?”
optionalbitmask?:object
Defined in: ecs/component.ts:85
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.
optionalbits?:number
source?
Section titled “source?”
optionalsource?:string
category?
Section titled “category?”
optionalcategory?:string
Defined in: ecs/component.ts:112
Group under a category header; advanced tucks the field behind a fold.
curve?
Section titled “curve?”
optionalcurve?:boolean
Defined in: ecs/component.ts:74
Render as a scalar over-life curve editor (the field value is { keys: [...] }).
optionalenum?: readonlyobject[]
Defined in: ecs/component.ts:62
Render as a dropdown of these options; the stored value is the option’s int.
enumSource?
Section titled “enumSource?”
optionalenumSource?:string
Defined in: ecs/component.ts:68
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.
flags?
Section titled “flags?”
optionalflags?: readonlyobject[]
Defined in: ecs/component.ts:70
Render as a bitmask multi-select; each option is a single bit.
gradient?
Section titled “gradient?”
optionalgradient?:boolean
Defined in: ecs/component.ts:72
Render as a color-gradient editor (the field value is { stops: [...] }).
label?
Section titled “label?”
optionallabel?:string
Defined in: ecs/component.ts:109
Human label / tooltip overriding the key-derived ones.
optionalmap?:boolean
Defined in: ecs/component.ts:79
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.
optionalmax?:number
Defined in: ecs/component.ts:88
optionalmin?:number
Defined in: ecs/component.ts:87
Hard numeric range — clamps both typed entry and drag-scrub.
normalizedOf?
Section titled “normalizedOf?”
optionalnormalizedOf?:string
Defined in: ecs/component.ts:100
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.
shownWhen?
Section titled “shownWhen?”
optionalshownWhen?:object
Defined in: ecs/component.ts:107
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
Section titled “values”values: readonly
number[]
slider?
Section titled “slider?”
optionalslider?:boolean
Defined in: ecs/component.ts:92
Render the number as a slider; requires a finite min/max.
optionalstep?:number
Defined in: ecs/component.ts:90
Scrub/step granularity (per pixel for drag, per arrow for the input).
tooltip?
Section titled “tooltip?”
optionaltooltip?:string
Defined in: ecs/component.ts:110
optionalunit?:string
Defined in: ecs/component.ts:94
Unit shown after the resting value (e.g. ‘°’, ‘px’, ‘%’).