mirror of
https://github.com/Orama-Interactive/Pixelorama.git
synced 2025-01-18 17:19:50 +00:00
Gave splash screen and camera_zoom() more time to get executed
This should make the splash screen properly centered on HTML5, and the canvas being always fit to frame when the program starts (in all platforms).
This commit is contained in:
parent
8d9e1e8207
commit
d3cb0c2b17
|
@ -14,6 +14,7 @@ var sprite_changed_this_frame := false # for optimization purposes
|
|||
func _ready() -> void:
|
||||
var frame : Frame = new_empty_frame(true)
|
||||
Global.current_project.frames.append(frame)
|
||||
yield(get_tree().create_timer(0.2), "timeout")
|
||||
camera_zoom()
|
||||
|
||||
|
||||
|
|
|
@ -59,6 +59,8 @@ func _input(event : InputEvent) -> void:
|
|||
|
||||
|
||||
func setup_application_window_size() -> void:
|
||||
if OS.get_name() == "HTML5":
|
||||
return
|
||||
# Set a minimum window size to prevent UI elements from collapsing on each other.
|
||||
OS.min_window_size = Vector2(1024, 576)
|
||||
|
||||
|
@ -77,7 +79,7 @@ func setup_application_window_size() -> void:
|
|||
|
||||
func show_splash_screen() -> void:
|
||||
# Wait for the window to adjust itself, so the popup is correctly centered
|
||||
yield(get_tree().create_timer(0.01), "timeout")
|
||||
yield(get_tree().create_timer(0.2), "timeout")
|
||||
if Global.config_cache.get_value("preferences", "startup"):
|
||||
$Dialogs/SplashDialog.popup_centered() # Splash screen
|
||||
modulate = Color(0.5, 0.5, 0.5)
|
||||
|
|
Loading…
Reference in a new issue