load |
load(
levelId: string,
options?: {
container?: any;
flatten?: boolean;
onLoaded?: Function;
setViewportBounds?: boolean;
},
): booleanload a level into the game manager
(will also create all level defined entities, etc..)Parameters
- levelId: string
level id
Optionaloptions: {
container?: any;
flatten?: boolean;
onLoaded?: Function;
setViewportBounds?: boolean;
}additional optional parameters
Optionalcontainer?: anycontainer in which to load the specified level
Optionalflatten?: booleanif true, flatten all objects into the given container
OptionalonLoaded?: Functioncallback for when the level is fully loaded
OptionalsetViewportBounds?: booleanif true, set the viewport bounds to the map size
Returns boolean
true if the level was successfully loaded
- levelId: string