Field
import { Field } from 'pixi-silk/ui/inspector';
A 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.
Extends#
Container
Extended by#
Constructors#
Constructor#
new Field(ctx: FieldContext, label: string): Field;
Parameters#
| Parameter | Type |
|---|---|
ctx | FieldContext |
label | string |
Returns#
Field
Overrides#
Container.constructor
Accessors#
fieldWidth#
Get Signature#
get fieldWidth(): number;
Width of the field box. Default 120 until Field.resize.
Returns
number
Methods#
destroy()#
destroy(options?: DestroyOptions): void;
Stops the animation. Destroys children unless options says otherwise.
Parameters#
| Parameter | Type |
|---|---|
options? | DestroyOptions |
Returns#
void
Overrides#
Container.destroy
resize()#
resize(width: number, height: number): void;
Sets the size of the field box and redraws.
Parameters#
| Parameter | Type |
|---|---|
width | number |
height | number |
Returns#
void
setEnabled()#
setEnabled(on: boolean): void;
False dims the field and ignores input, while nothing is edited.
Parameters#
| Parameter | Type |
|---|---|
on | boolean |
Returns#
void
show()#
abstract show(values: readonly unknown[]): void;
Shows the values of the edited objects, one per object. Differing values show as mixed. An empty list disables the field.
Parameters#
| Parameter | Type |
|---|---|
values | readonly unknown[] |
Returns#
void
tick()#
tick(dt: number): boolean;
Advances the motion by dt seconds (only needed with ticker: null). Returns true while moving.
Parameters#
| Parameter | Type |
|---|---|
dt | number |
Returns#
boolean