Added the taskbar
- Changed icons to use a flow container
This commit is contained in:
22
Scripts/desktop_icon.gd
Normal file
22
Scripts/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
Scripts/desktop_icon.gd.uid
Normal file
1
Scripts/desktop_icon.gd.uid
Normal file
@@ -0,0 +1 @@
|
||||
uid://dhbusj7k1vdji
|
||||
Reference in New Issue
Block a user