You've already forked godot
mirror of
https://github.com/godotengine/godot.git
synced 2025-11-18 14:21:41 +00:00
added a built-in scene changer API, closes #1928
This commit is contained in:
4
demos/misc/scene_changer/engine.cfg
Normal file
4
demos/misc/scene_changer/engine.cfg
Normal file
@@ -0,0 +1,4 @@
|
||||
[application]
|
||||
|
||||
name="Scene Changer"
|
||||
main_scene="res://scene_a.scn"
|
||||
17
demos/misc/scene_changer/scene_a.gd
Normal file
17
demos/misc/scene_changer/scene_a.gd
Normal file
@@ -0,0 +1,17 @@
|
||||
|
||||
extends Panel
|
||||
|
||||
# member variables here, example:
|
||||
# var a=2
|
||||
# var b="textvar"
|
||||
|
||||
func _ready():
|
||||
# Initalization here
|
||||
pass
|
||||
|
||||
|
||||
|
||||
|
||||
func _on_goto_scene_pressed():
|
||||
get_tree().change_scene("res://scene_b.scn")
|
||||
pass # replace with function body
|
||||
BIN
demos/misc/scene_changer/scene_a.scn
Normal file
BIN
demos/misc/scene_changer/scene_a.scn
Normal file
Binary file not shown.
17
demos/misc/scene_changer/scene_b.gd
Normal file
17
demos/misc/scene_changer/scene_b.gd
Normal file
@@ -0,0 +1,17 @@
|
||||
|
||||
extends Panel
|
||||
|
||||
# member variables here, example:
|
||||
# var a=2
|
||||
# var b="textvar"
|
||||
|
||||
func _ready():
|
||||
# Initalization here
|
||||
pass
|
||||
|
||||
|
||||
|
||||
|
||||
func _on_goto_scene_pressed():
|
||||
get_tree().change_scene("res://scene_a.scn")
|
||||
pass # replace with function body
|
||||
BIN
demos/misc/scene_changer/scene_b.scn
Normal file
BIN
demos/misc/scene_changer/scene_b.scn
Normal file
Binary file not shown.
Reference in New Issue
Block a user