Class: LayoutTemplate

Constructors

constructor

new LayoutTemplate(layoutPath, data): LayoutTemplate

Parameters

Name Type
layoutPath string
data Layout

Returns

LayoutTemplate

Properties

data

data: Layout


resourceBase

resourceBase: string


resources

resources: Resource[]

Methods

create

create(name, renderer, container, options?): LayoutInstance

Create a layout instance from the template. The PIXI objects will be uploaded to the GPU dynamically once they become visible. Use prepareAll instead of create if you want to create layouts with an automatic async GPU upload.

Parameters

Name Type Description
name string Name of the layout for debugging purposes
renderer LayoutRenderer PIXI renderer or render texture
container null | Container<DisplayObject> PIXI parent container
options LayoutCreateOptions Optional create options

Returns

LayoutInstance


prepareAll

prepareAll(prepares, renderer, options?): Promise<LayoutInstance[]>

Asynchronously create a number of layout instances from templates. The PIXI objects will be uploaded to the GPU automatically before the prepare resolves. The per-frame time limit for the GPU upload can be configured via options.timeLimit.

Parameters

Name Type Description
prepares LayoutPrepareInfo[] Array of prepare infos with templates and instance names
renderer IRenderer<ICanvas> PIXI renderer
options LayoutPrepareOptions Optional prepare options

Returns

Promise<LayoutInstance[]>