var scene_camera = null
if Engine.is_editor_hint():
scene_camera = EditorInterface.get_editor_viewport_3d().get_camera_3d()
else:
scene_camera = $Camera3D
var window_size = get_tree().get_root().size
get_tree().quit()
get_tree().call_group_flags(SceneTree.GROUP_CALL_REALTIME, "StartupHide", "hide")
label.add_color_override("font_color",
Color("ffffff") if scale_value == (i+1) else Color("bdbdbd"))
hint.text = message
hint.rect_size.y = hint.get_line_height() * hint.get_line_count()
func on_gui_input(event):
if event is InputEventMouseButton and event.pressed:
pass
if event is InputEventKey and event.scancode == KEY_SPACE:
pass
# if the path is wrong or the scene can't be loaded
# the `preload` function will fail at compile time
var bingo_scene = preload("res://Scenes/Bingo.tscn")
var bingo = null
func _ready():
bingo = bingo_scene.instance()
bingo.position = Vector2(1021, 790)
bingo.name = 'Bingo'
add_child(bingo)
But in case that scene is optional, then use a ResourceLoader
var bingo_scene_path = "res://Scenes/Bingo.tscn"
var bingo_scene = null
var bingo = null
func _enter_tree():
if ResourceLoader.exists(bingo_scene_path):
bingo_scene = ResourceLoader.load(bingo_scene_path)
func _ready():
if bingo_scene:
bingo = bingo_scene.instance()
bingo.name = 'Bingo'
bingo.position = Vector2(1021, 790)
add_child(bingo)
Load textures as resources. Drag and drop resources into the editor for the path
onready var training_texture: Texture = load("res://Assets/meter_training.png")
func get_local_scene_root(p_node : Node) -> Node:
while(p_node and not p_node.filename):
p_node = p_node.get_parent()
return p_node as Node