Skip to content
pixi-silk
GitHub repository
Entry point

pixi-silk/ui/inspector

Inspector: property fields bound to the selection.

import { ChoiceField, ColorField, Field, Inspector } from 'pixi-silk/ui/inspector';

Classes#

ClassDescription
ChoiceFieldSegmented choices: a thumb slides to the chosen one and stretches on the way, like SegmentedSwitch, but it fills its row and shows no thumb for mixed values.
ColorFieldA colour swatch and its hex code. A press opens the colour picker.
FieldA field: a box of a given size that shows values and edits them. It holds no data. It shows what Field.show gives it and reports edits through its options. The Inspector builds these.
InspectorA property inspector built from a schema. Rows hold number fields you scrub or type, text fields, switches, segmented choices, colour swatches with a picker and vector rows with an aspect lock. Sections fold. It edits whatever its InspectorBinding points at: one object, a multi-selection (differing values show as Mixed) or a set of signals.
NumberFieldA number you drag or type. Drag sideways to scrub: Shift is ten times faster, Alt ten times finer. Click without dragging to type a value. Mixed values scrub together, each from its own start.
TextFieldA one-line text field, edited in place with a TextEditor.
ToggleFieldAn on and off switch with a springy knob. Mixed values park the knob in the middle.
VectorFieldTwo number fields in a row, such as X and Y or W and H, with an optional aspect lock.

Interfaces#

InterfaceDescription
ChoiceFieldOptionsOptions of ChoiceField.
ChoiceFieldSpecSegmented choices.
ChoiceOptionOne choice of a ChoiceField.
ColorFieldOptionsOptions of ColorField.
ColorFieldSpecA colour swatch that opens a colour picker. Values are 0xRRGGBB numbers.
FieldContextWhat every field needs from the inspector around it.
FieldEditThe callbacks of a field’s edit gesture: one begin, any number of input, one end.
FieldValueWhat a field shows for a list of values: the shared value, or mixed when they differ.
InspectorBindingWhere an inspector reads and writes values. read returns one value per edited object, so a multi-selection shows mixed values. Write your own to edit a store, or use bindObjects and bindSignals.
InspectorOptionsOptions of Inspector.
InspectorStateThe reactive state of an Inspector.
NumberFieldOptionsOptions of NumberField.
NumberFieldSpecA number you scrub or type.
SectionSpecA titled group of fields that folds.
TextFieldOptionsOptions of TextField.
TextFieldSpecA one-line text field.
ToggleFieldOptionsOptions of ToggleField.
ToggleFieldSpecAn on and off switch.
VectorFieldOptionsOptions of VectorField.
VectorFieldSpecTwo numbers in one row, such as X and Y, or W and H with an aspect lock.
WritableSignalA signal the inspector can write.

Type Aliases#

Type AliasDescription
ColorPickerFactorySomething a colour picker popover shows: a Pixi container that edits a ColorModel.
InspectorFieldOne entry of an inspector schema.

Functions#

FunctionDescription
bindObjectsEdits plain objects or display objects. Keys are dot paths, such as position.x, alpha or style.fill. Pass the selection’s items to edit several objects at once. The list is copied. The binding does not watch the objects: call Inspector.refresh after changing them elsewhere.
bindSignalsEdits signals, one per key: a settings panel for app state. Changes made elsewhere show in the inspector at once.
fieldValueFolds the values of a multi-selection into what one field shows. Numbers within epsilon count as equal.
getPathThe value at a dot path such as position.x. Undefined when a step on the way is missing.
setPathSets the value at a dot path such as position.x. Missing objects on the way are not created, and the write is skipped.