mirror of
https://github.com/tonytins/CozyPixelStudio.git
synced 2025-06-25 10:24:44 -04:00
Importing spritesheets is now possible
Moved the import png code from Main.gd to a new ImportSprites.gd script, and made ImportSprites a scene of its own.
This commit is contained in:
parent
3cac42ba15
commit
d1e5b23f0b
8 changed files with 203 additions and 78 deletions
68
Prefabs/Dialogs/ImportSprites.tscn
Normal file
68
Prefabs/Dialogs/ImportSprites.tscn
Normal file
|
@ -0,0 +1,68 @@
|
|||
[gd_scene load_steps=2 format=2]
|
||||
|
||||
[ext_resource path="res://Scripts/Dialogs/ImportSprites.gd" type="Script" id=1]
|
||||
|
||||
[node name="ImportSprites" type="FileDialog"]
|
||||
editor/display_folded = true
|
||||
margin_right = 515.0
|
||||
margin_bottom = 348.0
|
||||
window_title = "Open File(s)"
|
||||
resizable = true
|
||||
mode = 1
|
||||
access = 2
|
||||
filters = PoolStringArray( "*.bmp ; BMP Image", "*.hdr ; Radiance HDR Image", "*.jpg,*.jpeg ; JPEG Image", "*.png ; PNG Image", "*.svg ; SVG Image", "*.tga ; TGA Image", "*.webp ; WebP Image" )
|
||||
current_dir = "C:/Users/Overloaded/Dropbox/Orama Founding Members/εταιρικα αρχεια/Godot Projects/Pixelorama"
|
||||
current_path = "C:/Users/Overloaded/Dropbox/Orama Founding Members/εταιρικα αρχεια/Godot Projects/Pixelorama/"
|
||||
script = ExtResource( 1 )
|
||||
|
||||
[node name="HBoxContainer2" type="HBoxContainer" parent="."]
|
||||
margin_right = 40.0
|
||||
margin_bottom = 40.0
|
||||
|
||||
[node name="ImportAsNewFrame" type="CheckBox" parent="HBoxContainer2"]
|
||||
margin_right = 130.0
|
||||
margin_bottom = 40.0
|
||||
text = "IMPORT_FILE_LABEL"
|
||||
|
||||
[node name="ImportSpritesheet" type="CheckBox" parent="HBoxContainer2"]
|
||||
margin_left = 134.0
|
||||
margin_right = 268.0
|
||||
margin_bottom = 40.0
|
||||
text = "Import as spritesheet"
|
||||
|
||||
[node name="Spritesheet" type="HBoxContainer" parent="."]
|
||||
visible = false
|
||||
margin_right = 306.0
|
||||
margin_bottom = 17.0
|
||||
|
||||
[node name="Label" type="Label" parent="Spritesheet"]
|
||||
margin_top = 1.0
|
||||
margin_right = 101.0
|
||||
margin_bottom = 16.0
|
||||
text = "Horizontal frames:"
|
||||
|
||||
[node name="HorizontalFrames" type="SpinBox" parent="Spritesheet"]
|
||||
margin_left = 105.0
|
||||
margin_right = 159.0
|
||||
margin_bottom = 17.0
|
||||
min_value = 1.0
|
||||
value = 1.0
|
||||
|
||||
[node name="Label2" type="Label" parent="Spritesheet"]
|
||||
margin_left = 163.0
|
||||
margin_top = 1.0
|
||||
margin_right = 248.0
|
||||
margin_bottom = 16.0
|
||||
text = "Vertical frames:"
|
||||
|
||||
[node name="VerticalFrames" type="SpinBox" parent="Spritesheet"]
|
||||
margin_left = 252.0
|
||||
margin_right = 306.0
|
||||
margin_bottom = 17.0
|
||||
min_value = 1.0
|
||||
value = 1.0
|
||||
[connection signal="files_selected" from="." to="." method="_on_ImportSprites_files_selected"]
|
||||
[connection signal="pressed" from="HBoxContainer2/ImportAsNewFrame" to="." method="_on_ImportAsNewFrame_pressed"]
|
||||
[connection signal="pressed" from="HBoxContainer2/ImportSpritesheet" to="." method="_on_ImportSpritesheet_pressed"]
|
||||
[connection signal="value_changed" from="Spritesheet/HorizontalFrames" to="." method="_on_HorizontalFrames_value_changed"]
|
||||
[connection signal="value_changed" from="Spritesheet/VerticalFrames" to="." method="_on_VerticalFrames_value_changed"]
|
250
Prefabs/Dialogs/PreferencesDialog.tscn
Normal file
250
Prefabs/Dialogs/PreferencesDialog.tscn
Normal file
|
@ -0,0 +1,250 @@
|
|||
[gd_scene load_steps=4 format=2]
|
||||
|
||||
[ext_resource path="res://Scripts/Dialogs/PreferencesDialog.gd" type="Script" id=1]
|
||||
[ext_resource path="res://Assets/Fonts/Roboto-Regular.tres" type="DynamicFont" id=2]
|
||||
[ext_resource path="res://Assets/Fonts/NotoSansCJKtc-Regular.tres" type="DynamicFont" id=3]
|
||||
|
||||
|
||||
[node name="PreferencesDialog" type="AcceptDialog"]
|
||||
margin_right = 200.0
|
||||
margin_bottom = 70.0
|
||||
window_title = "Preferences"
|
||||
resizable = true
|
||||
script = ExtResource( 1 )
|
||||
|
||||
[node name="HSplitContainer" type="HSplitContainer" parent="."]
|
||||
anchor_right = 1.0
|
||||
anchor_bottom = 1.0
|
||||
margin_left = 8.0
|
||||
margin_top = 8.0
|
||||
margin_right = -8.0
|
||||
margin_bottom = -36.0
|
||||
size_flags_horizontal = 3
|
||||
custom_constants/autohide = 0
|
||||
|
||||
[node name="Tree" type="Tree" parent="HSplitContainer"]
|
||||
margin_right = 88.0
|
||||
margin_bottom = 26.0
|
||||
rect_min_size = Vector2( 88, 0 )
|
||||
custom_constants/item_margin = -2
|
||||
hide_root = true
|
||||
|
||||
[node name="ScrollContainer" type="ScrollContainer" parent="HSplitContainer"]
|
||||
margin_left = 100.0
|
||||
margin_right = 200.0
|
||||
margin_bottom = 26.0
|
||||
rect_min_size = Vector2( 100, 0 )
|
||||
size_flags_horizontal = 3
|
||||
|
||||
[node name="VBoxContainer" type="VBoxContainer" parent="HSplitContainer/ScrollContainer"]
|
||||
margin_right = 205.0
|
||||
margin_bottom = 454.0
|
||||
size_flags_horizontal = 3
|
||||
|
||||
[node name="Languages" type="VBoxContainer" parent="HSplitContainer/ScrollContainer/VBoxContainer"]
|
||||
editor/display_folded = true
|
||||
margin_right = 205.0
|
||||
margin_bottom = 282.0
|
||||
|
||||
[node name="Language Options" type="Label" parent="HSplitContainer/ScrollContainer/VBoxContainer/Languages"]
|
||||
margin_right = 205.0
|
||||
margin_bottom = 28.0
|
||||
rect_min_size = Vector2( 0, 28 )
|
||||
text = "Language Options:"
|
||||
|
||||
[node name="System Language" type="CheckBox" parent="HSplitContainer/ScrollContainer/VBoxContainer/Languages"]
|
||||
margin_top = 32.0
|
||||
margin_right = 205.0
|
||||
margin_bottom = 56.0
|
||||
mouse_default_cursor_shape = 2
|
||||
pressed = true
|
||||
text = "System Language"
|
||||
|
||||
[node name="German" type="CheckBox" parent="HSplitContainer/ScrollContainer/VBoxContainer/Languages"]
|
||||
margin_top = 60.0
|
||||
margin_right = 205.0
|
||||
margin_bottom = 84.0
|
||||
mouse_default_cursor_shape = 2
|
||||
text = "Deutsch [de]"
|
||||
|
||||
[node name="Greek" type="CheckBox" parent="HSplitContainer/ScrollContainer/VBoxContainer/Languages"]
|
||||
margin_top = 88.0
|
||||
margin_right = 205.0
|
||||
margin_bottom = 112.0
|
||||
mouse_default_cursor_shape = 2
|
||||
custom_fonts/font = ExtResource( 2 )
|
||||
text = "Ελληνικά [el]"
|
||||
|
||||
[node name="English" type="CheckBox" parent="HSplitContainer/ScrollContainer/VBoxContainer/Languages"]
|
||||
margin_top = 116.0
|
||||
margin_right = 205.0
|
||||
margin_bottom = 140.0
|
||||
mouse_default_cursor_shape = 2
|
||||
text = "English [en]"
|
||||
|
||||
[node name="French" type="CheckBox" parent="HSplitContainer/ScrollContainer/VBoxContainer/Languages"]
|
||||
margin_top = 144.0
|
||||
margin_right = 205.0
|
||||
margin_bottom = 168.0
|
||||
mouse_default_cursor_shape = 2
|
||||
text = "Français [fr]"
|
||||
|
||||
[node name="Polish" type="CheckBox" parent="HSplitContainer/ScrollContainer/VBoxContainer/Languages"]
|
||||
margin_top = 172.0
|
||||
margin_right = 205.0
|
||||
margin_bottom = 196.0
|
||||
mouse_default_cursor_shape = 2
|
||||
text = "Polski [pl]"
|
||||
|
||||
[node name="Brazilian Portuguese" type="CheckBox" parent="HSplitContainer/ScrollContainer/VBoxContainer/Languages"]
|
||||
margin_top = 200.0
|
||||
margin_right = 205.0
|
||||
margin_bottom = 224.0
|
||||
mouse_default_cursor_shape = 2
|
||||
text = "Português Brasileiro [pt_BR]"
|
||||
|
||||
[node name="Russian" type="CheckBox" parent="HSplitContainer/ScrollContainer/VBoxContainer/Languages"]
|
||||
margin_top = 228.0
|
||||
margin_right = 205.0
|
||||
margin_bottom = 252.0
|
||||
mouse_default_cursor_shape = 2
|
||||
text = "Русский [ru]"
|
||||
|
||||
[node name="Traditional Chinese" type="CheckBox" parent="HSplitContainer/ScrollContainer/VBoxContainer/Languages"]
|
||||
margin_top = 256.0
|
||||
margin_right = 205.0
|
||||
margin_bottom = 282.0
|
||||
mouse_default_cursor_shape = 2
|
||||
custom_fonts/font = ExtResource( 3 )
|
||||
text = "繁體中文 [zh_TW]"
|
||||
|
||||
[node name="Themes" type="VBoxContainer" parent="HSplitContainer/ScrollContainer/VBoxContainer"]
|
||||
editor/display_folded = true
|
||||
margin_top = 286.0
|
||||
margin_right = 205.0
|
||||
margin_bottom = 454.0
|
||||
|
||||
[node name="Theme Options" type="Label" parent="HSplitContainer/ScrollContainer/VBoxContainer/Themes"]
|
||||
margin_right = 205.0
|
||||
margin_bottom = 28.0
|
||||
rect_min_size = Vector2( 0, 28 )
|
||||
text = "Theme Options:"
|
||||
|
||||
[node name="Dark Theme" type="CheckBox" parent="HSplitContainer/ScrollContainer/VBoxContainer/Themes"]
|
||||
margin_top = 32.0
|
||||
margin_right = 205.0
|
||||
margin_bottom = 56.0
|
||||
mouse_default_cursor_shape = 2
|
||||
text = "Dark"
|
||||
|
||||
[node name="Gray Theme" type="CheckBox" parent="HSplitContainer/ScrollContainer/VBoxContainer/Themes"]
|
||||
margin_top = 60.0
|
||||
margin_right = 205.0
|
||||
margin_bottom = 84.0
|
||||
mouse_default_cursor_shape = 2
|
||||
text = "Gray"
|
||||
|
||||
[node name="Godot\'s Theme" type="CheckBox" parent="HSplitContainer/ScrollContainer/VBoxContainer/Themes"]
|
||||
margin_top = 88.0
|
||||
margin_right = 205.0
|
||||
margin_bottom = 112.0
|
||||
mouse_default_cursor_shape = 2
|
||||
text = "Godot"
|
||||
|
||||
[node name="Gold Theme" type="CheckBox" parent="HSplitContainer/ScrollContainer/VBoxContainer/Themes"]
|
||||
margin_top = 116.0
|
||||
margin_right = 205.0
|
||||
margin_bottom = 140.0
|
||||
mouse_default_cursor_shape = 2
|
||||
text = "Gold"
|
||||
|
||||
[node name="Light Theme" type="CheckBox" parent="HSplitContainer/ScrollContainer/VBoxContainer/Themes"]
|
||||
margin_top = 144.0
|
||||
margin_right = 205.0
|
||||
margin_bottom = 168.0
|
||||
mouse_default_cursor_shape = 2
|
||||
text = "Light"
|
||||
|
||||
[node name="Grid&Guides" type="VBoxContainer" parent="HSplitContainer/ScrollContainer/VBoxContainer"]
|
||||
editor/display_folded = true
|
||||
visible = false
|
||||
margin_top = 458.0
|
||||
margin_right = 205.0
|
||||
margin_bottom = 576.0
|
||||
|
||||
[node name="GridOptionsLabel" type="Label" parent="HSplitContainer/ScrollContainer/VBoxContainer/Grid&Guides"]
|
||||
margin_right = 205.0
|
||||
margin_bottom = 14.0
|
||||
rect_min_size = Vector2( 0, 28 )
|
||||
text = "Grid Οptions:"
|
||||
|
||||
[node name="GridOptions" type="GridContainer" parent="HSplitContainer/ScrollContainer/VBoxContainer/Grid&Guides"]
|
||||
margin_top = 18.0
|
||||
margin_right = 205.0
|
||||
margin_bottom = 118.0
|
||||
custom_constants/vseparation = 4
|
||||
custom_constants/hseparation = 4
|
||||
columns = 2
|
||||
|
||||
[node name="WidthLabel" type="Label" parent="HSplitContainer/ScrollContainer/VBoxContainer/Grid&Guides/GridOptions"]
|
||||
margin_top = 5.0
|
||||
margin_right = 78.0
|
||||
margin_bottom = 19.0
|
||||
text = "Width:"
|
||||
|
||||
[node name="GridWidthValue" type="SpinBox" parent="HSplitContainer/ScrollContainer/VBoxContainer/Grid&Guides/GridOptions"]
|
||||
margin_left = 82.0
|
||||
margin_right = 156.0
|
||||
margin_bottom = 24.0
|
||||
min_value = 1.0
|
||||
max_value = 16384.0
|
||||
value = 1.0
|
||||
suffix = "px"
|
||||
|
||||
[node name="Height" type="Label" parent="HSplitContainer/ScrollContainer/VBoxContainer/Grid&Guides/GridOptions"]
|
||||
margin_top = 33.0
|
||||
margin_right = 78.0
|
||||
margin_bottom = 47.0
|
||||
text = "Height:"
|
||||
|
||||
[node name="GridHeightValue" type="SpinBox" parent="HSplitContainer/ScrollContainer/VBoxContainer/Grid&Guides/GridOptions"]
|
||||
margin_left = 82.0
|
||||
margin_top = 28.0
|
||||
margin_right = 156.0
|
||||
margin_bottom = 52.0
|
||||
min_value = 1.0
|
||||
max_value = 16384.0
|
||||
value = 1.0
|
||||
suffix = "px"
|
||||
|
||||
[node name="GridColorLabel" type="Label" parent="HSplitContainer/ScrollContainer/VBoxContainer/Grid&Guides/GridOptions"]
|
||||
margin_top = 59.0
|
||||
margin_right = 78.0
|
||||
margin_bottom = 73.0
|
||||
text = "Color:"
|
||||
|
||||
[node name="GridColor" type="ColorPickerButton" parent="HSplitContainer/ScrollContainer/VBoxContainer/Grid&Guides/GridOptions"]
|
||||
margin_left = 82.0
|
||||
margin_top = 56.0
|
||||
margin_right = 156.0
|
||||
margin_bottom = 76.0
|
||||
rect_min_size = Vector2( 64, 20 )
|
||||
|
||||
[node name="GuideColorLabel" type="Label" parent="HSplitContainer/ScrollContainer/VBoxContainer/Grid&Guides/GridOptions"]
|
||||
margin_top = 83.0
|
||||
margin_right = 78.0
|
||||
margin_bottom = 97.0
|
||||
text = "Guide color:"
|
||||
|
||||
[node name="GuideColor" type="ColorPickerButton" parent="HSplitContainer/ScrollContainer/VBoxContainer/Grid&Guides/GridOptions"]
|
||||
margin_left = 82.0
|
||||
margin_top = 80.0
|
||||
margin_right = 156.0
|
||||
margin_bottom = 100.0
|
||||
rect_min_size = Vector2( 64, 20 )
|
||||
color = Color( 0.63, 0.13, 0.94, 1 )
|
||||
[connection signal="item_selected" from="HSplitContainer/Tree" to="." method="_on_Tree_item_selected"]
|
||||
[connection signal="value_changed" from="HSplitContainer/ScrollContainer/VBoxContainer/Grid&Guides/GridOptions/GridWidthValue" to="." method="_on_GridWidthValue_value_changed"]
|
||||
[connection signal="value_changed" from="HSplitContainer/ScrollContainer/VBoxContainer/Grid&Guides/GridOptions/GridHeightValue" to="." method="_on_GridHeightValue_value_changed"]
|
||||
[connection signal="color_changed" from="HSplitContainer/ScrollContainer/VBoxContainer/Grid&Guides/GridOptions/GridColor" to="." method="_on_GridColor_color_changed"]
|
||||
[connection signal="color_changed" from="HSplitContainer/ScrollContainer/VBoxContainer/Grid&Guides/GridOptions/GuideColor" to="." method="_on_GuideColor_color_changed"]
|
Loading…
Add table
Add a link
Reference in a new issue