Class l2df.manager.scene

Last updated 2021-05-28 15:24:22

Scene manager.

Info:

Functions

Manager:init([kwargs]) Configure SceneManager.
Manager:load(folderpath) Load preset scenes from a specified folder.
Manager:add(scene[, id]) Load preset scene from file or scene object preserving the id.
Manager:remove(id) Deleting a scene from the Manager by Id
Manager:inStack(id) Check whether a scene with the specified id is setted / pushed to stack.
Manager:current() Returns the topmost scene in stack.
Manager:set(id, ...) Setting the current scene.
Manager:push(id, ...) Adding scene to current list.
Manager:pop(...) Removing last scene from current list.


Functions

Methods
Manager:init([kwargs])
Configure SceneManager.

Parameters:

  • kwargs table Keyword arguments.
    • load string Path to the directory containing scene presets to load. (optional)
    • set number or string Scene ID of the initial scene to set. (optional)

Returns:

    l2df.manager.scene
Manager:load(folderpath)
Load preset scenes from a specified folder.

Parameters:

  • folderpath string Path to the directory containing scene presets.
Manager:add(scene[, id])
Load preset scene from file or scene object preserving the id.

Parameters:

Returns:

    boolean true if scene was successfully added. false otherwise.
Manager:remove(id)
Deleting a scene from the Manager by Id

Parameters:

  • id number or string Scene ID.

Returns:

    boolean
Manager:inStack(id)
Check whether a scene with the specified id is setted / pushed to stack.

Parameters:

  • id number or string Scene ID.

Returns:

    boolean true if the scene is in stack. false otherwise.
Manager:current()
Returns the topmost scene in stack.

Returns:

    l2df.class.entity.scene
Manager:set(id, ...)
Setting the current scene.

Parameters:

  • id number or string Scene ID.
  • ... Passes all arguments to enter / leave / disable callbacks of the scene.

Returns:

    boolean
Manager:push(id, ...)
Adding scene to current list.

Parameters:

  • id number or string Scene ID.
  • ... Passes all arguments to enter / disable callbacks of the scene.

Returns:

    boolean
Manager:pop(...)
Removing last scene from current list.

Parameters:

  • ... Passes all arguments to enable / leave callbacks of the scene.

Returns:

    boolean true if there were one or more scenes in stack. false otherwise.