Skip to content

Input

Defined in: ui/Input.ts:275

A highly customizable input component with mobile/touch support Input

// Basic text input
const basicInput = new Input({
minWidth: 400,
placeholder: { text: 'Enter text' },
padding: [12, 15]
});
// Password input with validation
const passwordInput = new Input({
type: 'password',
minWidth: 400,
placeholder: { text: 'Enter password' },
maxLength: 20,
regex: /^(?=.*[A-Za-z])(?=.*\d)[A-Za-z\d]{8,}$/
});
// Phone number input with validation
const phoneInput = new Input({
type: 'tel',
regex: /^1?-?\(?([2-9][0-9]{2})\)?[-. ]?([2-9][0-9]{2})[-. ]?([0-9]{4})$/,
error: {
input: { fill: 0xff0000 },
bg: { fill: 0xf5e0df }
}
});

new Input(options, isClone, clone): Input

Defined in: ui/Input.ts:356

Partial<InputProps>

boolean = false

null | Input

Input

Focusable(Interactive(WithSignals(Container))).constructor

__dill_pixel_method_binding_root: boolean = true

Defined in: display/Container.ts:68

Focusable(Interactive(WithSignals(Container))).__dill_pixel_method_binding_root


add: object

Defined in: mixins/factory/Factory.ts:6

animatedSprite: (props?) => AnimatedSprite

Partial<AnimatedSpriteProps>

AnimatedSprite

bitmapText: (props?) => BitmapText

Partial<TextProps>

BitmapText

button: (props?) => Button

Partial<ButtonProps>

Button

container: (props?) => Container<Application<DataSchema, ActionContext, Action, Renderer>>

Partial<ContainerProps>

Container<Application<DataSchema, ActionContext, Action, Renderer>>

existing: <TEntity>(entity, props?) => TEntity

TEntity

TEntity

Partial<ExistingProps>

TEntity

flexContainer: (props?) => FlexContainer

Partial<FlexContainerProps>

FlexContainer

graphics: (props?) => Graphics

Partial<GraphicsProps>

Graphics

htmlText: (props?) => HTMLText

Partial<HTMLTextProps>

HTMLText

particleContainer: (props?) => ParticleContainer<Application<DataSchema, ActionContext, Action, Renderer>>

Partial<ParticleContainerProps>

ParticleContainer<Application<DataSchema, ActionContext, Action, Renderer>>

spine: (props?) => Spine

Partial<SpineProps>

Spine

spineAnimation: <ANames, A>(props?) => SpineAnimation<ANames, A>

ANames extends string = string

A extends Application<DataSchema, ActionContext, Action, Renderer> = Application<DataSchema, ActionContext, Action, Renderer>

Partial<SpineProps>

SpineAnimation<ANames, A>

sprite: (props?) => Sprite

Partial<SpriteProps>

Sprite

text: (props?) => Text

Partial<TextProps>

Text

texture: (props?) => Texture = resolveTexture

Partial<TextureProps>

Texture

tilingSprite: (props?) => TilingSprite

Partial<TilingSpriteProps>

TilingSprite

toaster: (toasterConfig?, defaultToastConfig) => Toaster

Partial<ToasterConfig>

Partial<ToastConfig> = {}

Toaster

uiCanvas: (props?) => UICanvas

Partial<UICanvasFactoryProps>

UICanvas

svg(props): Svg

WithRequiredProps<SvgProps, "ctx">

Svg

Focusable(Interactive(WithSignals(Container))).add


bg: Graphics

Defined in: ui/Input.ts:307

Background graphics container


caret: Container

Defined in: ui/Input.ts:313

Caret (cursor) container


clone: null | Input = null

Defined in: ui/Input.ts:359


error: boolean

Defined in: ui/Input.ts:331

Current error state


focusEnabled: boolean

Defined in: plugins/focus/FocusManagerPlugin.ts:20

Focusable(Interactive(WithSignals(Container))).focusEnabled


input: Text

Defined in: ui/Input.ts:319

Text input container


isClone: boolean = false

Defined in: ui/Input.ts:358


isFocused: boolean

Defined in: plugins/focus/FocusManagerPlugin.ts:18

