Inital commit
- Desktop wallpaper
- Desktop Icons
- Added a simple script to set the icons texture and label
This commit is contained in:
22
scenes/desktop_icon.gd
Normal file
22
scenes/desktop_icon.gd
Normal file
@@ -0,0 +1,22 @@
|
||||
@tool
|
||||
class_name DesktopIcon
|
||||
extends VBoxContainer
|
||||
|
||||
@export var icon_texture: Texture
|
||||
@export var icon_text: String
|
||||
@export var min_size: Vector2 = Vector2(32,32)
|
||||
|
||||
var texture_rect: TextureRect
|
||||
var label: Label
|
||||
|
||||
func _ready() -> void:
|
||||
texture_rect = get_node("IcoTexture")
|
||||
label = get_node("IcoLabel")
|
||||
|
||||
func _process(delta: float) -> void:
|
||||
update_icon()
|
||||
|
||||
func update_icon():
|
||||
texture_rect.texture = icon_texture
|
||||
texture_rect.custom_minimum_size = min_size
|
||||
label.text = icon_text
|
||||
1
scenes/desktop_icon.gd.uid
Normal file
1
scenes/desktop_icon.gd.uid
Normal file
@@ -0,0 +1 @@
|
||||
uid://dhbusj7k1vdji
|
||||
28
scenes/desktop_icon.tscn
Normal file
28
scenes/desktop_icon.tscn
Normal file
@@ -0,0 +1,28 @@
|
||||
[gd_scene load_steps=4 format=3 uid="uid://owcnraxh2lvx"]
|
||||
|
||||
[ext_resource type="Script" uid="uid://dhbusj7k1vdji" path="res://scenes/desktop_icon.gd" id="1_ciefd"]
|
||||
[ext_resource type="Theme" uid="uid://dgf6fwq86texy" path="res://Desktop Icons.tres" id="2_ciefd"]
|
||||
[ext_resource type="Texture2D" uid="uid://cf0gel5pfm6em" path="res://icon.svg" id="2_x2r5c"]
|
||||
|
||||
[node name="Desktop Icon" type="VBoxContainer"]
|
||||
script = ExtResource("1_ciefd")
|
||||
icon_texture = ExtResource("2_x2r5c")
|
||||
icon_text = "TomTam_test.exe Lorem Ipsum dolor sit amet"
|
||||
|
||||
[node name="IcoTexture" type="TextureRect" parent="."]
|
||||
custom_minimum_size = Vector2(32, 32)
|
||||
layout_mode = 2
|
||||
size_flags_vertical = 0
|
||||
texture = ExtResource("2_x2r5c")
|
||||
expand_mode = 2
|
||||
stretch_mode = 5
|
||||
|
||||
[node name="IcoLabel" type="Label" parent="."]
|
||||
custom_minimum_size = Vector2(96, 36)
|
||||
layout_mode = 2
|
||||
theme = ExtResource("2_ciefd")
|
||||
text = "TomTam_test.exe Lorem Ipsum dolor sit amet"
|
||||
horizontal_alignment = 1
|
||||
autowrap_mode = 2
|
||||
text_overrun_behavior = 3
|
||||
max_lines_visible = 2
|
||||
Reference in New Issue
Block a user