Static methods

staticbind(path:String, object:Dynamic):Void

Load the Prefab from path and assign all created hierarchy objects to fields of the object instance.

Parameters:

path

Prefab name. Can point to a subfolder and must be without an extension.

object

An instance to which the prefab adds itself and assigns fields from the loaded path hierarchy.

staticload(path:String, ?parent:Object, ?field:Array<Field>):Prefab

Load the Prefab with the given name path from the res folder. path can point to a subfolder (eg: "ui/button") and must be without an extension.

Parameters:

path

Prefab name.

parent

An optional parent h2d.Object instance to which prefab adds itself if set.

field

An optional Field structure to override default values ​​for an object in the prefab hierarchy(text, texture atlas tile. eg: "[{ name : "label", type : "text", value : "new label" }]").

staticmake(path:String, type:Class<Dynamic>, ?parent:Object):Dynamic

Create a Prefab with a given class type, load data from path and assign all created hierarchy objects to fields of this instance.

Parameters:

path

Prefab name. Can point to a subfolder and must be without an extension.

type

Prefab class. All objects from the loaded hierarchy will be assigned to the fields of this instance.

parent

An optional parent h2d.Object instance to which prefab adds itself if set.

staticsetCache(atlas:Atlas):Void



Introduction

Quick Start

Working with editor

In-game implementation

API