Skip to content
pixi-silk
GitHub repository
Class

TextField

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

A one-line text field, edited in place with a TextEditor.

Extends#

Constructors#

Constructor#

new TextField(ctx: FieldContext, options: TextFieldOptions): TextField;

Parameters#

ParameterType
ctxFieldContext
optionsTextFieldOptions

Returns#

TextField

Overrides#

Field.constructor

Accessors#

editor#

Get Signature#

get editor(): TextEditor | null;

The editor inside the field. A resize replaces it with a new one, so do not keep a reference.

Returns

TextEditor | null


fieldWidth#

Get Signature#

get fieldWidth(): number;

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

Returns

number

Inherited from#

Field.fieldWidth

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


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

Inherited from#

Field.tick