Somewhat working prototype

This commit is contained in:
2025-10-20 18:05:23 -06:00
parent 309591a9b6
commit a82f3ac09e
7 changed files with 90 additions and 2 deletions

View File

@@ -0,0 +1,22 @@
[gd_scene format=3 uid="uid://dtsyn6bqpojn"]
[node name="EmptySpaceThing" type="Control"]
layout_mode = 3
anchors_preset = 15
anchor_right = 1.0
anchor_bottom = 1.0
grow_horizontal = 2
grow_vertical = 2
[node name="Button" type="Button" parent="."]
layout_mode = 0
offset_right = 8.0
offset_bottom = 8.0
text = "YEehaw"
[node name="Button" type="Button" parent="Button"]
layout_mode = 0
offset_left = 101.0
offset_right = 176.0
offset_bottom = 31.0
text = "Button 2"

31
src/empty_space_thing.gd Normal file
View File

@@ -0,0 +1,31 @@
extends Control
class_name SpaceNode
var initial_pos: Vector2
var offset: Vector2
var draggable: bool = false
func _ready() -> void:
draggable = true
return
func _process(delta: float) -> void:
if draggable:
if Input.is_action_pressed("click", true):
self.global_position = Vector2(get_global_mouse_position().x, self.global_position.y)
elif Input.is_action_just_released("click"):
is_dragging.is_dragging = false
var tween = get_tree().create_tween()
tween.tween_property(self, "global_position", Vector2(get_global_mouse_position().x, self.global_position.y), 0.5).set_ease(Tween.EASE_IN_OUT)
else:
return
func reset_draggable():
if not is_dragging.is_dragging:
is_dragging.is_dragging = false
draggable = false

View File

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

View File

@@ -1,4 +1,7 @@
[gd_scene format=3 uid="uid://xvl65qci5w1b"]
[gd_scene load_steps=3 format=3 uid="uid://xvl65qci5w1b"]
[ext_resource type="PackedScene" uid="uid://dtsyn6bqpojn" path="res://src/empty space thing.tscn" id="1_is8xv"]
[ext_resource type="Script" uid="uid://vabpak15285q" path="res://src/empty_space_thing.gd" id="2_mej84"]
[node name="ScrollRoot" type="Node2D"]
@@ -6,3 +9,17 @@
offset_right = 1152.0
offset_bottom = 648.0
color = Color(0.133196, 0.133196, 0.133196, 1)
[node name="Sliding Box" type="Control" parent="."]
layout_mode = 3
anchors_preset = 0
offset_right = 40.0
offset_bottom = 40.0
[node name="EmptySpaceThing" parent="Sliding Box" instance=ExtResource("1_is8xv")]
layout_mode = 1
offset_left = 455.0
offset_top = 299.0
offset_right = 455.0
offset_bottom = 299.0
script = ExtResource("2_mej84")