Difference between revisions of "SceneManager.new"

From GiderosMobile
m (Text replacement - "<source" to "<syntaxhighlight")
m (Text replacement - "</source>" to "</syntaxhighlight>")
Line 6: Line 6:
 
<syntaxhighlight lang="lua">
 
<syntaxhighlight lang="lua">
 
SceneManager.new(scenes)
 
SceneManager.new(scenes)
</source>
+
</syntaxhighlight>
  
 
=== Parameters ===
 
=== Parameters ===
Line 26: Line 26:
 
scenemanager:changeScene("menu")
 
scenemanager:changeScene("menu")
 
-- from menu to level1
 
-- from menu to level1
--scenemanager:changeScene("level1", 1, SceneManager.moveFromRight, easing.outBack)</source>
+
--scenemanager:changeScene("level1", 1, SceneManager.moveFromRight, easing.outBack)</syntaxhighlight>
  
 
{{SceneManager}}
 
{{SceneManager}}

Revision as of 14:32, 13 July 2023

Available since: Gideros 2020.2
Class: SceneManager

Description

Creates a new SceneManager object.

SceneManager.new(scenes)

Parameters

scenes: (table) the list of scenes

Example

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)