Finalize example entrypoint.gd
This commit is contained in:
parent
1fb0716cdf
commit
dfe788ef20
1 changed files with 18 additions and 3 deletions
|
@ -1,7 +1,22 @@
|
|||
extends PresencodeEntrypoint
|
||||
|
||||
func initialize() -> void:
|
||||
logger.info("Initialized entrypoint for example presentation")
|
||||
var resources_list: Dictionary = { "slide_0": "slides/slide_0.tscn", "slide_1": "slides/slide_1.tscn" }
|
||||
var resources: Dictionary = {}
|
||||
|
||||
func switch_slide(new_slide: int) -> void:
|
||||
func initialize() -> void:
|
||||
logger.info("Initializing entrypoint for example presentation")
|
||||
|
||||
# Load resources
|
||||
resources = await api.load_resources(resources_list)
|
||||
|
||||
# Switch to starting slide
|
||||
switch_to_slide(0)
|
||||
|
||||
func switch_to_slide(new_slide: int) -> void:
|
||||
logger.info("Switching to slide " + str(new_slide))
|
||||
|
||||
# Remove all scenes
|
||||
api.remove_all_slides()
|
||||
|
||||
# Add new slide
|
||||
sms.add_scene("slide", "slide_" + str(new_slide), CoreTypes.SceneType.MAIN)
|
||||
|
|
Loading…
Reference in a new issue