Godot Version
4.3
Question
I’m trying to build something to host a jeopardy game show.
I’d like to have two windows: one for the game show host to control the game, and one that shows a view for the players.
My current setup is that the ‘host’ scene is the main scene. As soon as it runs it spawns a second (player) window.
Now I’m stuck because I don’t know how I can change the contents of the scene inside the player window. I have tried various things involving preloading the next scene and get_tree(), get_tree().root.get_children(), … but they always end up changing the ‘host’ window, and not the player window.
Here’s how I spawn the player window:
var intro_scene = preload("res://intro.tscn")
var intro = null
func _ready() -> void:
get_viewport().set_embedding_subwindows(false)
size = Vector2(600, 800)
intro = intro_scene.instantiate()
add_child(intro)
intro.visible = true
intro.position = Vector2(200, 200)
intro.size = Vector2(400, 300)
I’m not at all sure that I’m going about this the right way. I could work around it by not changing the scene, and instead hiding and adding controls, but I think using scenes could help me keep things clean and simple.
Any advice is welcome!