Skip to content
pixi-silk
GitHub repository
Class

VectorField

import { VectorField } from 'pixi-silk/ui/inspector';

Two number fields in a row, such as X and Y or W and H, with an optional aspect lock.

Extends#

Constructors#

Constructor#

new VectorField(ctx: FieldContext, options: VectorFieldOptions): VectorField;

Parameters#

ParameterType
ctxFieldContext
optionsVectorFieldOptions

Returns#

VectorField

Overrides#

Field.constructor

Properties#

PropertyModifierTypeDescriptionDefined in
axesreadonlyreadonly [NumberField, NumberField]The field of each axis.ui/panels/fields.ts:850

Accessors#

fieldWidth#

Get Signature#

get fieldWidth(): number;

Width of the field box. Default 120 until Field.resize.

Returns

number

Inherited from#

Field.fieldWidth


locked#

Get Signature#

get locked(): boolean;

True while the two values keep their ratio.

Returns

boolean

Methods#

destroy()#

destroy(options?: DestroyOptions): void;

Stops the animation. Destroys children unless options says otherwise.

Parameters#

ParameterType
options?DestroyOptions

Returns#

void

Inherited from#

Field.destroy


resize()#

resize(width: number, height: number): void;

Sets the size of the field box and redraws.

Parameters#

ParameterType
widthnumber
heightnumber

Returns#

void

Inherited from#

Field.resize


setEnabled()#

setEnabled(on: boolean): void;

False dims the field and ignores input, while nothing is edited.

Parameters#

ParameterType
onboolean

Returns#

void

Inherited from#

Field.setEnabled


setLocked()#

setLocked(locked: boolean): void;

Links or unlinks the two values.

Parameters#

ParameterType
lockedboolean

Returns#

void


show()#

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#

ParameterType
valuesreadonly unknown[]

Returns#

void

Overrides#

Field.show


tick()#

tick(dt: number): boolean;

Advances the motion by dt seconds (only needed with ticker: null). Returns true while moving.

Parameters#

ParameterType
dtnumber

Returns#

boolean

Overrides#

Field.tick