load |

  • load(
        levelId: string,
        options?: {
            container?: any;
            flatten?: boolean;
            onLoaded?: Function;
            setViewportBounds?: boolean;
        },
    ): boolean

    load 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?: any

        container in which to load the specified level

      • Optionalflatten?: boolean

        if true, flatten all objects into the given container

      • OptionalonLoaded?: Function

        callback for when the level is fully loaded

      • OptionalsetViewportBounds?: boolean

        if true, set the viewport bounds to the map size

    Returns boolean

    true if the level was successfully loaded