Focusable(Interactive(WithSignals(Container))).isFocused


isKeyDown: boolean

Defined in: plugins/focus/FocusManagerPlugin.ts:19

Focusable(Interactive(WithSignals(Container))).isKeyDown


make: object

Defined in: mixins/factory/Factory.ts:7

animatedSprite: (props?) => AnimatedSprite

Partial<AnimatedSpriteProps>

AnimatedSprite

bitmapText: (props?) => BitmapText

Partial<TextProps>

BitmapText

button: (props?) => Button

Partial<ButtonProps>

Button

container: (props?) => Container<Application<DataSchema, ActionContext, Action, Renderer>>

Partial<ContainerProps>

Container<Application<DataSchema, ActionContext, Action, Renderer>>

existing: <TEntity>(entity, props?) => TEntity

TEntity

TEntity

Partial<ExistingProps>

TEntity

flexContainer: (props?) => FlexContainer

Partial<FlexContainerProps>

FlexContainer

graphics: (props?) => Graphics

Partial<GraphicsProps>

Graphics

htmlText: (props?) => HTMLText

Partial<HTMLTextProps>

HTMLText

particleContainer: (props?) => ParticleContainer<Application<DataSchema, ActionContext, Action, Renderer>>

Partial<ParticleContainerProps>

ParticleContainer<Application<DataSchema, ActionContext, Action, Renderer>>

spine: (props?) => Spine

Partial<SpineProps>

Spine

spineAnimation: <ANames, A>(props?) => SpineAnimation<ANames, A>

ANames extends string = string

A extends Application<DataSchema, ActionContext, Action, Renderer> = Application<DataSchema, ActionContext, Action, Renderer>

Partial<SpineProps>

SpineAnimation<ANames, A>

sprite: (props?) => Sprite

Partial<SpriteProps>

Sprite

text: (props?) => Text

Partial<TextProps>

Text

texture: (props?) => Texture = resolveTexture

Partial<TextureProps>

Texture

tilingSprite: (props?) => TilingSprite

Partial<TilingSpriteProps>

TilingSprite

toaster: (toasterConfig?, defaultToastConfig) => Toaster

Partial<ToasterConfig>

Partial<ToastConfig> = {}

Toaster

uiCanvas: (props?) => UICanvas

Partial<UICanvasFactoryProps>

UICanvas

svg(props): Svg

WithRequiredProps<SvgProps, "ctx">

Svg

Focusable(Interactive(WithSignals(Container))).make


onAnimationComplete: Signal<(entity) => void>

Defined in: mixins/animated.ts:21

Focusable(Interactive(WithSignals(Container))).onAnimationComplete


onAnimationStart: Signal<(entity) => void>

Defined in: mixins/animated.ts:19

Focusable(Interactive(WithSignals(Container))).onAnimationStart


onAnimationUpdate: Signal<(entity) => void>

Defined in: mixins/animated.ts:20

Focusable(Interactive(WithSignals(Container))).onAnimationUpdate


onBlur: Signal<(focusable) => void>

Defined in: plugins/focus/FocusManagerPlugin.ts:36

Focusable(Interactive(WithSignals(Container))).onBlur


onDestroy: Signal<() => void>

Defined in: display/Container.ts:67

Focusable(Interactive(WithSignals(Container))).onDestroy


onFocus: Signal<(focusable) => void>

Defined in: plugins/focus/FocusManagerPlugin.ts:35

Focusable(Interactive(WithSignals(Container))).onFocus


onFocusIn: Signal<(focusable) => void>

Defined in: plugins/focus/FocusManagerPlugin.ts:33

Focusable(Interactive(WithSignals(Container))).onFocusIn


onFocusOut: Signal<(focusable) => void>

Defined in: plugins/focus/FocusManagerPlugin.ts:34

Focusable(Interactive(WithSignals(Container))).onFocusOut


onInteraction: (eventName) => InteractionSignal

Defined in: mixins/interaction.ts:16

keyof FederatedEventMap | keyof GlobalFederatedEventMap

InteractionSignal

Focusable(Interactive(WithSignals(Container))).onInteraction


options: InputOptions

