Difference between revisions of "SceneManager"
m |
|||
Line 40: | Line 40: | ||
| style="width: 50%; vertical-align:top;"| | | style="width: 50%; vertical-align:top;"| | ||
=== <translate>Events</translate> === | === <translate>Events</translate> === | ||
− | [[Special:MyLanguage/SceneManager_enterBegin|enterBegin]]<br/><!-- GIDEROSEVT:enterBegin--> | + | [[Special:MyLanguage/SceneManager_enterBegin|"enterBegin"]]<br/><!-- GIDEROSEVT:enterBegin--> |
− | [[Special:MyLanguage/SceneManager_enterEnd|enterEnd]]<br/><!-- GIDEROSEVT:enterEnd--> | + | [[Special:MyLanguage/SceneManager_enterEnd|"enterEnd"]]<br/><!-- GIDEROSEVT:enterEnd--> |
− | [[Special:MyLanguage/SceneManager_exitBegin|exitBegin]]<br/><!-- GIDEROSEVT:exitBegin--> | + | [[Special:MyLanguage/SceneManager_exitBegin|"exitBegin"]]<br/><!-- GIDEROSEVT:exitBegin--> |
− | [[Special:MyLanguage/SceneManager_exitEnd|exitEnd]]<br/><!-- GIDEROSEVT:exitEnd--> | + | [[Special:MyLanguage/SceneManager_exitEnd|"exitEnd"]]<br/><!-- GIDEROSEVT:exitEnd--> |
=== <translate>Constants</translate> === | === <translate>Constants</translate> === | ||
SceneManager.moveFromRight<br/><!-- GIDEROSCST:SceneManager.moveFromRight--> | SceneManager.moveFromRight<br/><!-- GIDEROSCST:SceneManager.moveFromRight--> |
Revision as of 21:39, 27 March 2020
Supported platforms:
Available since: 2020.2
Inherits from: Sprite
Description
An easy way to manage scenes.
Note: works in pair with the Easing plugin
require "scenemanager"
Example
How to declare and change scenes
require "scenemanager"
require "easing"
scenemanager = SceneManager.new(
{
["menu"] = Menu,
["level1"] = Level1,
}
)
stage:addChild(scenemanager)
-- from app start to menu
scenemanager:changeScene("menu")
-- from menu to level1
--scenemanager:changeScene("level1", 1, SceneManager.moveFromRight, easing.outBack)
MethodsSceneManager.new creates a new SceneManager object SceneManager:changeScene transitions to a scene |
Events"enterBegin" ConstantsSceneManager.moveFromRight |