Difference between revisions of "SceneManager"

Line 45: Line 45:
 
[[Special:MyLanguage/SceneManager_exitEnd|exitEnd]]<br/><!-- GIDEROSEVT:exitEnd-->
 
[[Special:MyLanguage/SceneManager_exitEnd|exitEnd]]<br/><!-- GIDEROSEVT:exitEnd-->
 
=== <translate>Constants</translate> ===
 
=== <translate>Constants</translate> ===
[[Special:MyLanguage/SceneManager.moveFromRight|SceneManager.moveFromRight]]<br/><!-- GIDEROSCST:SceneManager.moveFromRight-->
+
SceneManager.moveFromRight<br/><!-- GIDEROSCST:SceneManager.moveFromRight-->
[[Special:MyLanguage/SceneManager.moveFromLeft|SceneManager.moveFromLeft]]<br/><!-- GIDEROSCST:SceneManager.moveFromLeft-->
+
SceneManager.moveFromLeft<br/><!-- GIDEROSCST:SceneManager.moveFromLeft-->
[[Special:MyLanguage/SceneManager.moveFromBottom|SceneManager.moveFromBottom]]<br/><!-- GIDEROSCST:SceneManager.moveFromBottom-->
+
SceneManager.moveFromBottom<br/><!-- GIDEROSCST:SceneManager.moveFromBottom-->
[[Special:MyLanguage/SceneManager.moveFromTop|SceneManager.moveFromTop]]<br/><!-- GIDEROSCST:SceneManager.moveFromTop-->
+
SceneManager.moveFromTop<br/><!-- GIDEROSCST:SceneManager.moveFromTop-->
[[Special:MyLanguage/SceneManager.moveFromRightWithFade|SceneManager.moveFromRightWithFade]]<br/><!-- GIDEROSCST:SceneManager.moveFromRightWithFade-->
+
SceneManager.moveFromRightWithFade<br/><!-- GIDEROSCST:SceneManager.moveFromRightWithFade-->
[[Special:MyLanguage/SceneManager.moveFromLeftWithFade|SceneManager.moveFromLeftWithFade]]<br/><!-- GIDEROSCST:SceneManager.moveFromLeftWithFade-->
+
SceneManager.moveFromLeftWithFade<br/><!-- GIDEROSCST:SceneManager.moveFromLeftWithFade-->
[[Special:MyLanguage/SceneManager.moveFromBottomWithFade|SceneManager.moveFromBottomWithFade]]<br/><!-- GIDEROSCST:SceneManager.moveFromBottomWithFade-->
+
SceneManager.moveFromBottomWithFade<br/><!-- GIDEROSCST:SceneManager.moveFromBottomWithFade-->
[[Special:MyLanguage/SceneManager.moveFromTopWithFade|SceneManager.moveFromTopWithFade]]<br/><!-- GIDEROSCST:SceneManager.moveFromTopWithFade-->
+
SceneManager.moveFromTopWithFade<br/><!-- GIDEROSCST:SceneManager.moveFromTopWithFade-->
[[Special:MyLanguage/SceneManager.overFromRight|SceneManager.overFromRight]]<br/><!-- GIDEROSCST:SceneManager.overFromRight-->
+
SceneManager.overFromRight<br/><!-- GIDEROSCST:SceneManager.overFromRight-->
[[Special:MyLanguage/SceneManager.overFromLeft|SceneManager.overFromLeft]]<br/><!-- GIDEROSCST:SceneManager.overFromLeft-->
+
SceneManager.overFromLeft<br/><!-- GIDEROSCST:SceneManager.overFromLeft-->
[[Special:MyLanguage/SceneManager.overFromBottom|SceneManager.overFromBottom]]<br/><!-- GIDEROSCST:SceneManager.overFromBottom-->
+
SceneManager.overFromBottom<br/><!-- GIDEROSCST:SceneManager.overFromBottom-->
[[Special:MyLanguage/SceneManager.overFromTop|SceneManager.overFromTop]]<br/><!-- GIDEROSCST:SceneManager.overFromTop-->
+
SceneManager.overFromTop<br/><!-- GIDEROSCST:SceneManager.overFromTop-->
[[Special:MyLanguage/SceneManager.overFromRightWithFade|SceneManager.overFromRightWithFade]]<br/><!-- GIDEROSCST:SceneManager.overFromRightWithFade-->
+
SceneManager.overFromRightWithFade<br/><!-- GIDEROSCST:SceneManager.overFromRightWithFade-->
[[Special:MyLanguage/SceneManager.overFromLeftWithFade|SceneManager.overFromLeftWithFade]]<br/><!-- GIDEROSCST:SceneManager.overFromLeftWithFade-->
+
SceneManager.overFromLeftWithFade<br/><!-- GIDEROSCST:SceneManager.overFromLeftWithFade-->
[[Special:MyLanguage/SceneManager.overFromBottomWithFade|SceneManager.overFromBottomWithFade]]<br/><!-- GIDEROSCST:SceneManager.overFromBottomWithFade-->
+
SceneManager.overFromBottomWithFade<br/><!-- GIDEROSCST:SceneManager.overFromBottomWithFade-->
[[Special:MyLanguage/SceneManager.overFromTopWithFade|SceneManager.overFromTopWithFade]]<br/><!-- GIDEROSCST:SceneManager.overFromTopWithFade-->
+
SceneManager.overFromTopWithFade<br/><!-- GIDEROSCST:SceneManager.overFromTopWithFade-->
[[Special:MyLanguage/SceneManager.fade|SceneManager.fade]]<br/><!-- GIDEROSCST:SceneManager.fade-->
+
SceneManager.fade<br/><!-- GIDEROSCST:SceneManager.fade-->
[[Special:MyLanguage/SceneManager.crossFade|SceneManager.crossFade]]<br/><!-- GIDEROSCST:SceneManager.crossFade-->
+
SceneManager.crossFade<br/><!-- GIDEROSCST:SceneManager.crossFade-->
[[Special:MyLanguage/SceneManager.flip|SceneManager.flip]]<br/><!-- GIDEROSCST:SceneManager.flip-->
+
SceneManager.flip<br/><!-- GIDEROSCST:SceneManager.flip-->
[[Special:MyLanguage/SceneManager.flipWithFade|SceneManager.flipWithFade]]<br/><!-- GIDEROSCST:SceneManager.flipWithFade-->
+
SceneManager.flipWithFade<br/><!-- GIDEROSCST:SceneManager.flipWithFade-->
[[Special:MyLanguage/SceneManager.flipWithShade|SceneManager.flipWithShade]]<br/><!-- GIDEROSCST:SceneManager.flipWithShade-->
+
SceneManager.flipWithShade<br/><!-- GIDEROSCST:SceneManager.flipWithShade-->
 
|}
 
|}
  
 
{{GIDEROS IMPORTANT LINKS}}
 
{{GIDEROS IMPORTANT LINKS}}

Revision as of 05:14, 26 March 2020

Supported platforms: Platform android.pngPlatform ios.pngPlatform pc.pngPlatform mac.pngPlatform winrt.pngPlatform win32.png
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)

Methods

SceneManager.new creates a new SceneManager object

SceneManager:changeScene transitions to a scene

Events

enterBegin
enterEnd
exitBegin
exitEnd

Constants

SceneManager.moveFromRight
SceneManager.moveFromLeft
SceneManager.moveFromBottom
SceneManager.moveFromTop
SceneManager.moveFromRightWithFade
SceneManager.moveFromLeftWithFade
SceneManager.moveFromBottomWithFade
SceneManager.moveFromTopWithFade
SceneManager.overFromRight
SceneManager.overFromLeft
SceneManager.overFromBottom
SceneManager.overFromTop
SceneManager.overFromRightWithFade
SceneManager.overFromLeftWithFade
SceneManager.overFromBottomWithFade
SceneManager.overFromTopWithFade
SceneManager.fade
SceneManager.crossFade
SceneManager.flip
SceneManager.flipWithFade
SceneManager.flipWithShade