Skip to content

UICanvas

Defined in: ui/UICanvas.ts:67

  • _UICanvas

T extends Application = Application

new UICanvas<T>(config): UICanvas<T>

Defined in: ui/UICanvas.ts:82

Partial<UICanvasProps>

UICanvas<T>

_UICanvas.constructor

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

_UICanvas.add


bottomRow: FlexContainer

Defined in: ui/UICanvas.ts:80


config: UICanvasConfig

Defined in: ui/UICanvas.ts:68


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

_UICanvas.make


middleRow: FlexContainer

Defined in: ui/UICanvas.ts:79


signalConnections: SignalConnections

Defined in: mixins/signals.ts:9

_UICanvas.signalConnections


topRow: FlexContainer

Defined in: ui/UICanvas.ts:78

get app(): T

Defined in: ui/UICanvas.ts:318

Get the application instance.

T


get canvasChildren(): Container<ContainerChild>[]

Defined in: ui/UICanvas.ts:311

Container<ContainerChild>[]


set padding(value): void

Defined in: ui/UICanvas.ts:350

PointLike | Partial<Padding>

void


set size(value): void

Defined in: ui/UICanvas.ts:342

SizeLike

void

addChild<U>(…children): U[0]

Defined in: ui/UICanvas.ts:413

Adds one or more children to the container. The children will be rendered as part of this container’s display list.

U extends (ContainerChild | IRenderLayer)[]

U

The Container(s) to add to the container

U[0]

The first child that was added

// Add a single child
container.addChild(sprite);
// Add multiple children
container.addChild(background, player, foreground);
// Add with type checking
const sprite = container.addChild<Sprite>(new Sprite(texture));
sprite.tint = 'red';
  • Container#removeChild For removing children
  • Container#addChildAt For adding at specific index

_UICanvas.addChild


addChildAt<U>(child, index): U

Defined in: ui/UICanvas.ts:383

Adds a child to the container at the specified index

U extends Container<ContainerChild> | IRenderLayer

U

number

U

_UICanvas.addChildAt


addElement<U>(child, settings?): U

Defined in: ui/UICanvas.ts:470

U extends Container<ContainerChild> = Container<ContainerChild>

Container

Partial<UICanvasChildProps>

U


addSignalConnection(…args): void

Defined in: mixins/signals.ts:13

SignalConnection[]

void

_UICanvas.addSignalConnection


connectAction(…args): void

Defined in: mixins/signals.ts:15

SignalConnection[]

void

_UICanvas.connectAction


connectSignal(…args): void

Defined in: mixins/signals.ts:14

SignalConnection[]

void

_UICanvas.connectSignal


destroy(): void

Defined in: ui/UICanvas.ts:322

Removes all internal references and listeners as well as removes children from the display list. Do not use a Container after calling destroy.

void

container.destroy();
container.destroy(true);
container.destroy({ children: true });
container.destroy({ children: true, texture: true, textureSource: true });

_UICanvas.destroy


getChildAt<U>(index): U

Defined in: ui/UICanvas.ts:409

Gets the child at the specified index

U extends Container<ContainerChild> | IRenderLayer

number

U

_UICanvas.getChildAt


getChildIndex<U>(child): number

Defined in: ui/UICanvas.ts:402

Gets the index of a child in the container

U extends Container<ContainerChild>

U

number

_UICanvas.getChildIndex


removeChild(…children): Container

Defined in: ui/UICanvas.ts:428

Removes one or more children from the container

…(Container<ContainerChild> | IRenderLayer)[]

Container

_UICanvas.removeChild


removeChildAt<U>(index): U

Defined in: ui/UICanvas.ts:376

Removes a child from the container at the specified index

U extends Container<ContainerChild> | IRenderLayer

number

U

_UICanvas.removeChildAt


removeChildren(beginIndex?, endIndex?): Container<ContainerChild>[]

Defined in: ui/UICanvas.ts:369

Removes all the children from the container

number

number

Container<ContainerChild>[]

_UICanvas.removeChildren


resize(): void

Defined in: ui/UICanvas.ts:443

void


setChildIndex<U>(child, index): void

Defined in: ui/UICanvas.ts:394

Sets the index of the child in the container

U extends Container<ContainerChild>

U

number

void

_UICanvas.setChildIndex


updateLayout(): void

Defined in: ui/UICanvas.ts:454

void