Difference between revisions of "SceneManager"
From GiderosMobile
Line 40: | Line 40: | ||
| style="width: 50%; vertical-align:top;"| | | style="width: 50%; vertical-align:top;"| | ||
=== <translate>Events</translate> === | === <translate>Events</translate> === | ||
− | [[Special:MyLanguage/ | + | [[Special:MyLanguage/SceneManager_enterBegin|enterBegin]]<br/><!-- GIDEROSEVT:enterBegin--> |
− | [[Special:MyLanguage/ | + | [[Special:MyLanguage/SceneManager_enterEnd|enterEnd]]<br/><!-- GIDEROSEVT:enterEnd--> |
− | [[Special:MyLanguage/ | + | [[Special:MyLanguage/SceneManager_exitBegin|exitBegin]]<br/><!-- GIDEROSEVT:exitBegin--> |
− | [[Special:MyLanguage/ | + | [[Special:MyLanguage/SceneManager_exitEnd|exitEnd]]<br/><!-- GIDEROSEVT:exitEnd--> |
=== <translate>Constants</translate> === | === <translate>Constants</translate> === | ||
[[Special:MyLanguage/SceneManager.moveFromRight|SceneManager.moveFromRight]]<br/><!-- GIDEROSCST:SceneManager.moveFromRight--> | [[Special:MyLanguage/SceneManager.moveFromRight|SceneManager.moveFromRight]]<br/><!-- GIDEROSCST:SceneManager.moveFromRight--> |
Revision as of 03:52, 26 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)