This repository has been archived by the owner on Jun 11, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
help i have to rebase because max has pushed something which i have m…
…erged
- Loading branch information
Alexander Rösel
committed
Apr 23, 2024
1 parent
69354bc
commit 7b720e9
Showing
4 changed files
with
44 additions
and
40 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,19 +1,20 @@ | ||
extends Control | ||
|
||
var Sprites: Resource = preload("res://src/sprite_selector/sprite.tscn") | ||
var Sprites: Resource = preload("res://src/sprite_selector/sprite_test.tscn") | ||
|
||
|
||
func _on_add_sprite_button_pressed(): | ||
$FileDialog.popup_centered() | ||
|
||
|
||
func _on_file_dialog_file_selected(path): | ||
var sprite: Button = Sprites.instantiate() | ||
var sprite = Sprites.instantiate() | ||
sprite.setup(path) | ||
var margin_container = MarginContainer.new() | ||
var margin_value = 10 | ||
margin_container.add_theme_constant_override("margin_top", margin_value / 2) | ||
margin_container.add_theme_constant_override("margin_left", margin_value) | ||
margin_container.add_theme_constant_override("margin_bottom", margin_value / 2) | ||
margin_container.add_theme_constant_override("margin_right", margin_value) | ||
#var margin_value = 10 | ||
#margin_container.add_theme_constant_override("margin_top", margin_value / 2) | ||
#margin_container.add_theme_constant_override("margin_left", margin_value) | ||
#margin_container.add_theme_constant_override("margin_bottom", margin_value / 2) | ||
#margin_container.add_theme_constant_override("margin_right", margin_value) | ||
#get_node("VBoxContainer2/VBox/ScrollContainer/VBoxIntems").add_child(sprite) | ||
get_node("VBoxContainer2/VBox/ScrollContainer/VBoxIntems").add_child(sprite) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,34 +1,36 @@ | ||
[gd_scene load_steps=2 format=3 uid="uid://rsvepepjglmt"] | ||
[gd_scene load_steps=3 format=3 uid="uid://rsvepepjglmt"] | ||
|
||
[ext_resource type="Script" path="res://src/widgets/dragable_item/dragable.gd" id="1_lsqbi"] | ||
[ext_resource type="Script" path="res://src/sprite_selector/sprite.gd" id="1_p6m3n"] | ||
|
||
[node name="SpriteButton" type="Button"] | ||
clip_contents = true | ||
custom_minimum_size = Vector2(100, 100) | ||
offset_right = 100.0 | ||
offset_bottom = 200.0 | ||
size_flags_horizontal = 3 | ||
button_mask = 3 | ||
script = ExtResource("1_p6m3n") | ||
|
||
[node name="VBoxContainer" type="VBoxContainer" parent="."] | ||
[node name="DragAndDropItem" type="Button" parent="."] | ||
offset_right = 8.0 | ||
offset_bottom = 8.0 | ||
size_flags_horizontal = 3 | ||
size_flags_vertical = 3 | ||
script = ExtResource("1_lsqbi") | ||
|
||
[node name="VBoxContainer" type="VBoxContainer" parent="DragAndDropItem"] | ||
layout_mode = 1 | ||
anchors_preset = 15 | ||
anchor_right = 1.0 | ||
anchor_bottom = 1.0 | ||
offset_right = 70.0 | ||
offset_bottom = 97.0 | ||
grow_horizontal = 2 | ||
grow_vertical = 2 | ||
alignment = 1 | ||
|
||
[node name="TextureRect" type="TextureRect" parent="VBoxContainer"] | ||
[node name="TextureRect" type="TextureRect" parent="DragAndDropItem/VBoxContainer"] | ||
custom_minimum_size = Vector2(70, 70) | ||
layout_mode = 2 | ||
size_flags_vertical = 3 | ||
expand_mode = 3 | ||
stretch_mode = 5 | ||
|
||
[node name="Label" type="Label" parent="VBoxContainer"] | ||
[node name="Label" type="Label" parent="DragAndDropItem/VBoxContainer"] | ||
layout_mode = 2 | ||
horizontal_alignment = 1 | ||
|
||
[connection signal="pressed" from="." to="." method="_on_pressed"] |