Class l2df.manager.scene
Scene manager.
Info:
- Copyright: Atom-TM 2019
- Author: Kasai
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.
Returns:
- 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:
- scene string or l2df.class.entity.scene Path to the scene file or Scene object.
-
id
number or string
Scene ID.
If
scene
is a string, the default value is a name of the scene's file. (optional)
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:
- 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:
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. -
...
Passes all arguments to