Defined in: ui/Input.ts:301

Input configuration options


placeholder: Text

Defined in: ui/Input.ts:325

Placeholder text container


signalConnections: SignalConnections

Defined in: mixins/signals.ts:9

Focusable(Interactive(WithSignals(Container))).signalConnections


static onGlobalChildAdded: Signal<(child) => void>

Defined in: display/Container.ts:81

Focusable(Interactive(WithSignals(Container))).onGlobalChildAdded


static onGlobalChildRemoved: Signal<(child) => void>

Defined in: display/Container.ts:82

Focusable(Interactive(WithSignals(Container))).onGlobalChildRemoved

get animationContext(): undefined | string

Defined in: display/Container.ts:72

undefined | string

set animationContext(value): void

Defined in: display/Container.ts:75

string

void

Focusable(Interactive(WithSignals(Container))).animationContext


get app(): A

Defined in: display/Container.ts:111

Get the application instance.

A

Focusable(Interactive(WithSignals(Container))).app


get caretPosition(): number

Defined in: ui/Input.ts:453

Gets the current caret (cursor) position

number

The caret position in pixels from the left


get isValid(): boolean

Defined in: ui/Input.ts:479

Gets whether the current input value is valid

boolean

True if the input is valid


set regex(value): void

Defined in: ui/Input.ts:470

Sets the validation regex

RegExp

The regular expression to use for validation

void


get selectionRect(): null | Rectangle

Defined in: ui/Input.ts:462

Gets the current selection rectangle

null | Rectangle

The selection rectangle or null if no selection


get value(): string

Defined in: ui/Input.ts:500

Gets the current input value

string

The current value

set value(value): void

Defined in: ui/Input.ts:508

Sets the input value

string

The value to set

void

_checkPointerDownOutside(e): void

Defined in: ui/Input.ts:599

FederatedPointerEvent

void


_focusDomElement(selection?): void

Defined in: ui/Input.ts:576

number

void


_triggerFocusAndSelection(selection?): void

Defined in: ui/Input.ts:582

number

void


addColoredBackground(colorOrConfig, alpha): Sprite

Defined in: display/Container.ts:115

number | Partial<BackgroundConfig>

number = 1

Sprite

Focusable(Interactive(WithSignals(Container))).addColoredBackground


added(): void

Defined in: ui/Input.ts:544

Called when the component is added to the display list Shows the cursor if this is a clone

void

Focusable(Interactive(WithSignals(Container))).added


addSignalConnection(…args): void

Defined in: mixins/signals.ts:13

SignalConnection[]

void

Focusable(Interactive(WithSignals(Container))).addSignalConnection


animate(animationProps, instance?): Tween

Defined in: mixins/animated.ts:23

GSAPAnimationConfigExtended

any

Tween

Focusable(Interactive(WithSignals(Container))).animate


animateFrom(animationProps, instance?): Tween

Defined in: mixins/animated.ts:25

GSAPAnimationConfigExtended

any

Tween

Focusable(Interactive(WithSignals(Container))).animateFrom


animateFromTo(fromProps, toProps, instance?): Tween

Defined in: mixins/animated.ts:27

GSAPAnimationConfigExtended

GSAPAnimationConfigExtended

any

Tween

Focusable(Interactive(WithSignals(Container))).animateFromTo


animateSequence(sequences, instance?): Timeline

Defined in: mixins/animated.ts:33

GSAPAnimationConfigExtended[]

any

Timeline

Focusable(Interactive(WithSignals(Container))).animateSequence


blur(): void

Defined in: plugins/focus/FocusManagerPlugin.ts:44

void

Focusable(Interactive(WithSignals(Container))).blur


bob(config?, instance?): Tween

Defined in: mixins/animated.ts:50

number

number

any

Tween

Focusable(Interactive(WithSignals(Container))).bob


childAdded(child): void

Defined in: display/Container.ts:176

Container

void

Focusable(Interactive(WithSignals(Container))).childAdded


childRemoved(child): void

Defined in: display/Container.ts:191

Container

void

Focusable(Interactive(WithSignals(Container))).childRemoved


click(): void

Defined in: plugins/focus/FocusManagerPlugin.ts:42

