Difference between revisions of "SceneManager.new"

From GiderosMobile
(Created page with "'''Available since:''' Gideros 2020.2<br/> '''Class:''' SceneManager<br/> === Description === Creates a new SceneManager object. <source lang="lua"> SceneManager.new(...")
 
 
(2 intermediate revisions by one other user not shown)
Line 3: Line 3:
  
 
=== Description ===
 
=== Description ===
Creates a new [[SceneManager]] object.
+
Creates a new SceneManager object.
<source lang="lua">
+
<syntaxhighlight lang="lua">
 
SceneManager.new(scenes)
 
SceneManager.new(scenes)
</source>
+
</syntaxhighlight>
  
 
=== Parameters ===
 
=== Parameters ===
Line 12: Line 12:
  
 
=== Example ===
 
=== Example ===
<source lang="lua">
+
<syntaxhighlight lang="lua">
 
require "scenemanager"
 
require "scenemanager"
 
require "easing"
 
require "easing"
Line 20: Line 20:
 
["menu"] = Menu,
 
["menu"] = Menu,
 
["level1"] = Level1,
 
["level1"] = Level1,
 +
-- ...
 
}
 
}
 
)
 
)
Line 25: Line 26:
 
-- from app start to menu
 
-- from app start to menu
 
scenemanager:changeScene("menu")
 
scenemanager:changeScene("menu")
-- from menu to level1
+
</syntaxhighlight>
--scenemanager:changeScene("level1", 1, SceneManager.moveFromRight, easing.outBack)</source>
 
  
 
{{SceneManager}}
 
{{SceneManager}}

Latest revision as of 03:42, 8 December 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")