From 93bbfabb997de105ddc071bce23988ff1b4370a2 Mon Sep 17 00:00:00 2001 From: Manolis Papadeas <35376950+OverloadedOrama@users.noreply.github.com> Date: Mon, 25 Jan 2021 22:07:02 +0200 Subject: [PATCH] Refactored CreateNewImage dialog and added portrait & landscape buttons from #402 The lock aspect ratio button has been changed from a checkbox to a texture button and the template code has been refactored to use a Template class instead of enums. Only dark icons have been added for now. --- CHANGELOG.md | 2 + Translations/Translations.pot | 8 +- .../graphics/dark_themes/misc/landscape.png | Bin 0 -> 627 bytes .../dark_themes/misc/landscape.png.import | 34 +++ .../graphics/dark_themes/misc/lock_aspect.png | Bin 0 -> 617 bytes .../dark_themes/misc/lock_aspect.png.import | 34 +++ .../dark_themes/misc/lock_aspect_2.png | Bin 0 -> 617 bytes .../dark_themes/misc/lock_aspect_2.png.import | 34 +++ .../dark_themes/misc/lock_aspect_guides.png | Bin 0 -> 624 bytes .../misc/lock_aspect_guides.png.import | 34 +++ assets/graphics/dark_themes/misc/portrait.png | Bin 0 -> 639 bytes .../dark_themes/misc/portrait.png.import | 34 +++ project.godot | 2 +- src/UI/Dialogs/CreateNewImage.gd | 159 +++++++------- src/UI/Dialogs/CreateNewImage.tscn | 203 +++++++++++++----- 15 files changed, 411 insertions(+), 133 deletions(-) create mode 100644 assets/graphics/dark_themes/misc/landscape.png create mode 100644 assets/graphics/dark_themes/misc/landscape.png.import create mode 100644 assets/graphics/dark_themes/misc/lock_aspect.png create mode 100644 assets/graphics/dark_themes/misc/lock_aspect.png.import create mode 100644 assets/graphics/dark_themes/misc/lock_aspect_2.png create mode 100644 assets/graphics/dark_themes/misc/lock_aspect_2.png.import create mode 100644 assets/graphics/dark_themes/misc/lock_aspect_guides.png create mode 100644 assets/graphics/dark_themes/misc/lock_aspect_guides.png.import create mode 100644 assets/graphics/dark_themes/misc/portrait.png create mode 100644 assets/graphics/dark_themes/misc/portrait.png.import diff --git a/CHANGELOG.md b/CHANGELOG.md index 942f2b8bb..11322dc00 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -16,6 +16,7 @@ Laurenz Reinthaler (Schweini07), kleonc - Added a new pixel grid, which is a grid of size 1px and it appears after a certain zoom level. ([#427](https://github.com/Orama-Interactive/Pixelorama/pull/427)) - Addet offset options to the grid. ([#434](https://github.com/Orama-Interactive/Pixelorama/pull/434)) - The isometric grid has been refactored to work better and to offer more changeable options, such as the width and height of the cell bounds. ([#430](https://github.com/Orama-Interactive/Pixelorama/pull/430)) +- Added portrait and landscape buttons in the new image dialog. ### Changed - Undo and redo now work when their respective keyboard shortcuts are being held. ([#405](https://github.com/Orama-Interactive/Pixelorama/pull/405)) @@ -23,6 +24,7 @@ Laurenz Reinthaler (Schweini07), kleonc - The FPS of the project animation is now stored in the pxo file. This effectively means that every project can have its own FPS. - You can now toggle if you want the grid to be drawn over the tile mode or just the original part of the canvas. ([#434](https://github.com/Orama-Interactive/Pixelorama/pull/434)) - Frame tags can now be set for frames larger than 100. ([#408](https://github.com/Orama-Interactive/Pixelorama/pull/408)) +- The "lock aspect ratio" button in the create new image dialog has been changed to a texture button. ### Fixed - Fixed layer button textures not being updated properly when changing theme. ([#404](https://github.com/Orama-Interactive/Pixelorama/issues/404)) diff --git a/Translations/Translations.pot b/Translations/Translations.pot index 99922f9b3..1febbe61a 100644 --- a/Translations/Translations.pot +++ b/Translations/Translations.pot @@ -1391,7 +1391,13 @@ msgstr "" msgid "A default background color of a new image" msgstr "" -msgid "Lock aspect ratio:" +msgid "Lock aspect ratio" +msgstr "" + +msgid "Portrait" +msgstr "" + +msgid "Landscape" msgstr "" msgid "Templates:" diff --git a/assets/graphics/dark_themes/misc/landscape.png b/assets/graphics/dark_themes/misc/landscape.png new file mode 100644 index 0000000000000000000000000000000000000000..3dd6df79371c42ea7f1def6b1c891d3ce271413e GIT binary patch literal 627 zcmV-(0*w8MP)EX>4Tx04R}tkv&MmP!xqvQ$>-Af*n*GGSp5jh>AE$6^me@v=v%)FnQ@8G-*gu zTpR`0f`dPcRRozmhi@;1h}Gm~L3a8^kl4 zmd<&fILJzpLVQjfG3bKCk6f2se&bwpSm2pKBa@mZ4ibyS4wgHZl?;`5nmDAW8s!UF zmle)ioYhK=weHDZ7|3fYX|B^6LmW#;APEsNYAB-u3sKrNQcR@iJm%pab^J+k$>b`7 zkz)Z>sE`~#_#gb9ty!3wbdv%xp!>zPKgNNcU7%UF?eAmTZk_=CXW&X}`>PFL_LKB_ zTMHcl1KYsGbz777fXf|V_(_)x$&viDghBy$KcjET0YkSy-g$03000?uMObu0Z*6U5Zgc=ca%Ew3 zWn>_CX>@2HM@dakSAh-}0000=NklEX>4Tx04R}tkv&MmP!xqvQ$>-Af*n*GGSp5jh>AE$6^me@v=v%)FnQ@8G-*gu zTpR`0f`dPcRRozmhi@;1h}Gm~L3a8^kl4 zmd<&fILJzpLVQjfG3bKCk6f2se&bwpSm2pKBa@mZ4ibyS4wgHZl?;`5nmDAW8s!UF zmle)ioYhK=weHDZ7|3fYX|B^6LmW#;APEsNYAB-u3sKrNQcR@iJm%pab^J+k$>b`7 zkz)Z>sE`~#_#gb9ty!3wbdv%xp!>zPKgNNcU7%UF?eAmTZk_=CXW&X}`>PFL_LKB_ zTMHcl1KYsGbz777fXf|V_(_)x$&viDghBy$KcjET0YkSy-_CX>@2HM@dakSAh-}0000$Nkl`t|?UuV4QkpBg4gEn&oEGdA(S zz(7W#oQ=y1*bJuF3oQ5~iE%Q;E?^pl(MWeM3_Jh;cQPk`MuX+v00000NkvXXu0mjf D@geyB literal 0 HcmV?d00001 diff --git a/assets/graphics/dark_themes/misc/lock_aspect.png.import b/assets/graphics/dark_themes/misc/lock_aspect.png.import new file mode 100644 index 000000000..4d7ae581f --- /dev/null +++ b/assets/graphics/dark_themes/misc/lock_aspect.png.import @@ -0,0 +1,34 @@ +[remap] + +importer="texture" +type="StreamTexture" +path="res://.import/lock_aspect.png-2920615523ea4c8984ebafa931aba21c.stex" +metadata={ +"vram_texture": false +} + +[deps] + +source_file="res://assets/graphics/dark_themes/misc/lock_aspect.png" +dest_files=[ "res://.import/lock_aspect.png-2920615523ea4c8984ebafa931aba21c.stex" ] + +[params] + +compress/mode=0 +compress/lossy_quality=0.7 +compress/hdr_mode=0 +compress/bptc_ldr=0 +compress/normal_map=0 +flags/repeat=0 +flags/filter=false +flags/mipmaps=false +flags/anisotropic=false +flags/srgb=2 +process/fix_alpha_border=true +process/premult_alpha=false +process/HDR_as_SRGB=false +process/invert_color=false +stream=false +size_limit=0 +detect_3d=true +svg/scale=1.0 diff --git a/assets/graphics/dark_themes/misc/lock_aspect_2.png b/assets/graphics/dark_themes/misc/lock_aspect_2.png new file mode 100644 index 0000000000000000000000000000000000000000..63b2eea458ff478a26078f2db578557a7f4aa2cc GIT binary patch literal 617 zcmV-v0+#)WP)EX>4Tx04R}tkv&MmP!xqvQ$>-Af*n*GGSp5jh>AE$6^me@v=v%)FnQ@8G-*gu zTpR`0f`dPcRRozmhi@;1h}Gm~L3a8^kl4 zmd<&fILJzpLVQjfG3bKCk6f2se&bwpSm2pKBa@mZ4ibyS4wgHZl?;`5nmDAW8s!UF zmle)ioYhK=weHDZ7|3fYX|B^6LmW#;APEsNYAB-u3sKrNQcR@iJm%pab^J+k$>b`7 zkz)Z>sE`~#_#gb9ty!3wbdv%xp!>zPKgNNcU7%UF?eAmTZk_=CXW&X}`>PFL_LKB_ zTMHcl1KYsGbz777fXf|V_(_)x$&viDghBy$KcjET0YkSy-_CX>@2HM@dakSAh-}0000$Nkl literal 0 HcmV?d00001 diff --git a/assets/graphics/dark_themes/misc/lock_aspect_2.png.import b/assets/graphics/dark_themes/misc/lock_aspect_2.png.import new file mode 100644 index 000000000..591e78b1e --- /dev/null +++ b/assets/graphics/dark_themes/misc/lock_aspect_2.png.import @@ -0,0 +1,34 @@ +[remap] + +importer="texture" +type="StreamTexture" +path="res://.import/lock_aspect_2.png-309fbe1c00b71f9c9e1f08c5968c1e4b.stex" +metadata={ +"vram_texture": false +} + +[deps] + +source_file="res://assets/graphics/dark_themes/misc/lock_aspect_2.png" +dest_files=[ "res://.import/lock_aspect_2.png-309fbe1c00b71f9c9e1f08c5968c1e4b.stex" ] + +[params] + +compress/mode=0 +compress/lossy_quality=0.7 +compress/hdr_mode=0 +compress/bptc_ldr=0 +compress/normal_map=0 +flags/repeat=0 +flags/filter=false +flags/mipmaps=false +flags/anisotropic=false +flags/srgb=2 +process/fix_alpha_border=true +process/premult_alpha=false +process/HDR_as_SRGB=false +process/invert_color=false +stream=false +size_limit=0 +detect_3d=true +svg/scale=1.0 diff --git a/assets/graphics/dark_themes/misc/lock_aspect_guides.png b/assets/graphics/dark_themes/misc/lock_aspect_guides.png new file mode 100644 index 0000000000000000000000000000000000000000..aa819201a3a5f4db76c4bec5e0723783f95a5c4d GIT binary patch literal 624 zcmV-$0+0QPP)EX>4Tx04R}tkv&MmP!xqvQ$>-Af*n*GGSp5jh>AE$6^me@v=v%)FnQ@8G-*gu zTpR`0f`dPcRRozmhi@;1h}Gm~L3a8^kl4 zmd<&fILJzpLVQjfG3bKCk6f2se&bwpSm2pKBa@mZ4ibyS4wgHZl?;`5nmDAW8s!UF zmle)ioYhK=weHDZ7|3fYX|B^6LmW#;APEsNYAB-u3sKrNQcR@iJm%pab^J+k$>b`7 zkz)Z>sE`~#_#gb9ty!3wbdv%xp!>zPKgNNcU7%UF?eAmTZk_=CXW&X}`>PFL_LKB_ zTMHcl1KYsGbz777fXf|V_(_)x$&viDghBy$KcjET0YkSy-_CX>@2HM@dakSAh-}0000-Nkl% zZi}R0iHPuQrr8gY#?B9(ypSNll0g7KDJ)9_3EmF&lS`_`IyV8$P!n#X1H?1{0000< KMNUMnLSTXeBl}?h literal 0 HcmV?d00001 diff --git a/assets/graphics/dark_themes/misc/lock_aspect_guides.png.import b/assets/graphics/dark_themes/misc/lock_aspect_guides.png.import new file mode 100644 index 000000000..db108abb8 --- /dev/null +++ b/assets/graphics/dark_themes/misc/lock_aspect_guides.png.import @@ -0,0 +1,34 @@ +[remap] + +importer="texture" +type="StreamTexture" +path="res://.import/lock_aspect_guides.png-98601575a2af1a4fd42ca9c1899b1bc7.stex" +metadata={ +"vram_texture": false +} + +[deps] + +source_file="res://assets/graphics/dark_themes/misc/lock_aspect_guides.png" +dest_files=[ "res://.import/lock_aspect_guides.png-98601575a2af1a4fd42ca9c1899b1bc7.stex" ] + +[params] + +compress/mode=0 +compress/lossy_quality=0.7 +compress/hdr_mode=0 +compress/bptc_ldr=0 +compress/normal_map=0 +flags/repeat=0 +flags/filter=false +flags/mipmaps=false +flags/anisotropic=false +flags/srgb=2 +process/fix_alpha_border=true +process/premult_alpha=false +process/HDR_as_SRGB=false +process/invert_color=false +stream=false +size_limit=0 +detect_3d=true +svg/scale=1.0 diff --git a/assets/graphics/dark_themes/misc/portrait.png b/assets/graphics/dark_themes/misc/portrait.png new file mode 100644 index 0000000000000000000000000000000000000000..fc12fb849562db9a445e2230f6ce4361291e968b GIT binary patch literal 639 zcmV-_0)YLAP)EX>4Tx04R}tkv&MmP!xqvQ$>-Af*n*GGSp5jh>AE$6^me@v=v%)FnQ@8G-*gu zTpR`0f`dPcRRozmhi@;1h}Gm~L3a8^kl4 zmd<&fILJzpLVQjfG3bKCk6f2se&bwpSm2pKBa@mZ4ibyS4wgHZl?;`5nmDAW8s!UF zmle)ioYhK=weHDZ7|3fYX|B^6LmW#;APEsNYAB-u3sKrNQcR@iJm%pab^J+k$>b`7 zkz)Z>sE`~#_#gb9ty!3wbdv%xp!>zPKgNNcU7%UF?eAmTZk_=CXW&X}`>PFL_LKB_ zTMHcl1KYsGbz777fXf|V_(_)x$&viDghBy$KcjET0YkSy-_CX>@2HM@dakSAh-}00011Nklb#-@ge zQZFzOvW<|dn22#IK0|2d1?14i7xFA*M;Rdl(EW|eFeYNt1FnFiZ8{(Zu#g*gw8>25 Z003KzC{J5d&7J@N002ovPDHLkV1hks0H^=} literal 0 HcmV?d00001 diff --git a/assets/graphics/dark_themes/misc/portrait.png.import b/assets/graphics/dark_themes/misc/portrait.png.import new file mode 100644 index 000000000..945117603 --- /dev/null +++ b/assets/graphics/dark_themes/misc/portrait.png.import @@ -0,0 +1,34 @@ +[remap] + +importer="texture" +type="StreamTexture" +path="res://.import/portrait.png-b586ce54479600a501e2a9b10ad742c1.stex" +metadata={ +"vram_texture": false +} + +[deps] + +source_file="res://assets/graphics/dark_themes/misc/portrait.png" +dest_files=[ "res://.import/portrait.png-b586ce54479600a501e2a9b10ad742c1.stex" ] + +[params] + +compress/mode=0 +compress/lossy_quality=0.7 +compress/hdr_mode=0 +compress/bptc_ldr=0 +compress/normal_map=0 +flags/repeat=0 +flags/filter=false +flags/mipmaps=false +flags/anisotropic=false +flags/srgb=2 +process/fix_alpha_border=true +process/premult_alpha=false +process/HDR_as_SRGB=false +process/invert_color=false +stream=false +size_limit=0 +detect_3d=true +svg/scale=1.0 diff --git a/project.godot b/project.godot index 2fd0bdf33..b6ff3d239 100644 --- a/project.godot +++ b/project.godot @@ -113,7 +113,7 @@ boot_splash/bg_color=Color( 0.145098, 0.145098, 0.164706, 1 ) config/icon="res://assets/graphics/icons/icon.png" config/macos_native_icon="res://assets/graphics/icons/icon.icns" config/windows_native_icon="res://assets/graphics/icons/icon.ico" -config/Version="v0.8.2-stable" +config/Version="v0.8.3-dev" [audio] diff --git a/src/UI/Dialogs/CreateNewImage.gd b/src/UI/Dialogs/CreateNewImage.gd index 9a24f8ab6..489b5bb0d 100644 --- a/src/UI/Dialogs/CreateNewImage.gd +++ b/src/UI/Dialogs/CreateNewImage.gd @@ -1,76 +1,58 @@ extends ConfirmationDialog -onready var templates_options = $VBoxContainer/OptionsContainer/TemplatesOptions -onready var ratio_box = $VBoxContainer/OptionsContainer/RatioCheckBox -onready var width_value = $VBoxContainer/OptionsContainer/WidthValue -onready var height_value = $VBoxContainer/OptionsContainer/HeightValue -onready var fill_color_node = $VBoxContainer/OptionsContainer/FillColor -onready var size_value = Vector2() +class Template: + var resolution : Vector2 + var name : String -# Template Id identifier -enum Templates { - TDefault = 0, - T16 = 1, - T32 = 2, - T64 = 3, - T128 = 4, - GB = 5, - GBA = 6, - NES_NTSC = 7, - NES_PAL = 8, - SNES_NTSC = 9, - SNES_PAL = 10 -} -# Template actual value, without Default because we get it from Global -var TResolutions = { - Templates.T16: Vector2(16,16), - Templates.T32: Vector2(32,32), - Templates.T64: Vector2(64,64), - Templates.T128: Vector2(128,128), - Templates.GB: Vector2(160,144), - Templates.GBA: Vector2(240,160), - Templates.NES_NTSC: Vector2(256,224), - Templates.NES_PAL: Vector2(256,240), - Templates.SNES_NTSC: Vector2(512,448), - Templates.SNES_PAL: Vector2(512,480), -} + func _init(_resolution : Vector2, _name := "") -> void: + resolution = _resolution + name = _name -var TStrings ={ - Templates.T16: "", - Templates.T32: "", - Templates.T64: "", - Templates.T128: "", - Templates.GB: "GB", - Templates.GBA: "GBA", - Templates.NES_NTSC: "NES (NTSC)", - Templates.NES_PAL: "NES (PAL)", - Templates.SNES_NTSC: "SNES (NTSC)", - Templates.SNES_PAL: "SNES (PAL)" - } +var aspect_ratio := 1.0 +var templates := [ + Template.new(Vector2(16, 16)), + Template.new(Vector2(32, 32)), + Template.new(Vector2(64, 64)), + Template.new(Vector2(128, 128)), + Template.new(Vector2(160, 144), "GB"), + Template.new(Vector2(240, 160), "GBA"), + Template.new(Vector2(256, 224), "NES (NTSC)"), + Template.new(Vector2(256, 240), "NES (PAL)"), + Template.new(Vector2(512, 448), "SNES (NTSC)"), + Template.new(Vector2(512, 480), "SNES (PAL)"), +] + +onready var templates_options = find_node("TemplatesOptions") +onready var ratio_box = find_node("AspectRatioButton") +onready var width_value = find_node("WidthValue") +onready var height_value = find_node("HeightValue") +onready var portrait_button = find_node("PortraitButton") +onready var landscape_button = find_node("LandscapeButton") +onready var fill_color_node = find_node("FillColor") func _ready() -> void: width_value.value = Global.default_image_width height_value.value = Global.default_image_height + aspect_ratio = width_value.value / height_value.value fill_color_node.color = Global.default_fill_color fill_color_node.get_picker().presets_visible = false - ratio_box.connect("pressed", self, "_on_RatioCheckBox_toggled", [ratio_box.pressed]) - templates_options.connect("item_selected", self, "_on_TemplatesOptions_item_selected") - - _CreateOptionList() + _create_option_list() -func _CreateOptionList() -> void: - for i in Templates.values(): - if i > 0: - if TStrings[i] != "": - templates_options.add_item("{width}x{height} - {name}".format({"width":TResolutions[i].x, "height":TResolutions[i].y, "name":TStrings[i]}), i) - else: - templates_options.add_item("{width}x{height}".format({"width":TResolutions[i].x, "height":TResolutions[i].y}), i) +func _create_option_list() -> void: + var i := 1 + for template in templates: + if template.name != "": + templates_options.add_item("{width}x{height} - {name}".format({"width":template.resolution.x, "height":template.resolution.y, "name":template.name}), i) + else: + templates_options.add_item("{width}x{height}".format({"width":template.resolution.x, "height":template.resolution.y}), i) + + i += 1 func _on_CreateNewImage_confirmed() -> void: @@ -87,30 +69,61 @@ func _on_CreateNewImage_confirmed() -> void: Global.canvas.camera_zoom() -var aspect_ratio: float - -func _on_RatioCheckBox_toggled(_button_pressed: bool) -> void: +func _on_AspectRatioButton_toggled(_button_pressed : bool) -> void: aspect_ratio = width_value.value / height_value.value - for spin_box in [width_value, height_value]: - if spin_box.is_connected("value_changed", self, "_on_SizeValue_value_changed"): - spin_box.disconnect("value_changed", self, "_on_SizeValue_value_changed") - else: - spin_box.connect("value_changed", self, "_on_SizeValue_value_changed") func _on_SizeValue_value_changed(value: float) -> void: - if width_value.value == value: - height_value.value = width_value.value / aspect_ratio - if height_value.value == value: - width_value.value = height_value.value * aspect_ratio + if ratio_box.pressed: + if width_value.value == value: + height_value.value = width_value.value / aspect_ratio + if height_value.value == value: + width_value.value = height_value.value * aspect_ratio + + toggle_size_buttons() -func _on_TemplatesOptions_item_selected(id: int) -> void: - if id != Templates.TDefault: - size_value = TResolutions[id] +func toggle_size_buttons() -> void: + portrait_button.disconnect("toggled", self, "_on_PortraitButton_toggled") + landscape_button.disconnect("toggled", self, "_on_LandscapeButton_toggled") + portrait_button.pressed = width_value.value < height_value.value + landscape_button.pressed = width_value.value > height_value.value + + portrait_button.connect("toggled", self, "_on_PortraitButton_toggled") + landscape_button.connect("toggled", self, "_on_LandscapeButton_toggled") + + +func _on_TemplatesOptions_item_selected(id : int) -> void: + if id > 0: + width_value.value = templates[id - 1].resolution.x + height_value.value = templates[id - 1].resolution.y else: width_value.value = Global.default_image_width height_value.value = Global.default_image_height - width_value.value = size_value.x - height_value.value = size_value.y + +func _on_PortraitButton_toggled(button_pressed : bool) -> void: + if !button_pressed or height_value.value > width_value.value: + toggle_size_buttons() + return + switch_width_height() + + +func _on_LandscapeButton_toggled(button_pressed : bool) -> void: + if !button_pressed or width_value.value > height_value.value: + toggle_size_buttons() + return + switch_width_height() + + +func switch_width_height() -> void: + width_value.disconnect("value_changed", self, "_on_SizeValue_value_changed") + height_value.disconnect("value_changed", self, "_on_SizeValue_value_changed") + + var height = height_value.value + height_value.value = width_value.value + width_value.value = height + toggle_size_buttons() + + width_value.connect("value_changed", self, "_on_SizeValue_value_changed") + height_value.connect("value_changed", self, "_on_SizeValue_value_changed") diff --git a/src/UI/Dialogs/CreateNewImage.tscn b/src/UI/Dialogs/CreateNewImage.tscn index 5f6cf84b0..f5a065e94 100644 --- a/src/UI/Dialogs/CreateNewImage.tscn +++ b/src/UI/Dialogs/CreateNewImage.tscn @@ -1,6 +1,11 @@ -[gd_scene load_steps=2 format=2] +[gd_scene load_steps=7 format=2] [ext_resource path="res://src/UI/Dialogs/CreateNewImage.gd" type="Script" id=1] +[ext_resource path="res://assets/graphics/dark_themes/misc/portrait.png" type="Texture" id=2] +[ext_resource path="res://assets/graphics/dark_themes/misc/landscape.png" type="Texture" id=3] +[ext_resource path="res://assets/graphics/dark_themes/misc/lock_aspect_2.png" type="Texture" id=4] +[ext_resource path="res://assets/graphics/dark_themes/misc/lock_aspect.png" type="Texture" id=5] +[ext_resource path="res://assets/graphics/dark_themes/misc/lock_aspect_guides.png" type="Texture" id=6] [node name="CreateNewImage" type="ConfirmationDialog"] margin_right = 300.0 @@ -31,23 +36,20 @@ margin_top = 18.0 margin_right = 359.0 margin_bottom = 22.0 -[node name="OptionsContainer" type="GridContainer" parent="VBoxContainer"] +[node name="TemplatesContainer" type="HBoxContainer" parent="VBoxContainer"] margin_top = 26.0 margin_right = 359.0 -margin_bottom = 154.0 -custom_constants/vseparation = 4 -custom_constants/hseparation = 2 -columns = 2 +margin_bottom = 46.0 -[node name="TemplatesLabel" type="Label" parent="VBoxContainer/OptionsContainer"] +[node name="TemplatesLabel" type="Label" parent="VBoxContainer/TemplatesContainer"] margin_top = 3.0 -margin_right = 112.0 +margin_right = 71.0 margin_bottom = 17.0 text = "Templates:" -[node name="TemplatesOptions" type="OptionButton" parent="VBoxContainer/OptionsContainer"] -margin_left = 114.0 -margin_right = 189.0 +[node name="TemplatesOptions" type="OptionButton" parent="VBoxContainer/TemplatesContainer"] +margin_left = 75.0 +margin_right = 150.0 margin_bottom = 20.0 mouse_default_cursor_shape = 2 toggle_mode = false @@ -55,68 +57,153 @@ text = "Default" items = [ "Default", null, false, 0, null ] selected = 0 -[node name="RatioLabel" type="Label" parent="VBoxContainer/OptionsContainer"] -margin_top = 29.0 -margin_right = 112.0 -margin_bottom = 43.0 -text = "Lock aspect ratio:" +[node name="SizeContainer" type="HBoxContainer" parent="VBoxContainer"] +margin_top = 50.0 +margin_right = 359.0 +margin_bottom = 102.0 -[node name="RatioCheckBox" type="CheckBox" parent="VBoxContainer/OptionsContainer"] -margin_left = 114.0 -margin_top = 24.0 -margin_right = 189.0 -margin_bottom = 48.0 +[node name="VBoxContainer" type="VBoxContainer" parent="VBoxContainer/SizeContainer"] +margin_right = 124.0 +margin_bottom = 52.0 + +[node name="WidthContainer" type="HBoxContainer" parent="VBoxContainer/SizeContainer/VBoxContainer"] +margin_right = 124.0 +margin_bottom = 24.0 + +[node name="WidthLabel" type="Label" parent="VBoxContainer/SizeContainer/VBoxContainer/WidthContainer"] +margin_top = 5.0 +margin_right = 46.0 +margin_bottom = 19.0 +rect_min_size = Vector2( 46, 0 ) +text = "Width:" + +[node name="WidthValue" type="SpinBox" parent="VBoxContainer/SizeContainer/VBoxContainer/WidthContainer"] +margin_left = 50.0 +margin_right = 124.0 +margin_bottom = 24.0 mouse_default_cursor_shape = 2 +min_value = 1.0 +max_value = 16384.0 +value = 64.0 +suffix = "px" + +[node name="HeightContainer" type="HBoxContainer" parent="VBoxContainer/SizeContainer/VBoxContainer"] +margin_top = 28.0 +margin_right = 124.0 +margin_bottom = 52.0 + +[node name="Height" type="Label" parent="VBoxContainer/SizeContainer/VBoxContainer/HeightContainer"] +margin_top = 5.0 +margin_right = 46.0 +margin_bottom = 19.0 +text = "Height:" + +[node name="HeightValue" type="SpinBox" parent="VBoxContainer/SizeContainer/VBoxContainer/HeightContainer"] +margin_left = 50.0 +margin_right = 124.0 +margin_bottom = 24.0 +mouse_default_cursor_shape = 2 +min_value = 1.0 +max_value = 16384.0 +value = 64.0 +suffix = "px" + +[node name="TextureRect" type="TextureRect" parent="VBoxContainer/SizeContainer"] +margin_left = 128.0 +margin_right = 148.0 +margin_bottom = 52.0 +texture = ExtResource( 6 ) + +[node name="AspectRatioButton" type="TextureButton" parent="VBoxContainer/SizeContainer/TextureRect"] +margin_left = 2.0 +margin_top = 14.0 +margin_right = 18.0 +margin_bottom = 30.0 +hint_tooltip = "Lock aspect ratio" +mouse_default_cursor_shape = 2 +toggle_mode = true +texture_normal = ExtResource( 4 ) +texture_pressed = ExtResource( 5 ) __meta__ = { "_edit_use_anchors_": false } -[node name="WidthLabel" type="Label" parent="VBoxContainer/OptionsContainer"] -margin_top = 57.0 -margin_right = 112.0 -margin_bottom = 71.0 -text = "Width:" +[node name="SizeButtonsContainer" type="HBoxContainer" parent="VBoxContainer"] +margin_top = 106.0 +margin_right = 359.0 +margin_bottom = 126.0 -[node name="WidthValue" type="SpinBox" parent="VBoxContainer/OptionsContainer"] -margin_left = 114.0 -margin_top = 52.0 -margin_right = 189.0 -margin_bottom = 76.0 +[node name="PortraitButton" type="Button" parent="VBoxContainer/SizeButtonsContainer"] +margin_right = 20.0 +margin_bottom = 20.0 +rect_min_size = Vector2( 20, 0 ) +hint_tooltip = "Portrait" +focus_mode = 0 mouse_default_cursor_shape = 2 -min_value = 1.0 -max_value = 16384.0 -value = 64.0 -suffix = "px" +toggle_mode = true +enabled_focus_mode = 0 -[node name="Height" type="Label" parent="VBoxContainer/OptionsContainer"] -margin_top = 85.0 -margin_right = 112.0 -margin_bottom = 99.0 -text = "Height:" +[node name="TextureRect" type="TextureRect" parent="VBoxContainer/SizeButtonsContainer/PortraitButton"] +anchor_left = 0.5 +anchor_top = 0.5 +anchor_right = 0.5 +anchor_bottom = 0.5 +margin_left = -8.0 +margin_top = -8.0 +margin_right = 8.0 +margin_bottom = 8.0 +texture = ExtResource( 2 ) +__meta__ = { +"_edit_use_anchors_": false +} -[node name="HeightValue" type="SpinBox" parent="VBoxContainer/OptionsContainer"] -margin_left = 114.0 -margin_top = 80.0 -margin_right = 189.0 -margin_bottom = 104.0 +[node name="LandscapeButton" type="Button" parent="VBoxContainer/SizeButtonsContainer"] +margin_left = 24.0 +margin_right = 44.0 +margin_bottom = 20.0 +rect_min_size = Vector2( 20, 0 ) +hint_tooltip = "Landscape" +focus_mode = 0 mouse_default_cursor_shape = 2 -min_value = 1.0 -max_value = 16384.0 -value = 64.0 -suffix = "px" +toggle_mode = true +enabled_focus_mode = 0 -[node name="FillColorLabel" type="Label" parent="VBoxContainer/OptionsContainer"] -margin_top = 111.0 -margin_right = 112.0 -margin_bottom = 125.0 +[node name="TextureRect" type="TextureRect" parent="VBoxContainer/SizeButtonsContainer/LandscapeButton"] +anchor_left = 0.5 +anchor_top = 0.5 +anchor_right = 0.5 +anchor_bottom = 0.5 +margin_left = -8.0 +margin_top = -8.0 +margin_right = 8.0 +margin_bottom = 8.0 +texture = ExtResource( 3 ) +__meta__ = { +"_edit_use_anchors_": false +} + +[node name="FillColorContainer" type="HBoxContainer" parent="VBoxContainer"] +margin_top = 130.0 +margin_right = 359.0 +margin_bottom = 150.0 + +[node name="FillColorLabel" type="Label" parent="VBoxContainer/FillColorContainer"] +margin_top = 3.0 +margin_right = 90.0 +margin_bottom = 17.0 text = "Fill with color:" -[node name="FillColor" type="ColorPickerButton" parent="VBoxContainer/OptionsContainer"] -margin_left = 114.0 -margin_top = 108.0 -margin_right = 189.0 -margin_bottom = 128.0 +[node name="FillColor" type="ColorPickerButton" parent="VBoxContainer/FillColorContainer"] +margin_left = 94.0 +margin_right = 158.0 +margin_bottom = 20.0 rect_min_size = Vector2( 64, 20 ) mouse_default_cursor_shape = 2 color = Color( 0, 0, 0, 0 ) [connection signal="confirmed" from="." to="." method="_on_CreateNewImage_confirmed"] +[connection signal="item_selected" from="VBoxContainer/TemplatesContainer/TemplatesOptions" to="." method="_on_TemplatesOptions_item_selected"] +[connection signal="value_changed" from="VBoxContainer/SizeContainer/VBoxContainer/WidthContainer/WidthValue" to="." method="_on_SizeValue_value_changed"] +[connection signal="value_changed" from="VBoxContainer/SizeContainer/VBoxContainer/HeightContainer/HeightValue" to="." method="_on_SizeValue_value_changed"] +[connection signal="toggled" from="VBoxContainer/SizeContainer/TextureRect/AspectRatioButton" to="." method="_on_AspectRatioButton_toggled"] +[connection signal="toggled" from="VBoxContainer/SizeButtonsContainer/PortraitButton" to="." method="_on_PortraitButton_toggled"] +[connection signal="toggled" from="VBoxContainer/SizeButtonsContainer/LandscapeButton" to="." method="_on_LandscapeButton_toggled"]