Skip to content

UICanvas

Defined in: ui/UICanvas.ts:67

  • _UICanvas

new UICanvas(config): UICanvas

Defined in: ui/UICanvas.ts:82

Partial<UICanvasProps>

UICanvas

_UICanvas.constructor

add: object

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

animatedSprite: (props?) => AnimatedSprite

Partial<AnimatedSpriteProps>

AnimatedSprite

bitmapText: (props?) => BitmapText

Partial<BitmapTextProps>

BitmapText

button: (props?) => Button

Partial<ButtonProps>

Button

container: (props?) => Container

Partial<ContainerProps>

Container

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

Partial<ParticleContainerProps>

ParticleContainer

spine: (props?) => Spine

Partial<SpineProps>

Spine

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

ANames extends string = string

Partial<SpineProps>

SpineAnimation<ANames>

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<BitmapTextProps>

BitmapText

button: (props?) => Button

Partial<ButtonProps>

Button

container: (props?) => Container

Partial<ContainerProps>

Container

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

Partial<ParticleContainerProps>

ParticleContainer

spine: (props?) => Spine

Partial<SpineProps>

Spine

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

ANames extends string = string

Partial<SpineProps>

SpineAnimation<ANames>

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(): Application

Defined in: ui/UICanvas.ts:326

Get the application instance.

Application


get canvasChildren(): Container<ContainerChild>[]

Defined in: ui/UICanvas.ts:319

Container<ContainerChild>[]


set padding(value): void

Defined in: ui/UICanvas.ts:358

PointLike | Partial<Padding>

void


set size(value): void

Defined in: ui/UICanvas.ts:350

SizeLike

void

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

Defined in: ui/UICanvas.ts:421

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:391

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:477

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:330

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:417

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:410

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:436

Removes one or more children from the container

…(Container<ContainerChild> | IRenderLayer)[]

Container

_UICanvas.removeChild


removeChildAt<U>(index): U

Defined in: ui/UICanvas.ts:384

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:377

Removes all the children from the container

number

number

Container<ContainerChild>[]

_UICanvas.removeChildren


resize(): void

Defined in: ui/UICanvas.ts:451

void


setChildIndex<U>(child, index): void

Defined in: ui/UICanvas.ts:402

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:460

void