feat: base scene working
This commit is contained in:
parent
55901d4fd4
commit
2d7902c31c
3 changed files with 23 additions and 2 deletions
|
@ -1,9 +1,12 @@
|
|||
[gd_scene load_steps=2 format=3 uid="uid://ctytpqaed0yqx"]
|
||||
[gd_scene load_steps=3 format=3 uid="uid://ctytpqaed0yqx"]
|
||||
|
||||
[ext_resource type="Script" uid="uid://3kyt3shje5r1" path="res://scripts/window.gd" id="1_3vi8l"]
|
||||
[ext_resource type="Texture2D" uid="uid://fdqnc2qrrvn1" path="res://icon.svg" id="1_rpg24"]
|
||||
|
||||
[node name="Base" type="Node2D"]
|
||||
script = ExtResource("1_3vi8l")
|
||||
|
||||
[node name="Icon" type="Sprite2D" parent="."]
|
||||
position = Vector2(450, 303)
|
||||
position = Vector2(576, 324)
|
||||
scale = Vector2(9, 5.0625)
|
||||
texture = ExtResource("1_rpg24")
|
||||
|
|
17
scripts/window.gd
Normal file
17
scripts/window.gd
Normal file
|
@ -0,0 +1,17 @@
|
|||
extends Node
|
||||
|
||||
func _ready():
|
||||
await get_tree().process_frame
|
||||
move_window_to_bottom_right()
|
||||
|
||||
func move_window_to_bottom_right():
|
||||
var display_index = DisplayServer.window_get_current_screen()
|
||||
|
||||
var work_area_position = DisplayServer.screen_get_usable_rect(display_index).position
|
||||
var work_area_size = DisplayServer.screen_get_usable_rect(display_index).size
|
||||
|
||||
var window_size = DisplayServer.window_get_size()
|
||||
|
||||
var new_position = work_area_position + Vector2i(work_area_size.x - window_size.x, work_area_size.y - window_size.y)
|
||||
|
||||
DisplayServer.window_set_position(new_position)
|
1
scripts/window.gd.uid
Normal file
1
scripts/window.gd.uid
Normal file
|
@ -0,0 +1 @@
|
|||
uid://3kyt3shje5r1
|
Loading…
Add table
Add a link
Reference in a new issue