void

Focusable(Interactive(WithSignals(Container))).click


connectAction(…args): void

Defined in: mixins/signals.ts:15

SignalConnection[]

void

Focusable(Interactive(WithSignals(Container))).connectAction


connectSignal(…args): void

Defined in: mixins/signals.ts:14

SignalConnection[]

void

Focusable(Interactive(WithSignals(Container))).connectSignal


destroy(): void

Defined in: ui/Input.ts:844

void

Focusable(Interactive(WithSignals(Container))).destroy


destroyAnimations(): void

Defined in: mixins/animated.ts:39

void

Focusable(Interactive(WithSignals(Container))).destroyAnimations


drawBg(width, height): void

Defined in: ui/Input.ts:828

number = ...

number = ...

void


drawSelection(): void

Defined in: ui/Input.ts:816

void


focusIn(): void

Defined in: ui/Input.ts:572

Focuses the input Creates the DOM element and shows the cursor

void

Focusable(Interactive(WithSignals(Container))).focusIn


focusOut(): void

Defined in: ui/Input.ts:612

Blurs (unfocuses) the input Removes the DOM element and hides the cursor

void

Focusable(Interactive(WithSignals(Container))).focusOut


getFocusArea(): Bounds

Defined in: ui/Input.ts:1264

Gets the focusable area bounds

Bounds

The bounds of the input container

Focusable(Interactive(WithSignals(Container))).getFocusArea


getFocusPosition(): null | PointLike

Defined in: plugins/focus/FocusManagerPlugin.ts:50

null | PointLike

Focusable(Interactive(WithSignals(Container))).getFocusPosition


getFocusSize(): null | PointLike

Defined in: plugins/focus/FocusManagerPlugin.ts:52

null | PointLike

Focusable(Interactive(WithSignals(Container))).getFocusSize


handleClick(e?): void

Defined in: ui/Input.ts:556

Handles click/tap events on the input Creates the DOM element and positions the caret

FederatedEvent<UIEvent | PixiTouch>

The pointer event

void


isAnimationPlaying(): boolean

Defined in: mixins/animated.ts:43

boolean

Focusable(Interactive(WithSignals(Container))).isAnimationPlaying


pauseAnimations(): void

Defined in: mixins/animated.ts:35

void

Focusable(Interactive(WithSignals(Container))).pauseAnimations


pulse(config?, instance?): Tween

Defined in: mixins/animated.ts:48

number

number

number

any

Tween

Focusable(Interactive(WithSignals(Container))).pulse


removed(): void

Defined in: display/Container.ts:189

void

Focusable(Interactive(WithSignals(Container))).removed


resetBg(): void

Defined in: ui/Input.ts:536

Redraws the background graphics

void


resize(): void

Defined in: ui/Input.ts:526

Resizes the input component Updates the clone overlay position if it exists

void

Focusable(Interactive(WithSignals(Container))).resize


resumeAnimations(): void

Defined in: mixins/animated.ts:37

void

Focusable(Interactive(WithSignals(Container))).resumeAnimations


reverseAnimation(): void

Defined in: mixins/animated.ts:41

void

Focusable(Interactive(WithSignals(Container))).reverseAnimation


shake(config?, instance?): Tween

Defined in: mixins/animated.ts:46

number

number

number

any

Tween

Focusable(Interactive(WithSignals(Container))).shake


update(): void

Defined in: ui/Input.ts:616

Update the container. This method is meant to be overridden by subclasses.

void

Focusable(Interactive(WithSignals(Container))).update


static childAdded(child): void

Defined in: display/Container.ts:84

Container

void

Focusable(Interactive(WithSignals(Container))).childAdded


static childRemoved(child): void

Defined in: display/Container.ts:88

Container

void

Focusable(Interactive(WithSignals(Container))).childRemoved

onChange: Signal<(detail) => void>

Defined in: ui/Input.ts:288

Emitted when the input value changes onChange


onEnter: Signal<(detail) => void>

Defined in: ui/Input.ts:281

Emitted when the Enter key is pressed onEnter


onError: Signal<(detail) => void>

Defined in: ui/Input.ts:295

Emitted when validation fails onError