Start of a window system

This commit is contained in:
2025-11-08 19:20:49 +01:00
parent b3f73354e0
commit 07edcf9773
6 changed files with 73 additions and 1 deletions

BIN
Assets/window.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 7.9 KiB

40
Assets/window.png.import Normal file
View File

@@ -0,0 +1,40 @@
[remap]
importer="texture"
type="CompressedTexture2D"
uid="uid://cgepikt26ot0a"
path="res://.godot/imported/window.png-9269117c8439c65de1d1a3b508c88e06.ctex"
metadata={
"vram_texture": false
}
[deps]
source_file="res://Assets/window.png"
dest_files=["res://.godot/imported/window.png-9269117c8439c65de1d1a3b508c88e06.ctex"]
[params]
compress/mode=0
compress/high_quality=false
compress/lossy_quality=0.7
compress/uastc_level=0
compress/rdo_quality_loss=0.0
compress/hdr_compression=1
compress/normal_map=0
compress/channel_pack=0
mipmaps/generate=false
mipmaps/limit=-1
roughness/mode=0
roughness/src_normal=""
process/channel_remap/red=0
process/channel_remap/green=1
process/channel_remap/blue=2
process/channel_remap/alpha=3
process/fix_alpha_border=true
process/premult_alpha=false
process/normal_map_invert_y=false
process/hdr_as_srgb=false
process/hdr_clamp_exposure=false
process/size_limit=0
detect_3d/compress_to=1

View File

@@ -1,3 +1,4 @@
class_name TrayClock
extends Control
var clock_txt: Label

14
window_decorations.gd Normal file
View File

@@ -0,0 +1,14 @@
@tool
class_name WindowDecorations
extends Control
@export var window_size: Vector2 = Vector2(300,300)
@export var window_pos: Vector2 = Vector2(100,100)
func _ready():
pass
func _process(_delta: float) -> void:
size = window_size
position = window_pos
pass

View File

@@ -0,0 +1 @@
uid://cfuhmfrsrtkvl

View File

@@ -1,4 +1,4 @@
[gd_scene load_steps=13 format=3 uid="uid://bhg0uqxjr73e"]
[gd_scene load_steps=15 format=3 uid="uid://bhg0uqxjr73e"]
[ext_resource type="Texture2D" uid="uid://bc6g14s6uvxir" path="res://Assets/bliss 600dpi.jpg" id="1_d8jhn"]
[ext_resource type="PackedScene" uid="uid://owcnraxh2lvx" path="res://scenes/desktop_icon.tscn" id="2_31yks"]
@@ -10,6 +10,8 @@
[ext_resource type="Texture2D" uid="uid://d1k77bo3y8hjg" path="res://Assets/StartButton2.png" id="8_rf44w"]
[ext_resource type="Texture2D" uid="uid://fpai1y66x4ap" path="res://Assets/Taskbar-right.png" id="9_u7tg2"]
[ext_resource type="Script" uid="uid://c54eiokna6tpq" path="res://tray_clock.gd" id="10_utjsd"]
[ext_resource type="Texture2D" uid="uid://cgepikt26ot0a" path="res://Assets/window.png" id="11_ufj3f"]
[ext_resource type="Script" uid="uid://cfuhmfrsrtkvl" path="res://window_decorations.gd" id="12_vbt2a"]
[sub_resource type="SystemFont" id="SystemFont_nirc1"]
font_names = PackedStringArray("Arial")
@@ -169,3 +171,17 @@ script = ExtResource("10_utjsd")
layout_mode = 2
theme_override_fonts/font = SubResource("SystemFont_ufj3f")
text = "18:30"
[node name="WindowDecorations" type="NinePatchRect" parent="."]
layout_mode = 0
offset_right = 500.0
offset_bottom = 500.0
texture = ExtResource("11_ufj3f")
region_rect = Rect2(0, 0, 289, 305)
patch_margin_left = 10
patch_margin_top = 42
patch_margin_right = 90
patch_margin_bottom = 10
script = ExtResource("12_vbt2a")
window_size = Vector2(500, 500)
window_pos = null