diff --git a/.import/test.png-2b0b935732229e5bd5e655f2644b2498.md5 b/.import/test.png-2b0b935732229e5bd5e655f2644b2498.md5 deleted file mode 100644 index 1299f6f..0000000 --- a/.import/test.png-2b0b935732229e5bd5e655f2644b2498.md5 +++ /dev/null @@ -1,3 +0,0 @@ -source_md5="f2446c62da0093ebbc5c6a4c629e95fa" -dest_md5="f805a61fa71cdc48cc5f45a98dfd4332" - diff --git a/.import/test.png-2b0b935732229e5bd5e655f2644b2498.stex b/.import/test.png-2b0b935732229e5bd5e655f2644b2498.stex deleted file mode 100644 index 795b9fd..0000000 Binary files a/.import/test.png-2b0b935732229e5bd5e655f2644b2498.stex and /dev/null differ diff --git a/.import/test2.png-dc930d6a9dd4d7b13b21ba611cfdebca.md5 b/.import/test2.png-dc930d6a9dd4d7b13b21ba611cfdebca.md5 deleted file mode 100644 index c622d71..0000000 --- a/.import/test2.png-dc930d6a9dd4d7b13b21ba611cfdebca.md5 +++ /dev/null @@ -1,3 +0,0 @@ -source_md5="4adc812d45f40a06b9b2ca01cf81ae95" -dest_md5="d6d99a1c7f42a184a39920f8abb2e0b4" - diff --git a/.import/test2.png-dc930d6a9dd4d7b13b21ba611cfdebca.stex b/.import/test2.png-dc930d6a9dd4d7b13b21ba611cfdebca.stex deleted file mode 100644 index 70b9a47..0000000 Binary files a/.import/test2.png-dc930d6a9dd4d7b13b21ba611cfdebca.stex and /dev/null differ diff --git a/.import/test3.png-8f9b5bfe1c2a8f5f1fc480e2ea82bb92.md5 b/.import/test3.png-8f9b5bfe1c2a8f5f1fc480e2ea82bb92.md5 deleted file mode 100644 index 3f793be..0000000 --- a/.import/test3.png-8f9b5bfe1c2a8f5f1fc480e2ea82bb92.md5 +++ /dev/null @@ -1,3 +0,0 @@ -source_md5="bec155c5904394450131d27b462c96e4" -dest_md5="71febc6938a68e205920ca412ebaf71d" - diff --git a/.import/test3.png-8f9b5bfe1c2a8f5f1fc480e2ea82bb92.stex b/.import/test3.png-8f9b5bfe1c2a8f5f1fc480e2ea82bb92.stex deleted file mode 100644 index db77785..0000000 Binary files a/.import/test3.png-8f9b5bfe1c2a8f5f1fc480e2ea82bb92.stex and /dev/null differ diff --git a/.import/test_blend.png-a13f0a261f39166a0d5d0b76154a64e2.md5 b/.import/test_blend.png-a13f0a261f39166a0d5d0b76154a64e2.md5 deleted file mode 100644 index 297f865..0000000 --- a/.import/test_blend.png-a13f0a261f39166a0d5d0b76154a64e2.md5 +++ /dev/null @@ -1,3 +0,0 @@ -source_md5="f6bdc4cf50b93bf6accef209602404a3" -dest_md5="8102e795bd6d15849efc2870c51252b9" - diff --git a/.import/test_blend.png-a13f0a261f39166a0d5d0b76154a64e2.stex b/.import/test_blend.png-a13f0a261f39166a0d5d0b76154a64e2.stex deleted file mode 100644 index ece9647..0000000 Binary files a/.import/test_blend.png-a13f0a261f39166a0d5d0b76154a64e2.stex and /dev/null differ diff --git a/.import/test_blend1.png-167afecc24d1a4f652165e618d695c31.md5 b/.import/test_blend1.png-167afecc24d1a4f652165e618d695c31.md5 deleted file mode 100644 index b704912..0000000 --- a/.import/test_blend1.png-167afecc24d1a4f652165e618d695c31.md5 +++ /dev/null @@ -1,3 +0,0 @@ -source_md5="3503838b09b288e7ba25eda91156f748" -dest_md5="707338f082324b175177059fbd3c6032" - diff --git a/.import/test_blend1.png-167afecc24d1a4f652165e618d695c31.stex b/.import/test_blend1.png-167afecc24d1a4f652165e618d695c31.stex deleted file mode 100644 index 6625786..0000000 Binary files a/.import/test_blend1.png-167afecc24d1a4f652165e618d695c31.stex and /dev/null differ diff --git a/.import/test_blend2.png-f0dad7baf25c6e54b41a6f2a116ecf42.md5 b/.import/test_blend2.png-f0dad7baf25c6e54b41a6f2a116ecf42.md5 deleted file mode 100644 index 3bce1fa..0000000 --- a/.import/test_blend2.png-f0dad7baf25c6e54b41a6f2a116ecf42.md5 +++ /dev/null @@ -1,3 +0,0 @@ -source_md5="16749baf6a306a99dc4e80eee2abefbf" -dest_md5="55aba65ce681911f66cffde93b5491ea" - diff --git a/.import/test_blend2.png-f0dad7baf25c6e54b41a6f2a116ecf42.stex b/.import/test_blend2.png-f0dad7baf25c6e54b41a6f2a116ecf42.stex deleted file mode 100644 index a4fb35f..0000000 Binary files a/.import/test_blend2.png-f0dad7baf25c6e54b41a6f2a116ecf42.stex and /dev/null differ diff --git a/.import/test_blend3.png-feec22cacb1aa18f93c44c7160f20f42.md5 b/.import/test_blend3.png-feec22cacb1aa18f93c44c7160f20f42.md5 deleted file mode 100644 index 6f19d2f..0000000 --- a/.import/test_blend3.png-feec22cacb1aa18f93c44c7160f20f42.md5 +++ /dev/null @@ -1,3 +0,0 @@ -source_md5="d7a9507fc7dbc1dcf4fcba5f438d20d3" -dest_md5="9b21ddc79734d495f2bcc94862d43b43" - diff --git a/.import/test_blend3.png-feec22cacb1aa18f93c44c7160f20f42.stex b/.import/test_blend3.png-feec22cacb1aa18f93c44c7160f20f42.stex deleted file mode 100644 index 9f8f014..0000000 Binary files a/.import/test_blend3.png-feec22cacb1aa18f93c44c7160f20f42.stex and /dev/null differ diff --git a/.import/test_blend4.png-8619abbd051622dc3a1a96b29ef7aaae.md5 b/.import/test_blend4.png-8619abbd051622dc3a1a96b29ef7aaae.md5 deleted file mode 100644 index fd4f2ba..0000000 --- a/.import/test_blend4.png-8619abbd051622dc3a1a96b29ef7aaae.md5 +++ /dev/null @@ -1,3 +0,0 @@ -source_md5="976b0714fcbc434f323dad76d3b5bf36" -dest_md5="0f5e8acf1d61ab0711f44f75905e5a8a" - diff --git a/.import/test_blend4.png-8619abbd051622dc3a1a96b29ef7aaae.stex b/.import/test_blend4.png-8619abbd051622dc3a1a96b29ef7aaae.stex deleted file mode 100644 index 648bbbe..0000000 Binary files a/.import/test_blend4.png-8619abbd051622dc3a1a96b29ef7aaae.stex and /dev/null differ diff --git a/.import/test_blend5.png-952e9ca6dabcfbaa26ca722fb438460d.md5 b/.import/test_blend5.png-952e9ca6dabcfbaa26ca722fb438460d.md5 deleted file mode 100644 index 5bb67bc..0000000 --- a/.import/test_blend5.png-952e9ca6dabcfbaa26ca722fb438460d.md5 +++ /dev/null @@ -1,3 +0,0 @@ -source_md5="06f1cb8e512e5adfad002ef0338a818e" -dest_md5="87b2e06d78c49f4dc5456f18656eb3d3" - diff --git a/.import/test_blend5.png-952e9ca6dabcfbaa26ca722fb438460d.stex b/.import/test_blend5.png-952e9ca6dabcfbaa26ca722fb438460d.stex deleted file mode 100644 index 519371d..0000000 Binary files a/.import/test_blend5.png-952e9ca6dabcfbaa26ca722fb438460d.stex and /dev/null differ diff --git a/.import/test_blend6.png-c312879c7424d3f742a8629bdf12c861.md5 b/.import/test_blend6.png-c312879c7424d3f742a8629bdf12c861.md5 deleted file mode 100644 index c06755e..0000000 --- a/.import/test_blend6.png-c312879c7424d3f742a8629bdf12c861.md5 +++ /dev/null @@ -1,3 +0,0 @@ -source_md5="2d4a406047a743eb20e0ce47be843558" -dest_md5="86808acdf32b0015647e3b12e728ce0a" - diff --git a/.import/test_blend6.png-c312879c7424d3f742a8629bdf12c861.stex b/.import/test_blend6.png-c312879c7424d3f742a8629bdf12c861.stex deleted file mode 100644 index 34d91ff..0000000 Binary files a/.import/test_blend6.png-c312879c7424d3f742a8629bdf12c861.stex and /dev/null differ diff --git a/.import/test_blend7.png-3fa1be78ca4193859b8a428052ed246f.md5 b/.import/test_blend7.png-3fa1be78ca4193859b8a428052ed246f.md5 deleted file mode 100644 index 8d3f4db..0000000 --- a/.import/test_blend7.png-3fa1be78ca4193859b8a428052ed246f.md5 +++ /dev/null @@ -1,3 +0,0 @@ -source_md5="c576029f055c5661a5ab02e79f718143" -dest_md5="03d4d90c298c894e9d624b48ca00b128" - diff --git a/.import/test_blend7.png-3fa1be78ca4193859b8a428052ed246f.stex b/.import/test_blend7.png-3fa1be78ca4193859b8a428052ed246f.stex deleted file mode 100644 index e4423c8..0000000 Binary files a/.import/test_blend7.png-3fa1be78ca4193859b8a428052ed246f.stex and /dev/null differ diff --git a/.import/test_blend8.png-8430826c445aa334cda4e6aa4e2be776.md5 b/.import/test_blend8.png-8430826c445aa334cda4e6aa4e2be776.md5 deleted file mode 100644 index 8253da1..0000000 --- a/.import/test_blend8.png-8430826c445aa334cda4e6aa4e2be776.md5 +++ /dev/null @@ -1,3 +0,0 @@ -source_md5="4440cfb0f469fe68adca066948bc8183" -dest_md5="da9faa3bbd2610755b629238ae47dc44" - diff --git a/.import/test_blend8.png-8430826c445aa334cda4e6aa4e2be776.stex b/.import/test_blend8.png-8430826c445aa334cda4e6aa4e2be776.stex deleted file mode 100644 index 81f7d2b..0000000 Binary files a/.import/test_blend8.png-8430826c445aa334cda4e6aa4e2be776.stex and /dev/null differ diff --git a/addons/graphics_editor/Canvas.gd b/addons/graphics_editor/Canvas.gd index ee1f9fe..d4282c7 100644 --- a/addons/graphics_editor/Canvas.gd +++ b/addons/graphics_editor/Canvas.gd @@ -15,6 +15,7 @@ var mouse_on_top var layers : Array = [] # Key: layer_name, val: GELayer var active_layer: GELayer var preview_layer: GELayer +var canvas_layers: Control var canvas var grid @@ -30,6 +31,7 @@ func _enter_tree(): canvas = find_node("Canvas") grid = find_node("Grid") big_grid = find_node("BigGrid") + canvas_layers = find_node("CanvasLayers") #------------------------------- # setup layers and canvas @@ -50,29 +52,34 @@ func _enter_tree(): func _process(delta): - if active_layer == null: + if not Engine.is_editor_hint(): return var mouse_position = get_local_mouse_position() var rect = Rect2(Vector2(0, 0), rect_size) mouse_in_region = rect.has_point(mouse_position) - update() func _draw(): + if not Engine.is_editor_hint(): + return for layer in layers: - if not layer.visible: - continue - var idx = 0 - for color in layer.pixels: - var p = GEUtils.to_2D(idx, canvas_width) - draw_rect(Rect2(p.x * pixel_size, p.y * pixel_size, pixel_size, pixel_size), color) - idx += 1 + layer.update_texture() - var idx = 0 - for color in preview_layer.pixels: - var p = GEUtils.to_2D(idx, canvas_width) - draw_rect(Rect2(p.x * pixel_size, p.y * pixel_size, pixel_size, pixel_size), color) - idx += 1 + preview_layer.update_texture() + + +func resize(width: int, height: int): + if width < 0: + width = 1 + if height < 0: + height = 1 + + set_canvas_width(width) + set_canvas_height(height) + + preview_layer.resize(width, height) + for layer in layers: + layer.resize(width, height) @@ -86,6 +93,13 @@ func set_pixel_size(size: int): set_big_grid_size(big_grid_size) set_canvas_width(canvas_width) set_canvas_height(canvas_height) + + return + if preview_layer == null: + return + preview_layer.resize(canvas_width, canvas_height) + for layer in layers: + layer.resize(canvas_width, canvas_height) func set_grid_size(size): @@ -159,7 +173,17 @@ func add_new_layer(layer_name: String): return var layer = GELayer.new() layer.name = layer_name - layer.resize(canvas_width, canvas_height) + + var texture_rect = TextureRect.new() + canvas_layers.add_child(texture_rect) + texture_rect.expand = true + texture_rect.anchor_right = 1 + texture_rect.anchor_bottom = 1 + texture_rect.margin_right = 0 + texture_rect.margin_bottom = 0 + texture_rect.mouse_filter = Control.MOUSE_FILTER_IGNORE + + layer.create(texture_rect, canvas_width, canvas_height) if layer_name != "Preview": layers.append(layer) return layer @@ -282,7 +306,7 @@ func get_pixel_v(pos: Vector2): func get_pixel(x: int, y: int): var idx = GEUtils.to_1D(x, y, canvas_width) if active_layer: - if active_layer.pixels.size() <= idx: + if idx >= 0 and active_layer.pixels.size() <= idx: return null return active_layer.pixels[idx] return null @@ -310,6 +334,27 @@ func get_preview_pixel(x: int, y: int): return preview_layer.pixels[idx] + +#------------------------------- +# Grid +#------------------------------- + + +func toggle_grid(): + $BigGrid.visible = not $BigGrid.visible + $Grid.visible = not $Grid.visible + + +func show_grid(): + $BigGrid.show() + $Grid.show() + + +func hide_grid(): + $BigGrid.hide() + $Grid.hide() + + #------------------------------- # Handy tools #------------------------------- diff --git a/addons/graphics_editor/Editor.gd b/addons/graphics_editor/Editor.gd index e0596bb..d632977 100644 --- a/addons/graphics_editor/Editor.gd +++ b/addons/graphics_editor/Editor.gd @@ -17,6 +17,7 @@ enum Tools { var layer_buttons: Control var paint_canvas_container_node var paint_canvas: GECanvas +var canvas_background: TextureRect var grids_node var colors_grid var selected_color = Color(1, 1, 1, 1) @@ -24,7 +25,12 @@ var util = preload("res://addons/graphics_editor/Util.gd") var textinfo var allow_drawing = true +var mouse_in_region = false +var mouse_on_top = false + +var _middle_mouse_pressed_pos = null +var _middle_mouse_pressed_start_pos = null var _left_mouse_pressed_start_pos = Vector2() var _previous_tool @@ -58,8 +64,9 @@ func _enter_tree(): textinfo = find_node("DebugTextDisplay") selected_color = find_node("ColorPicker").color colors_grid = find_node("Colors") - paint_canvas = get_node("Panel/VBoxContainer/HBoxContainer/PaintCanvasContainer/Canvas") + paint_canvas = paint_canvas_container_node.find_node("Canvas") layer_buttons = find_node("LayerButtons") + canvas_background = find_node("CanvasBackground") set_process(true) @@ -80,12 +87,25 @@ func _ready(): func _input(event): + if not Engine.is_editor_hint(): + return + if Rect2(Vector2(), paint_canvas_container_node.rect_size).has_point( + paint_canvas_container_node.get_local_mouse_position()): + mouse_in_region = true + elif mouse_in_region: + mouse_in_region = false + + if not mouse_on_top or not mouse_in_region: + return + if Input.is_key_pressed(KEY_Z): undo_action() elif Input.is_key_pressed(KEY_Y): - print("Y") + pass - if (paint_canvas.mouse_in_region and paint_canvas.mouse_on_top): + _handle_zoom(event) + + if paint_canvas and (paint_canvas.mouse_in_region and paint_canvas.mouse_on_top): match brush_mode: Tools.BUCKET: if _current_action == null: @@ -113,6 +133,10 @@ var last_cell_color = Color() # warning-ignore:unused_argument func _process(delta): + if not Engine.is_editor_hint(): + return + if not mouse_on_top or not mouse_in_region: + return update_text_info() #It's a lot more easier to just keep updating the variables in here than just have a bunch of local variables #in every update function and make it very messy @@ -121,6 +145,10 @@ func _process(delta): set_process(false) return + + if mouse_on_top and mouse_in_region: + _handle_scroll() + #Update commonly used variables var grid_size = paint_canvas.pixel_size mouse_position = paint_canvas.get_local_mouse_position() @@ -133,7 +161,7 @@ func _process(delta): brush_process() #Render the highlighting stuff - update() + #Canvas Shift Moving if not mouse_position == last_mouse_position: @@ -154,6 +182,42 @@ func _process(delta): last_cell_color = cell_color +func _handle_scroll(): + if Input.is_mouse_button_pressed(BUTTON_MIDDLE): + if _middle_mouse_pressed_start_pos == null: + _middle_mouse_pressed_start_pos = paint_canvas.rect_position + _middle_mouse_pressed_pos = get_global_mouse_position() + + paint_canvas.rect_position = _middle_mouse_pressed_start_pos + paint_canvas.rect_position += get_global_mouse_position() - _middle_mouse_pressed_pos + + elif _middle_mouse_pressed_start_pos != null: + _middle_mouse_pressed_start_pos = null + + +const max_zoom_out = 1 +const max_zoom_in = 50 + +func _handle_zoom(event): + if not event is InputEventMouseButton: + return + if event.is_pressed(): + if event.button_index == BUTTON_WHEEL_UP: + paint_canvas.set_pixel_size(min(paint_canvas.pixel_size * 2, max_zoom_in)) + return + if paint_canvas.pixel_size != max_zoom_in: + paint_canvas.rect_global_position -= Vector2( + paint_canvas.canvas_width / 2, + paint_canvas.canvas_height / 2) + elif event.button_index == BUTTON_WHEEL_DOWN: + paint_canvas.set_pixel_size(max(paint_canvas.pixel_size / 2.0, max_zoom_out)) + return + if paint_canvas.pixel_size != max_zoom_out: + paint_canvas.rect_global_position += Vector2( + paint_canvas.canvas_width / 2, + paint_canvas.canvas_height / 2) + + func _reset_cut_tool(): _just_cut = false _show_cut = false @@ -192,9 +256,13 @@ func _handle_cut(): func brush_process(): if _just_cut: _handle_cut() + update() + paint_canvas.update() return if Input.is_mouse_button_pressed(BUTTON_LEFT): + update() + paint_canvas.update() if _current_action == null: _current_action = get_action() @@ -217,12 +285,10 @@ func brush_process(): do_action([cell_mouse_position, last_cell_mouse_position, selected_color]) Tools.RAINBOW: do_action([cell_mouse_position, last_cell_mouse_position]) - else: - if _current_action and _current_action.can_commit(): - commit_action() - if Input.is_mouse_button_pressed(BUTTON_RIGHT): - return + elif Input.is_mouse_button_pressed(BUTTON_RIGHT): + update() + paint_canvas.update() if _current_action == null: _current_action = get_action() @@ -231,6 +297,11 @@ func brush_process(): do_action([cell_mouse_position, last_cell_mouse_position, Color(0, 0, 0, 0)]) Tools.BRUSH: do_action([cell_mouse_position, last_cell_mouse_position, Color(0, 0, 0, 0), selected_brush_prefab]) + else: + if _current_action and _current_action.can_commit(): + commit_action() + update() + paint_canvas.update() func update_text_info(): @@ -312,6 +383,8 @@ func undo_action(): if not action: return action.undo_action(paint_canvas) + update() + paint_canvas.update() print("undo action") @@ -437,18 +510,21 @@ func select_layer(layer_name: String): func add_new_layer(): - var new_layer = layer_buttons.get_child(0).duplicate() - layer_buttons.add_child_below_node(layer_buttons.get_child(layer_buttons.get_child_count() - 1), new_layer, true) + var new_layer_button = layer_buttons.get_child(0).duplicate() + layer_buttons.add_child_below_node( + layer_buttons.get_child(layer_buttons.get_child_count() - 1), new_layer_button, true) _total_added_layers += 1 - new_layer.text = "Layer " + str(_total_added_layers) + new_layer_button.text = "Layer " + str(_total_added_layers) - var layer: GELayer = paint_canvas.add_new_layer(new_layer.name) + var layer: GELayer = paint_canvas.add_new_layer(new_layer_button.name) - _layer_button_ref[new_layer.name] = new_layer + _layer_button_ref[new_layer_button.name] = new_layer_button _connect_layer_buttons() print("added layer: ", layer.name) + + return layer func remove_active_layer(): @@ -520,3 +596,9 @@ func _on_Button_pressed(): +func _on_PaintCanvasContainer_mouse_entered(): + mouse_on_top = true + + +func _on_PaintCanvasContainer_mouse_exited(): + mouse_on_top = false diff --git a/addons/graphics_editor/Editor.tscn b/addons/graphics_editor/Editor.tscn index 5708ed2..c12023b 100644 --- a/addons/graphics_editor/Editor.tscn +++ b/addons/graphics_editor/Editor.tscn @@ -1,6 +1,7 @@ -[gd_scene load_steps=39 format=2] +[gd_scene load_steps=43 format=2] [ext_resource path="res://addons/graphics_editor/Editor.gd" type="Script" id=1] +[ext_resource path="res://addons/graphics_editor/dialogs/LoadFileDialog.gd" type="Script" id=2] [ext_resource path="res://addons/graphics_editor/Canvas.gd" type="Script" id=3] [ext_resource path="res://addons/graphics_editor/VisualGrid.tscn" type="PackedScene" id=4] [ext_resource path="res://addons/graphics_editor/CanvasOutline.gd" type="Script" id=5] @@ -11,9 +12,14 @@ [ext_resource path="res://addons/graphics_editor/Settings.tscn" type="PackedScene" id=10] [ext_resource path="res://addons/graphics_editor/DebugTextDisplay.gd" type="Script" id=11] [ext_resource path="res://addons/graphics_editor/LayerButton.tscn" type="PackedScene" id=12] -[ext_resource path="res://icon.png" type="Texture" id=13] +[ext_resource path="res://addons/graphics_editor/assets/grid.png" type="Texture" id=13] +[ext_resource path="res://addons/graphics_editor/dialogs/ConfirmationDialog.gd" type="Script" id=14] +[ext_resource path="res://addons/graphics_editor/dialogs/ChangeGridSizeDialog.gd" type="Script" id=15] -[sub_resource type="StyleBoxFlat" id=1] +[sub_resource type="StyleBoxFlat" id=28] +bg_color = Color( 0.2, 0.2, 0.2, 1 ) + +[sub_resource type="StyleBoxFlat" id=2] bg_color = Color( 0.25, 0.25, 0.25, 1 ) border_width_left = 1 border_width_top = 1 @@ -25,79 +31,79 @@ corner_radius_top_right = 2 corner_radius_bottom_right = 2 corner_radius_bottom_left = 2 -[sub_resource type="StyleBoxFlat" id=27] -bg_color = Color( 0.103793, 0.952543, 0.558178, 1 ) - -[sub_resource type="StyleBoxFlat" id=28] -bg_color = Color( 0.68094, 0.136103, 0.784658, 1 ) - [sub_resource type="StyleBoxFlat" id=29] -bg_color = Color( 0.565245, 0.950216, 0.525136, 1 ) +bg_color = Color( 0.992425, 0.72214, 0.22694, 1 ) [sub_resource type="StyleBoxFlat" id=30] -bg_color = Color( 0.840295, 0.689674, 0.146119, 1 ) +bg_color = Color( 0.188976, 0.642524, 0.740442, 1 ) [sub_resource type="StyleBoxFlat" id=31] -bg_color = Color( 0.170796, 0.863757, 0.940376, 1 ) +bg_color = Color( 0.839845, 0.552142, 0.433226, 1 ) [sub_resource type="StyleBoxFlat" id=32] -bg_color = Color( 0.989842, 0.167318, 0.759568, 1 ) +bg_color = Color( 0.997992, 0.341005, 0.762806, 1 ) [sub_resource type="StyleBoxFlat" id=33] -bg_color = Color( 0.424938, 0.286666, 0.207677, 1 ) +bg_color = Color( 0.504709, 0.669541, 0.499676, 1 ) [sub_resource type="StyleBoxFlat" id=34] -bg_color = Color( 0.470532, 0.276365, 0.490264, 1 ) +bg_color = Color( 0.511632, 0.846479, 0.257186, 1 ) [sub_resource type="StyleBoxFlat" id=35] -bg_color = Color( 0.479465, 0.612879, 0.603754, 1 ) +bg_color = Color( 0.104288, 0.47341, 0.657715, 1 ) [sub_resource type="StyleBoxFlat" id=36] -bg_color = Color( 0.66582, 0.937007, 0.078631, 1 ) +bg_color = Color( 0.209301, 0.260868, 0.090683, 1 ) [sub_resource type="StyleBoxFlat" id=37] -bg_color = Color( 0.969678, 0.463082, 0.741374, 1 ) +bg_color = Color( 0.737483, 0.85665, 0.452039, 1 ) [sub_resource type="StyleBoxFlat" id=38] -bg_color = Color( 0.748974, 0.911029, 0.0970848, 1 ) +bg_color = Color( 0.721016, 0.818223, 0.305368, 1 ) [sub_resource type="StyleBoxFlat" id=39] -bg_color = Color( 0.0446367, 0.149028, 0.965347, 1 ) +bg_color = Color( 0.11069, 0.60355, 0.886431, 1 ) [sub_resource type="StyleBoxFlat" id=40] -bg_color = Color( 0.652305, 0.82955, 0.449331, 1 ) +bg_color = Color( 0.231713, 0.673817, 0.173052, 1 ) [sub_resource type="StyleBoxFlat" id=41] -bg_color = Color( 0.858449, 0.143876, 0.556734, 1 ) +bg_color = Color( 0.406265, 0.172438, 0.309769, 1 ) [sub_resource type="StyleBoxFlat" id=42] -bg_color = Color( 0.885448, 0.997685, 0.776802, 1 ) +bg_color = Color( 0.819319, 0.927778, 0.361548, 1 ) [sub_resource type="StyleBoxFlat" id=43] -bg_color = Color( 0.404004, 0.65451, 0.498103, 1 ) +bg_color = Color( 0.0092795, 0.251186, 0.846242, 1 ) [sub_resource type="StyleBoxFlat" id=44] -bg_color = Color( 0.0711977, 0.735235, 0.953192, 1 ) +bg_color = Color( 0.26609, 0.90187, 0.702388, 1 ) [sub_resource type="StyleBoxFlat" id=45] -bg_color = Color( 0.696129, 0.303368, 0.559114, 1 ) +bg_color = Color( 0.727636, 0.395947, 0.545933, 1 ) [sub_resource type="StyleBoxFlat" id=46] -bg_color = Color( 0.16818, 0.0828524, 0.104581, 1 ) +bg_color = Color( 0.673933, 0.595609, 0.891036, 1 ) [sub_resource type="StyleBoxFlat" id=47] -bg_color = Color( 0.388226, 0.400829, 0.895155, 1 ) +bg_color = Color( 0.828221, 0.65787, 0.905474, 1 ) [sub_resource type="StyleBoxFlat" id=48] -bg_color = Color( 0.381586, 0.871279, 0.0388422, 1 ) +bg_color = Color( 0.0794242, 0.693443, 0.325962, 1 ) [sub_resource type="StyleBoxFlat" id=49] -bg_color = Color( 0.0975624, 0.683663, 0.768315, 1 ) +bg_color = Color( 0.227995, 0.60802, 0.650897, 1 ) [sub_resource type="StyleBoxFlat" id=50] -bg_color = Color( 0.125084, 0.498048, 0.0623495, 1 ) +bg_color = Color( 0.213816, 0.447523, 0.105662, 1 ) -[sub_resource type="StyleBoxFlat" id=26] +[sub_resource type="StyleBoxFlat" id=51] +bg_color = Color( 0.34228, 0.766934, 0.145565, 1 ) + +[sub_resource type="StyleBoxFlat" id=52] +bg_color = Color( 0.920236, 0.967262, 0.495874, 1 ) + +[sub_resource type="StyleBoxFlat" id=27] bg_color = Color( 0.156863, 0.156863, 0.156863, 1 ) border_width_top = 2 border_color = Color( 0.0901961, 0.0901961, 0.0901961, 1 ) @@ -110,7 +116,6 @@ size_flags_horizontal = 3 size_flags_vertical = 3 script = ExtResource( 1 ) __meta__ = { -"_edit_lock_": true, "_edit_use_anchors_": false } @@ -121,32 +126,565 @@ __meta__ = { "_edit_use_anchors_": false } -[node name="VBoxContainer" type="VBoxContainer" parent="Panel"] +[node name="NoBCViewportsnotworking26181" type="Control" parent="Panel"] anchor_right = 1.0 anchor_bottom = 1.0 __meta__ = { "_edit_lock_": true, +"_editor_description_": "https://github.com/godotengine/godot/issues/26181" +} + +[node name="HBoxContainer" type="HBoxContainer" parent="Panel/NoBCViewportsnotworking26181"] +show_behind_parent = true +anchor_top = 0.081 +anchor_right = 1.0 +anchor_bottom = 1.0 +margin_top = -3.8147e-06 +size_flags_horizontal = 3 +size_flags_vertical = 3 +size_flags_stretch_ratio = 10.0 +__meta__ = { +"_edit_use_anchors_": true +} + +[node name="PaintCanvasContainer" type="Control" parent="Panel/NoBCViewportsnotworking26181/HBoxContainer"] +margin_right = 892.0 +margin_bottom = 551.0 +focus_mode = 1 +mouse_filter = 1 +size_flags_horizontal = 3 +size_flags_vertical = 3 +size_flags_stretch_ratio = 7.0 + +[node name="Canvas" type="Control" parent="Panel/NoBCViewportsnotworking26181/HBoxContainer/PaintCanvasContainer"] +anchor_left = 0.5 +anchor_top = 0.5 +anchor_right = 0.5 +anchor_bottom = 0.5 +margin_left = -128.0 +margin_top = -128.0 +margin_right = 128.0 +margin_bottom = 128.0 +mouse_filter = 1 +size_flags_horizontal = 3 +size_flags_vertical = 3 +script = ExtResource( 3 ) +__meta__ = { +"_edit_group_": true, +"_edit_use_anchors_": false +} +pixel_size = 4 +canvas_width = 64 +canvas_height = 64 +grid_size = 1 +big_grid_size = 8 + +[node name="CanvasBackground" type="TextureRect" parent="Panel/NoBCViewportsnotworking26181/HBoxContainer/PaintCanvasContainer/Canvas"] +visible = false +self_modulate = Color( 1, 1, 1, 0.341176 ) +show_behind_parent = true +anchor_right = 1.0 +anchor_bottom = 1.0 +texture = ExtResource( 13 ) +expand = true +stretch_mode = 2 +__meta__ = { +"_edit_lock_": true +} + +[node name="CanvasLayers" type="Control" parent="Panel/NoBCViewportsnotworking26181/HBoxContainer/PaintCanvasContainer/Canvas"] +anchor_right = 1.0 +anchor_bottom = 1.0 +mouse_filter = 2 +__meta__ = { +"_edit_lock_": true, "_edit_use_anchors_": false } -[node name="Navbar" type="Control" parent="Panel/VBoxContainer"] -margin_right = 1024.0 -margin_bottom = 50.0 -size_flags_horizontal = 3 -size_flags_vertical = 3 -script = ExtResource( 6 ) +[node name="PreviewLayer" type="TextureRect" parent="Panel/NoBCViewportsnotworking26181/HBoxContainer/PaintCanvasContainer/Canvas"] +anchor_right = 1.0 +anchor_bottom = 1.0 +mouse_filter = 2 +expand = true __meta__ = { "_edit_use_anchors_": false } -[node name="Panel" type="Panel" parent="Panel/VBoxContainer/Navbar"] +[node name="ToolPreviewLayer" type="TextureRect" parent="Panel/NoBCViewportsnotworking26181/HBoxContainer/PaintCanvasContainer/Canvas"] +anchor_right = 1.0 +anchor_bottom = 1.0 +mouse_filter = 2 +expand = true +__meta__ = { +"_edit_use_anchors_": false +} + +[node name="Grid" parent="Panel/NoBCViewportsnotworking26181/HBoxContainer/PaintCanvasContainer/Canvas" instance=ExtResource( 4 )] +mouse_filter = 2 +color = Color( 1, 1, 1, 0.12549 ) +size = 4 + +[node name="BigGrid" parent="Panel/NoBCViewportsnotworking26181/HBoxContainer/PaintCanvasContainer/Canvas" instance=ExtResource( 4 )] +mouse_filter = 2 +color = Color( 1, 1, 1, 0.576471 ) +size = 32 + +[node name="CanvasOutline" type="Control" parent="Panel/NoBCViewportsnotworking26181/HBoxContainer/PaintCanvasContainer/Canvas"] +anchor_right = 1.0 +anchor_bottom = 1.0 +mouse_filter = 2 +script = ExtResource( 5 ) +__meta__ = { +"_edit_lock_": true, +"_edit_use_anchors_": false +} +color = Color( 0, 1, 0, 1 ) + +[node name="Panel" type="Panel" parent="Panel/NoBCViewportsnotworking26181/HBoxContainer"] +margin_left = 896.0 +margin_right = 1024.0 +margin_bottom = 551.0 +size_flags_horizontal = 3 +size_flags_vertical = 3 +custom_styles/panel = SubResource( 28 ) + +[node name="ScrollContainer" type="ScrollContainer" parent="Panel/NoBCViewportsnotworking26181/HBoxContainer/Panel"] +anchor_right = 1.0 +anchor_bottom = 1.0 +margin_left = 4.0 +margin_top = 4.0 +margin_right = -4.0 +margin_bottom = -4.0 +size_flags_horizontal = 3 +size_flags_vertical = 3 +__meta__ = { +"_edit_use_anchors_": false +} + +[node name="ToolMenu" type="VBoxContainer" parent="Panel/NoBCViewportsnotworking26181/HBoxContainer/Panel/ScrollContainer"] +margin_right = 120.0 +margin_bottom = 543.0 +size_flags_horizontal = 3 +size_flags_vertical = 3 + +[node name="Tools" type="VBoxContainer" parent="Panel/NoBCViewportsnotworking26181/HBoxContainer/Panel/ScrollContainer/ToolMenu"] +margin_right = 120.0 +margin_bottom = 256.0 +size_flags_horizontal = 3 +size_flags_vertical = 3 + +[node name="PaintTool" type="Button" parent="Panel/NoBCViewportsnotworking26181/HBoxContainer/Panel/ScrollContainer/ToolMenu/Tools"] +margin_right = 120.0 +margin_bottom = 20.0 +size_flags_horizontal = 3 +size_flags_vertical = 3 +text = "Paint" + +[node name="BrushTool" type="Button" parent="Panel/NoBCViewportsnotworking26181/HBoxContainer/Panel/ScrollContainer/ToolMenu/Tools"] +margin_top = 24.0 +margin_right = 120.0 +margin_bottom = 40.0 +size_flags_horizontal = 3 +size_flags_vertical = 3 +custom_styles/hover = SubResource( 2 ) +custom_styles/pressed = SubResource( 2 ) +custom_styles/focus = SubResource( 2 ) +custom_styles/disabled = SubResource( 2 ) +custom_styles/normal = SubResource( 2 ) +text = "Brush" + +[node name="BucketTool" type="Button" parent="Panel/NoBCViewportsnotworking26181/HBoxContainer/Panel/ScrollContainer/ToolMenu/Tools"] +margin_top = 44.0 +margin_right = 120.0 +margin_bottom = 64.0 +size_flags_horizontal = 3 +size_flags_vertical = 3 +text = "Bucket Fill" +__meta__ = { +"_edit_use_anchors_": false +} + +[node name="RainbowTool" type="Button" parent="Panel/NoBCViewportsnotworking26181/HBoxContainer/Panel/ScrollContainer/ToolMenu/Tools"] +margin_top = 68.0 +margin_right = 120.0 +margin_bottom = 88.0 +size_flags_horizontal = 3 +size_flags_vertical = 3 +text = "Rainbow" +__meta__ = { +"_edit_use_anchors_": false +} + +[node name="LineTool" type="Button" parent="Panel/NoBCViewportsnotworking26181/HBoxContainer/Panel/ScrollContainer/ToolMenu/Tools"] +margin_top = 92.0 +margin_right = 120.0 +margin_bottom = 112.0 +size_flags_horizontal = 3 +size_flags_vertical = 3 +text = "Line" +__meta__ = { +"_edit_use_anchors_": false +} + +[node name="RectTool" type="Button" parent="Panel/NoBCViewportsnotworking26181/HBoxContainer/Panel/ScrollContainer/ToolMenu/Tools"] +margin_top = 116.0 +margin_right = 120.0 +margin_bottom = 136.0 +size_flags_horizontal = 3 +size_flags_vertical = 3 +text = "Rectangle" +__meta__ = { +"_edit_use_anchors_": false +} + +[node name="DarkenTool" type="Button" parent="Panel/NoBCViewportsnotworking26181/HBoxContainer/Panel/ScrollContainer/ToolMenu/Tools"] +margin_top = 140.0 +margin_right = 120.0 +margin_bottom = 160.0 +size_flags_horizontal = 3 +size_flags_vertical = 3 +text = "Darken" +__meta__ = { +"_edit_use_anchors_": false +} + +[node name="BrightenTool" type="Button" parent="Panel/NoBCViewportsnotworking26181/HBoxContainer/Panel/ScrollContainer/ToolMenu/Tools"] +margin_top = 164.0 +margin_right = 120.0 +margin_bottom = 184.0 +size_flags_horizontal = 3 +size_flags_vertical = 3 +text = "Brighten" +__meta__ = { +"_edit_use_anchors_": false +} + +[node name="ColorPickerTool" type="Button" parent="Panel/NoBCViewportsnotworking26181/HBoxContainer/Panel/ScrollContainer/ToolMenu/Tools"] +margin_top = 188.0 +margin_right = 120.0 +margin_bottom = 208.0 +size_flags_horizontal = 3 +size_flags_vertical = 3 +text = "Color Picker" +__meta__ = { +"_edit_use_anchors_": false +} + +[node name="CutTool" type="Button" parent="Panel/NoBCViewportsnotworking26181/HBoxContainer/Panel/ScrollContainer/ToolMenu/Tools"] +margin_top = 212.0 +margin_right = 120.0 +margin_bottom = 232.0 +size_flags_horizontal = 3 +size_flags_vertical = 3 +text = "Cut Section" +__meta__ = { +"_edit_use_anchors_": false +} + +[node name="ColorPicker" type="ColorPickerButton" parent="Panel/NoBCViewportsnotworking26181/HBoxContainer/Panel/ScrollContainer/ToolMenu/Tools"] +margin_top = 236.0 +margin_right = 120.0 +margin_bottom = 256.0 +size_flags_horizontal = 3 +size_flags_vertical = 3 +__meta__ = { +"_edit_use_anchors_": false +} + +[node name="Colors" type="GridContainer" parent="Panel/NoBCViewportsnotworking26181/HBoxContainer/Panel/ScrollContainer/ToolMenu"] +margin_top = 260.0 +margin_right = 120.0 +margin_bottom = 430.0 +size_flags_horizontal = 3 +size_flags_vertical = 3 +columns = 4 +script = ExtResource( 8 ) + +[node name="Button1" type="Button" parent="Panel/NoBCViewportsnotworking26181/HBoxContainer/Panel/ScrollContainer/ToolMenu/Colors"] +margin_right = 27.0 +margin_bottom = 25.0 +rect_min_size = Vector2( 25, 25 ) +size_flags_horizontal = 3 +size_flags_vertical = 3 +custom_styles/normal = SubResource( 29 ) + +[node name="Button2" type="Button" parent="Panel/NoBCViewportsnotworking26181/HBoxContainer/Panel/ScrollContainer/ToolMenu/Colors"] +margin_left = 31.0 +margin_right = 58.0 +margin_bottom = 25.0 +rect_min_size = Vector2( 25, 25 ) +size_flags_horizontal = 3 +size_flags_vertical = 3 +custom_styles/normal = SubResource( 30 ) + +[node name="Button3" type="Button" parent="Panel/NoBCViewportsnotworking26181/HBoxContainer/Panel/ScrollContainer/ToolMenu/Colors"] +margin_left = 62.0 +margin_right = 89.0 +margin_bottom = 25.0 +rect_min_size = Vector2( 25, 25 ) +size_flags_horizontal = 3 +size_flags_vertical = 3 +custom_styles/normal = SubResource( 31 ) + +[node name="Button4" type="Button" parent="Panel/NoBCViewportsnotworking26181/HBoxContainer/Panel/ScrollContainer/ToolMenu/Colors"] +margin_left = 93.0 +margin_right = 120.0 +margin_bottom = 25.0 +rect_min_size = Vector2( 25, 25 ) +size_flags_horizontal = 3 +size_flags_vertical = 3 +custom_styles/normal = SubResource( 32 ) + +[node name="Button5" type="Button" parent="Panel/NoBCViewportsnotworking26181/HBoxContainer/Panel/ScrollContainer/ToolMenu/Colors"] +margin_top = 29.0 +margin_right = 27.0 +margin_bottom = 54.0 +rect_min_size = Vector2( 25, 25 ) +size_flags_horizontal = 3 +size_flags_vertical = 3 +custom_styles/normal = SubResource( 33 ) + +[node name="Button6" type="Button" parent="Panel/NoBCViewportsnotworking26181/HBoxContainer/Panel/ScrollContainer/ToolMenu/Colors"] +margin_left = 31.0 +margin_top = 29.0 +margin_right = 58.0 +margin_bottom = 54.0 +rect_min_size = Vector2( 25, 25 ) +size_flags_horizontal = 3 +size_flags_vertical = 3 +custom_styles/normal = SubResource( 34 ) + +[node name="Button7" type="Button" parent="Panel/NoBCViewportsnotworking26181/HBoxContainer/Panel/ScrollContainer/ToolMenu/Colors"] +margin_left = 62.0 +margin_top = 29.0 +margin_right = 89.0 +margin_bottom = 54.0 +rect_min_size = Vector2( 25, 25 ) +size_flags_horizontal = 3 +size_flags_vertical = 3 +custom_styles/normal = SubResource( 35 ) + +[node name="Button8" type="Button" parent="Panel/NoBCViewportsnotworking26181/HBoxContainer/Panel/ScrollContainer/ToolMenu/Colors"] +margin_left = 93.0 +margin_top = 29.0 +margin_right = 120.0 +margin_bottom = 54.0 +rect_min_size = Vector2( 25, 25 ) +size_flags_horizontal = 3 +size_flags_vertical = 3 +custom_styles/normal = SubResource( 36 ) + +[node name="Button9" type="Button" parent="Panel/NoBCViewportsnotworking26181/HBoxContainer/Panel/ScrollContainer/ToolMenu/Colors"] +margin_top = 58.0 +margin_right = 27.0 +margin_bottom = 83.0 +rect_min_size = Vector2( 25, 25 ) +size_flags_horizontal = 3 +size_flags_vertical = 3 +custom_styles/normal = SubResource( 37 ) + +[node name="Button10" type="Button" parent="Panel/NoBCViewportsnotworking26181/HBoxContainer/Panel/ScrollContainer/ToolMenu/Colors"] +margin_left = 31.0 +margin_top = 58.0 +margin_right = 58.0 +margin_bottom = 83.0 +rect_min_size = Vector2( 25, 25 ) +size_flags_horizontal = 3 +size_flags_vertical = 3 +custom_styles/normal = SubResource( 38 ) + +[node name="Button11" type="Button" parent="Panel/NoBCViewportsnotworking26181/HBoxContainer/Panel/ScrollContainer/ToolMenu/Colors"] +margin_left = 62.0 +margin_top = 58.0 +margin_right = 89.0 +margin_bottom = 83.0 +rect_min_size = Vector2( 25, 25 ) +size_flags_horizontal = 3 +size_flags_vertical = 3 +custom_styles/normal = SubResource( 39 ) + +[node name="Button12" type="Button" parent="Panel/NoBCViewportsnotworking26181/HBoxContainer/Panel/ScrollContainer/ToolMenu/Colors"] +margin_left = 93.0 +margin_top = 58.0 +margin_right = 120.0 +margin_bottom = 83.0 +rect_min_size = Vector2( 25, 25 ) +size_flags_horizontal = 3 +size_flags_vertical = 3 +custom_styles/normal = SubResource( 40 ) + +[node name="Button13" type="Button" parent="Panel/NoBCViewportsnotworking26181/HBoxContainer/Panel/ScrollContainer/ToolMenu/Colors"] +margin_top = 87.0 +margin_right = 27.0 +margin_bottom = 112.0 +rect_min_size = Vector2( 25, 25 ) +size_flags_horizontal = 3 +size_flags_vertical = 3 +custom_styles/normal = SubResource( 41 ) + +[node name="Button14" type="Button" parent="Panel/NoBCViewportsnotworking26181/HBoxContainer/Panel/ScrollContainer/ToolMenu/Colors"] +margin_left = 31.0 +margin_top = 87.0 +margin_right = 58.0 +margin_bottom = 112.0 +rect_min_size = Vector2( 25, 25 ) +size_flags_horizontal = 3 +size_flags_vertical = 3 +custom_styles/normal = SubResource( 42 ) + +[node name="Button15" type="Button" parent="Panel/NoBCViewportsnotworking26181/HBoxContainer/Panel/ScrollContainer/ToolMenu/Colors"] +margin_left = 62.0 +margin_top = 87.0 +margin_right = 89.0 +margin_bottom = 112.0 +rect_min_size = Vector2( 25, 25 ) +size_flags_horizontal = 3 +size_flags_vertical = 3 +custom_styles/normal = SubResource( 43 ) + +[node name="Button16" type="Button" parent="Panel/NoBCViewportsnotworking26181/HBoxContainer/Panel/ScrollContainer/ToolMenu/Colors"] +margin_left = 93.0 +margin_top = 87.0 +margin_right = 120.0 +margin_bottom = 112.0 +rect_min_size = Vector2( 25, 25 ) +size_flags_horizontal = 3 +size_flags_vertical = 3 +custom_styles/normal = SubResource( 44 ) + +[node name="Button17" type="Button" parent="Panel/NoBCViewportsnotworking26181/HBoxContainer/Panel/ScrollContainer/ToolMenu/Colors"] +margin_top = 116.0 +margin_right = 27.0 +margin_bottom = 141.0 +rect_min_size = Vector2( 25, 25 ) +size_flags_horizontal = 3 +size_flags_vertical = 3 +custom_styles/normal = SubResource( 45 ) + +[node name="Button18" type="Button" parent="Panel/NoBCViewportsnotworking26181/HBoxContainer/Panel/ScrollContainer/ToolMenu/Colors"] +margin_left = 31.0 +margin_top = 116.0 +margin_right = 58.0 +margin_bottom = 141.0 +rect_min_size = Vector2( 25, 25 ) +size_flags_horizontal = 3 +size_flags_vertical = 3 +custom_styles/normal = SubResource( 46 ) + +[node name="Button19" type="Button" parent="Panel/NoBCViewportsnotworking26181/HBoxContainer/Panel/ScrollContainer/ToolMenu/Colors"] +margin_left = 62.0 +margin_top = 116.0 +margin_right = 89.0 +margin_bottom = 141.0 +rect_min_size = Vector2( 25, 25 ) +size_flags_horizontal = 3 +size_flags_vertical = 3 +custom_styles/normal = SubResource( 47 ) + +[node name="Button20" type="Button" parent="Panel/NoBCViewportsnotworking26181/HBoxContainer/Panel/ScrollContainer/ToolMenu/Colors"] +margin_left = 93.0 +margin_top = 116.0 +margin_right = 120.0 +margin_bottom = 141.0 +rect_min_size = Vector2( 25, 25 ) +size_flags_horizontal = 3 +size_flags_vertical = 3 +custom_styles/normal = SubResource( 48 ) + +[node name="Button21" type="Button" parent="Panel/NoBCViewportsnotworking26181/HBoxContainer/Panel/ScrollContainer/ToolMenu/Colors"] +margin_top = 145.0 +margin_right = 27.0 +margin_bottom = 170.0 +rect_min_size = Vector2( 25, 25 ) +size_flags_horizontal = 3 +size_flags_vertical = 3 +custom_styles/normal = SubResource( 49 ) + +[node name="Button22" type="Button" parent="Panel/NoBCViewportsnotworking26181/HBoxContainer/Panel/ScrollContainer/ToolMenu/Colors"] +margin_left = 31.0 +margin_top = 145.0 +margin_right = 58.0 +margin_bottom = 170.0 +rect_min_size = Vector2( 25, 25 ) +size_flags_horizontal = 3 +size_flags_vertical = 3 +custom_styles/normal = SubResource( 50 ) + +[node name="Button23" type="Button" parent="Panel/NoBCViewportsnotworking26181/HBoxContainer/Panel/ScrollContainer/ToolMenu/Colors"] +margin_left = 62.0 +margin_top = 145.0 +margin_right = 89.0 +margin_bottom = 170.0 +rect_min_size = Vector2( 25, 25 ) +size_flags_horizontal = 3 +size_flags_vertical = 3 +custom_styles/normal = SubResource( 51 ) + +[node name="Button24" type="Button" parent="Panel/NoBCViewportsnotworking26181/HBoxContainer/Panel/ScrollContainer/ToolMenu/Colors"] +margin_left = 93.0 +margin_top = 145.0 +margin_right = 120.0 +margin_bottom = 170.0 +rect_min_size = Vector2( 25, 25 ) +size_flags_horizontal = 3 +size_flags_vertical = 3 +custom_styles/normal = SubResource( 52 ) + +[node name="Control" type="ScrollContainer" parent="Panel/NoBCViewportsnotworking26181/HBoxContainer/Panel/ScrollContainer/ToolMenu"] +margin_top = 434.0 +margin_right = 120.0 +margin_bottom = 543.0 +size_flags_vertical = 3 + +[node name="VBoxContainer" type="VBoxContainer" parent="Panel/NoBCViewportsnotworking26181/HBoxContainer/Panel/ScrollContainer/ToolMenu/Control"] +margin_right = 120.0 +margin_bottom = 109.0 +size_flags_horizontal = 3 +size_flags_vertical = 3 + +[node name="LayerButtons" type="VBoxContainer" parent="Panel/NoBCViewportsnotworking26181/HBoxContainer/Panel/ScrollContainer/ToolMenu/Control/VBoxContainer"] +margin_right = 120.0 +margin_bottom = 80.0 +size_flags_horizontal = 3 +size_flags_vertical = 3 +__meta__ = { +"_edit_use_anchors_": false +} + +[node name="Layer1" parent="Panel/NoBCViewportsnotworking26181/HBoxContainer/Panel/ScrollContainer/ToolMenu/Control/VBoxContainer/LayerButtons" instance=ExtResource( 12 )] +margin_right = 120.0 +margin_bottom = 32.0 + +[node name="Button" type="Button" parent="Panel/NoBCViewportsnotworking26181/HBoxContainer/Panel/ScrollContainer/ToolMenu/Control/VBoxContainer"] +margin_top = 84.0 +margin_right = 120.0 +margin_bottom = 109.0 +rect_min_size = Vector2( 0, 25 ) +size_flags_horizontal = 3 +text = "+" +__meta__ = { +"_edit_use_anchors_": false +} + +[node name="Navbar" type="Control" parent="Panel/NoBCViewportsnotworking26181"] +anchor_right = 1.0 +anchor_bottom = 0.0833333 +size_flags_horizontal = 3 +size_flags_vertical = 3 +script = ExtResource( 6 ) +__meta__ = { +"_edit_use_anchors_": true +} + +[node name="Panel" type="Panel" parent="Panel/NoBCViewportsnotworking26181/Navbar"] +self_modulate = Color( 0.854902, 0.854902, 0.854902, 1 ) anchor_right = 1.0 anchor_bottom = 1.0 __meta__ = { "_edit_use_anchors_": false } -[node name="Buttons" type="HBoxContainer" parent="Panel/VBoxContainer/Navbar"] +[node name="Buttons" type="HBoxContainer" parent="Panel/NoBCViewportsnotworking26181/Navbar"] anchor_left = 0.0078125 anchor_top = 0.12 anchor_right = 0.628906 @@ -156,21 +694,21 @@ __meta__ = { "_edit_use_anchors_": true } -[node name="File" type="MenuButton" parent="Panel/VBoxContainer/Navbar/Buttons"] +[node name="File" type="MenuButton" parent="Panel/NoBCViewportsnotworking26181/Navbar/Buttons"] margin_right = 73.0 -margin_bottom = 25.0 +margin_bottom = 24.0 size_flags_horizontal = 3 size_flags_vertical = 3 text = "File" flat = false -items = [ "Save", null, 0, false, false, 0, 0, null, "", false, "Load", null, 0, false, false, 1, 0, null, "", false ] +items = [ "New", null, 0, false, false, 0, 0, null, "", false, "Save", null, 0, false, false, 1, 0, null, "", false, "Load", null, 0, false, false, 2, 0, null, "", false ] switch_on_hover = true script = ExtResource( 7 ) -[node name="Edit" type="MenuButton" parent="Panel/VBoxContainer/Navbar/Buttons"] +[node name="Edit" type="MenuButton" parent="Panel/NoBCViewportsnotworking26181/Navbar/Buttons"] margin_left = 93.0 margin_right = 167.0 -margin_bottom = 25.0 +margin_bottom = 24.0 size_flags_horizontal = 3 size_flags_vertical = 3 text = "Edit" @@ -179,10 +717,10 @@ items = [ "Undo", null, 0, false, false, 0, 0, null, "", false, "Redo", null, 0, switch_on_hover = true script = ExtResource( 7 ) -[node name="Canvas" type="MenuButton" parent="Panel/VBoxContainer/Navbar/Buttons"] +[node name="Canvas" type="MenuButton" parent="Panel/NoBCViewportsnotworking26181/Navbar/Buttons"] margin_left = 187.0 margin_right = 260.0 -margin_bottom = 25.0 +margin_bottom = 24.0 size_flags_horizontal = 3 size_flags_vertical = 3 text = "Canvas" @@ -191,10 +729,10 @@ items = [ "Clear Canvas", null, 0, false, false, 0, 0, null, "", false, "Change switch_on_hover = true script = ExtResource( 7 ) -[node name="Layer" type="MenuButton" parent="Panel/VBoxContainer/Navbar/Buttons"] +[node name="Layer" type="MenuButton" parent="Panel/NoBCViewportsnotworking26181/Navbar/Buttons"] margin_left = 280.0 margin_right = 354.0 -margin_bottom = 25.0 +margin_bottom = 24.0 size_flags_horizontal = 3 size_flags_vertical = 3 text = "Layer" @@ -203,10 +741,10 @@ items = [ "Add Layer", null, 0, false, false, 0, 0, null, "", false, "Delete Lay switch_on_hover = true script = ExtResource( 7 ) -[node name="Grid" type="MenuButton" parent="Panel/VBoxContainer/Navbar/Buttons"] +[node name="Grid" type="MenuButton" parent="Panel/NoBCViewportsnotworking26181/Navbar/Buttons"] margin_left = 374.0 margin_right = 447.0 -margin_bottom = 25.0 +margin_bottom = 24.0 size_flags_horizontal = 3 size_flags_vertical = 3 text = "Grid" @@ -215,10 +753,10 @@ items = [ "Toggle Grid", null, 0, false, false, 0, 0, null, "", false, "Change G switch_on_hover = true script = ExtResource( 7 ) -[node name="Magic" type="MenuButton" parent="Panel/VBoxContainer/Navbar/Buttons"] +[node name="Magic" type="MenuButton" parent="Panel/NoBCViewportsnotworking26181/Navbar/Buttons"] margin_left = 467.0 margin_right = 541.0 -margin_bottom = 25.0 +margin_bottom = 24.0 size_flags_horizontal = 3 size_flags_vertical = 3 text = "Magic" @@ -227,10 +765,10 @@ items = [ "ChangeSingleColor", null, 0, false, false, 0, 0, null, "", false, "Ch switch_on_hover = true script = ExtResource( 7 ) -[node name="Editor" type="MenuButton" parent="Panel/VBoxContainer/Navbar/Buttons"] +[node name="Editor" type="MenuButton" parent="Panel/NoBCViewportsnotworking26181/Navbar/Buttons"] margin_left = 561.0 margin_right = 635.0 -margin_bottom = 25.0 +margin_bottom = 24.0 size_flags_horizontal = 3 size_flags_vertical = 3 text = "Editor" @@ -242,507 +780,21 @@ __meta__ = { "_edit_use_anchors_": false } -[node name="HBoxContainer" type="HBoxContainer" parent="Panel/VBoxContainer"] -margin_top = 54.0 -margin_right = 1024.0 -margin_bottom = 555.0 -size_flags_horizontal = 3 -size_flags_vertical = 3 -size_flags_stretch_ratio = 10.0 - -[node name="PaintCanvasContainer" type="Control" parent="Panel/VBoxContainer/HBoxContainer"] -show_behind_parent = true -margin_right = 906.0 -margin_bottom = 501.0 -focus_mode = 1 -mouse_filter = 1 -size_flags_horizontal = 3 -size_flags_vertical = 3 -size_flags_stretch_ratio = 8.0 -__meta__ = { -"_edit_use_anchors_": false -} - -[node name="Canvas" type="Control" parent="Panel/VBoxContainer/HBoxContainer/PaintCanvasContainer"] -anchor_left = 0.5 -anchor_top = 0.5 -anchor_right = 0.5 -anchor_bottom = 0.5 -margin_left = -384.0 -margin_top = -192.0 -margin_right = 384.0 -margin_bottom = 192.0 -script = ExtResource( 3 ) -__meta__ = { -"_edit_group_": true, -"_edit_use_anchors_": false -} -canvas_height = 24 -grid_size = 1 -big_grid_size = 8 - -[node name="Grid" parent="Panel/VBoxContainer/HBoxContainer/PaintCanvasContainer/Canvas" instance=ExtResource( 4 )] -mouse_filter = 2 -color = Color( 1, 1, 1, 0.266667 ) - -[node name="BigGrid" parent="Panel/VBoxContainer/HBoxContainer/PaintCanvasContainer/Canvas" instance=ExtResource( 4 )] -mouse_filter = 2 -color = Color( 1, 1, 1, 1 ) -size = 128 - -[node name="CanvasLayers" type="Control" parent="Panel/VBoxContainer/HBoxContainer/PaintCanvasContainer/Canvas"] -anchor_right = 1.0 -anchor_bottom = 1.0 -mouse_filter = 2 -__meta__ = { -"_edit_lock_": true, -"_edit_use_anchors_": false -} - -[node name="CanvasOutline" type="Control" parent="Panel/VBoxContainer/HBoxContainer/PaintCanvasContainer/Canvas"] -anchor_right = 1.0 -anchor_bottom = 1.0 -mouse_filter = 2 -script = ExtResource( 5 ) -__meta__ = { -"_edit_lock_": true, -"_edit_use_anchors_": false -} -color = Color( 0, 1, 0, 1 ) - -[node name="Image" type="TextureRect" parent="Panel/VBoxContainer/HBoxContainer/PaintCanvasContainer/Canvas"] -visible = false -anchor_right = 1.0 -anchor_bottom = 1.0 -texture = ExtResource( 13 ) -expand = true -__meta__ = { -"_edit_lock_": true -} - -[node name="ScrollContainer" type="ScrollContainer" parent="Panel/VBoxContainer/HBoxContainer"] -margin_left = 910.0 -margin_right = 1024.0 -margin_bottom = 501.0 -size_flags_horizontal = 3 -size_flags_vertical = 3 - -[node name="ToolMenu" type="VBoxContainer" parent="Panel/VBoxContainer/HBoxContainer/ScrollContainer"] -margin_right = 114.0 -margin_bottom = 501.0 -size_flags_horizontal = 3 -size_flags_vertical = 3 - -[node name="Tools" type="VBoxContainer" parent="Panel/VBoxContainer/HBoxContainer/ScrollContainer/ToolMenu"] -margin_right = 114.0 -margin_bottom = 256.0 -size_flags_horizontal = 3 -size_flags_vertical = 3 - -[node name="PaintTool" type="Button" parent="Panel/VBoxContainer/HBoxContainer/ScrollContainer/ToolMenu/Tools"] -margin_right = 114.0 -margin_bottom = 20.0 -size_flags_horizontal = 3 -size_flags_vertical = 3 -text = "Paint" - -[node name="BrushTool" type="Button" parent="Panel/VBoxContainer/HBoxContainer/ScrollContainer/ToolMenu/Tools"] -margin_top = 24.0 -margin_right = 114.0 -margin_bottom = 40.0 -size_flags_horizontal = 3 -size_flags_vertical = 3 -custom_styles/hover = SubResource( 1 ) -custom_styles/pressed = SubResource( 1 ) -custom_styles/focus = SubResource( 1 ) -custom_styles/disabled = SubResource( 1 ) -custom_styles/normal = SubResource( 1 ) -text = "Brush" - -[node name="BucketTool" type="Button" parent="Panel/VBoxContainer/HBoxContainer/ScrollContainer/ToolMenu/Tools"] -margin_top = 44.0 -margin_right = 114.0 -margin_bottom = 64.0 -size_flags_horizontal = 3 -size_flags_vertical = 3 -text = "Bucket Fill" -__meta__ = { -"_edit_use_anchors_": false -} - -[node name="RainbowTool" type="Button" parent="Panel/VBoxContainer/HBoxContainer/ScrollContainer/ToolMenu/Tools"] -margin_top = 68.0 -margin_right = 114.0 -margin_bottom = 88.0 -size_flags_horizontal = 3 -size_flags_vertical = 3 -text = "Rainbow" -__meta__ = { -"_edit_use_anchors_": false -} - -[node name="LineTool" type="Button" parent="Panel/VBoxContainer/HBoxContainer/ScrollContainer/ToolMenu/Tools"] -margin_top = 92.0 -margin_right = 114.0 -margin_bottom = 112.0 -size_flags_horizontal = 3 -size_flags_vertical = 3 -text = "Line" -__meta__ = { -"_edit_use_anchors_": false -} - -[node name="RectTool" type="Button" parent="Panel/VBoxContainer/HBoxContainer/ScrollContainer/ToolMenu/Tools"] -margin_top = 116.0 -margin_right = 114.0 -margin_bottom = 136.0 -size_flags_horizontal = 3 -size_flags_vertical = 3 -text = "Rectangle" -__meta__ = { -"_edit_use_anchors_": false -} - -[node name="DarkenTool" type="Button" parent="Panel/VBoxContainer/HBoxContainer/ScrollContainer/ToolMenu/Tools"] -margin_top = 140.0 -margin_right = 114.0 -margin_bottom = 160.0 -size_flags_horizontal = 3 -size_flags_vertical = 3 -text = "Darken" -__meta__ = { -"_edit_use_anchors_": false -} - -[node name="BrightenTool" type="Button" parent="Panel/VBoxContainer/HBoxContainer/ScrollContainer/ToolMenu/Tools"] -margin_top = 164.0 -margin_right = 114.0 -margin_bottom = 184.0 -size_flags_horizontal = 3 -size_flags_vertical = 3 -text = "Brighten" -__meta__ = { -"_edit_use_anchors_": false -} - -[node name="ColorPickerTool" type="Button" parent="Panel/VBoxContainer/HBoxContainer/ScrollContainer/ToolMenu/Tools"] -margin_top = 188.0 -margin_right = 114.0 -margin_bottom = 208.0 -size_flags_horizontal = 3 -size_flags_vertical = 3 -text = "Color Picker" -__meta__ = { -"_edit_use_anchors_": false -} - -[node name="CutTool" type="Button" parent="Panel/VBoxContainer/HBoxContainer/ScrollContainer/ToolMenu/Tools"] -margin_top = 212.0 -margin_right = 114.0 -margin_bottom = 232.0 -size_flags_horizontal = 3 -size_flags_vertical = 3 -text = "Cut Section" -__meta__ = { -"_edit_use_anchors_": false -} - -[node name="ColorPicker" type="ColorPickerButton" parent="Panel/VBoxContainer/HBoxContainer/ScrollContainer/ToolMenu/Tools"] -margin_top = 236.0 -margin_right = 114.0 -margin_bottom = 256.0 -size_flags_horizontal = 3 -size_flags_vertical = 3 -__meta__ = { -"_edit_use_anchors_": false -} - -[node name="Colors" type="GridContainer" parent="Panel/VBoxContainer/HBoxContainer/ScrollContainer/ToolMenu"] -margin_top = 260.0 -margin_right = 114.0 -margin_bottom = 430.0 -size_flags_horizontal = 3 -size_flags_vertical = 3 -columns = 4 -script = ExtResource( 8 ) - -[node name="Button1" type="Button" parent="Panel/VBoxContainer/HBoxContainer/ScrollContainer/ToolMenu/Colors"] -margin_right = 25.0 -margin_bottom = 25.0 -rect_min_size = Vector2( 25, 25 ) -size_flags_horizontal = 3 -size_flags_vertical = 3 -custom_styles/normal = SubResource( 27 ) - -[node name="Button2" type="Button" parent="Panel/VBoxContainer/HBoxContainer/ScrollContainer/ToolMenu/Colors"] -margin_left = 29.0 -margin_right = 54.0 -margin_bottom = 25.0 -rect_min_size = Vector2( 25, 25 ) -size_flags_horizontal = 3 -size_flags_vertical = 3 -custom_styles/normal = SubResource( 28 ) - -[node name="Button3" type="Button" parent="Panel/VBoxContainer/HBoxContainer/ScrollContainer/ToolMenu/Colors"] -margin_left = 58.0 -margin_right = 83.0 -margin_bottom = 25.0 -rect_min_size = Vector2( 25, 25 ) -size_flags_horizontal = 3 -size_flags_vertical = 3 -custom_styles/normal = SubResource( 29 ) - -[node name="Button4" type="Button" parent="Panel/VBoxContainer/HBoxContainer/ScrollContainer/ToolMenu/Colors"] -margin_left = 87.0 -margin_right = 112.0 -margin_bottom = 25.0 -rect_min_size = Vector2( 25, 25 ) -size_flags_horizontal = 3 -size_flags_vertical = 3 -custom_styles/normal = SubResource( 30 ) - -[node name="Button5" type="Button" parent="Panel/VBoxContainer/HBoxContainer/ScrollContainer/ToolMenu/Colors"] -margin_top = 29.0 -margin_right = 25.0 -margin_bottom = 54.0 -rect_min_size = Vector2( 25, 25 ) -size_flags_horizontal = 3 -size_flags_vertical = 3 -custom_styles/normal = SubResource( 31 ) - -[node name="Button6" type="Button" parent="Panel/VBoxContainer/HBoxContainer/ScrollContainer/ToolMenu/Colors"] -margin_left = 29.0 -margin_top = 29.0 -margin_right = 54.0 -margin_bottom = 54.0 -rect_min_size = Vector2( 25, 25 ) -size_flags_horizontal = 3 -size_flags_vertical = 3 -custom_styles/normal = SubResource( 32 ) - -[node name="Button7" type="Button" parent="Panel/VBoxContainer/HBoxContainer/ScrollContainer/ToolMenu/Colors"] -margin_left = 58.0 -margin_top = 29.0 -margin_right = 83.0 -margin_bottom = 54.0 -rect_min_size = Vector2( 25, 25 ) -size_flags_horizontal = 3 -size_flags_vertical = 3 -custom_styles/normal = SubResource( 33 ) - -[node name="Button8" type="Button" parent="Panel/VBoxContainer/HBoxContainer/ScrollContainer/ToolMenu/Colors"] -margin_left = 87.0 -margin_top = 29.0 -margin_right = 112.0 -margin_bottom = 54.0 -rect_min_size = Vector2( 25, 25 ) -size_flags_horizontal = 3 -size_flags_vertical = 3 -custom_styles/normal = SubResource( 34 ) - -[node name="Button9" type="Button" parent="Panel/VBoxContainer/HBoxContainer/ScrollContainer/ToolMenu/Colors"] -margin_top = 58.0 -margin_right = 25.0 -margin_bottom = 83.0 -rect_min_size = Vector2( 25, 25 ) -size_flags_horizontal = 3 -size_flags_vertical = 3 -custom_styles/normal = SubResource( 35 ) - -[node name="Button10" type="Button" parent="Panel/VBoxContainer/HBoxContainer/ScrollContainer/ToolMenu/Colors"] -margin_left = 29.0 -margin_top = 58.0 -margin_right = 54.0 -margin_bottom = 83.0 -rect_min_size = Vector2( 25, 25 ) -size_flags_horizontal = 3 -size_flags_vertical = 3 -custom_styles/normal = SubResource( 36 ) - -[node name="Button11" type="Button" parent="Panel/VBoxContainer/HBoxContainer/ScrollContainer/ToolMenu/Colors"] -margin_left = 58.0 -margin_top = 58.0 -margin_right = 83.0 -margin_bottom = 83.0 -rect_min_size = Vector2( 25, 25 ) -size_flags_horizontal = 3 -size_flags_vertical = 3 -custom_styles/normal = SubResource( 37 ) - -[node name="Button12" type="Button" parent="Panel/VBoxContainer/HBoxContainer/ScrollContainer/ToolMenu/Colors"] -margin_left = 87.0 -margin_top = 58.0 -margin_right = 112.0 -margin_bottom = 83.0 -rect_min_size = Vector2( 25, 25 ) -size_flags_horizontal = 3 -size_flags_vertical = 3 -custom_styles/normal = SubResource( 38 ) - -[node name="Button13" type="Button" parent="Panel/VBoxContainer/HBoxContainer/ScrollContainer/ToolMenu/Colors"] -margin_top = 87.0 -margin_right = 25.0 -margin_bottom = 112.0 -rect_min_size = Vector2( 25, 25 ) -size_flags_horizontal = 3 -size_flags_vertical = 3 -custom_styles/normal = SubResource( 39 ) - -[node name="Button14" type="Button" parent="Panel/VBoxContainer/HBoxContainer/ScrollContainer/ToolMenu/Colors"] -margin_left = 29.0 -margin_top = 87.0 -margin_right = 54.0 -margin_bottom = 112.0 -rect_min_size = Vector2( 25, 25 ) -size_flags_horizontal = 3 -size_flags_vertical = 3 -custom_styles/normal = SubResource( 40 ) - -[node name="Button15" type="Button" parent="Panel/VBoxContainer/HBoxContainer/ScrollContainer/ToolMenu/Colors"] -margin_left = 58.0 -margin_top = 87.0 -margin_right = 83.0 -margin_bottom = 112.0 -rect_min_size = Vector2( 25, 25 ) -size_flags_horizontal = 3 -size_flags_vertical = 3 -custom_styles/normal = SubResource( 41 ) - -[node name="Button16" type="Button" parent="Panel/VBoxContainer/HBoxContainer/ScrollContainer/ToolMenu/Colors"] -margin_left = 87.0 -margin_top = 87.0 -margin_right = 112.0 -margin_bottom = 112.0 -rect_min_size = Vector2( 25, 25 ) -size_flags_horizontal = 3 -size_flags_vertical = 3 -custom_styles/normal = SubResource( 42 ) - -[node name="Button17" type="Button" parent="Panel/VBoxContainer/HBoxContainer/ScrollContainer/ToolMenu/Colors"] -margin_top = 116.0 -margin_right = 25.0 -margin_bottom = 141.0 -rect_min_size = Vector2( 25, 25 ) -size_flags_horizontal = 3 -size_flags_vertical = 3 -custom_styles/normal = SubResource( 43 ) - -[node name="Button18" type="Button" parent="Panel/VBoxContainer/HBoxContainer/ScrollContainer/ToolMenu/Colors"] -margin_left = 29.0 -margin_top = 116.0 -margin_right = 54.0 -margin_bottom = 141.0 -rect_min_size = Vector2( 25, 25 ) -size_flags_horizontal = 3 -size_flags_vertical = 3 -custom_styles/normal = SubResource( 44 ) - -[node name="Button19" type="Button" parent="Panel/VBoxContainer/HBoxContainer/ScrollContainer/ToolMenu/Colors"] -margin_left = 58.0 -margin_top = 116.0 -margin_right = 83.0 -margin_bottom = 141.0 -rect_min_size = Vector2( 25, 25 ) -size_flags_horizontal = 3 -size_flags_vertical = 3 -custom_styles/normal = SubResource( 45 ) - -[node name="Button20" type="Button" parent="Panel/VBoxContainer/HBoxContainer/ScrollContainer/ToolMenu/Colors"] -margin_left = 87.0 -margin_top = 116.0 -margin_right = 112.0 -margin_bottom = 141.0 -rect_min_size = Vector2( 25, 25 ) -size_flags_horizontal = 3 -size_flags_vertical = 3 -custom_styles/normal = SubResource( 46 ) - -[node name="Button21" type="Button" parent="Panel/VBoxContainer/HBoxContainer/ScrollContainer/ToolMenu/Colors"] -margin_top = 145.0 -margin_right = 25.0 -margin_bottom = 170.0 -rect_min_size = Vector2( 25, 25 ) -size_flags_horizontal = 3 -size_flags_vertical = 3 -custom_styles/normal = SubResource( 47 ) - -[node name="Button22" type="Button" parent="Panel/VBoxContainer/HBoxContainer/ScrollContainer/ToolMenu/Colors"] -margin_left = 29.0 -margin_top = 145.0 -margin_right = 54.0 -margin_bottom = 170.0 -rect_min_size = Vector2( 25, 25 ) -size_flags_horizontal = 3 -size_flags_vertical = 3 -custom_styles/normal = SubResource( 48 ) - -[node name="Button23" type="Button" parent="Panel/VBoxContainer/HBoxContainer/ScrollContainer/ToolMenu/Colors"] -margin_left = 58.0 -margin_top = 145.0 -margin_right = 83.0 -margin_bottom = 170.0 -rect_min_size = Vector2( 25, 25 ) -size_flags_horizontal = 3 -size_flags_vertical = 3 -custom_styles/normal = SubResource( 49 ) - -[node name="Button24" type="Button" parent="Panel/VBoxContainer/HBoxContainer/ScrollContainer/ToolMenu/Colors"] -margin_left = 87.0 -margin_top = 145.0 -margin_right = 112.0 -margin_bottom = 170.0 -rect_min_size = Vector2( 25, 25 ) -size_flags_horizontal = 3 -size_flags_vertical = 3 -custom_styles/normal = SubResource( 50 ) - -[node name="Control" type="ScrollContainer" parent="Panel/VBoxContainer/HBoxContainer/ScrollContainer/ToolMenu"] -margin_top = 434.0 -margin_right = 114.0 -margin_bottom = 501.0 -size_flags_vertical = 3 - -[node name="VBoxContainer" type="VBoxContainer" parent="Panel/VBoxContainer/HBoxContainer/ScrollContainer/ToolMenu/Control"] -margin_right = 114.0 -margin_bottom = 67.0 -size_flags_horizontal = 3 -size_flags_vertical = 3 - -[node name="LayerButtons" type="VBoxContainer" parent="Panel/VBoxContainer/HBoxContainer/ScrollContainer/ToolMenu/Control/VBoxContainer"] -margin_right = 114.0 -margin_bottom = 38.0 -size_flags_horizontal = 3 -size_flags_vertical = 3 -__meta__ = { -"_edit_use_anchors_": false -} - -[node name="Layer1" parent="Panel/VBoxContainer/HBoxContainer/ScrollContainer/ToolMenu/Control/VBoxContainer/LayerButtons" instance=ExtResource( 12 )] -margin_bottom = 32.0 - -[node name="Button" type="Button" parent="Panel/VBoxContainer/HBoxContainer/ScrollContainer/ToolMenu/Control/VBoxContainer"] -margin_top = 42.0 -margin_right = 114.0 -margin_bottom = 67.0 -rect_min_size = Vector2( 0, 25 ) -size_flags_horizontal = 3 -text = "+" -__meta__ = { -"_edit_use_anchors_": false -} - -[node name="BottomPanel" type="Panel" parent="Panel/VBoxContainer"] -margin_top = 559.0 -margin_right = 1024.0 -margin_bottom = 599.0 +[node name="BottomPanel" type="Panel" parent="Panel/NoBCViewportsnotworking26181"] +anchor_top = 0.931667 +anchor_right = 0.875 +anchor_bottom = 0.998333 rect_min_size = Vector2( 0, 40 ) size_flags_horizontal = 3 -custom_styles/panel = SubResource( 26 ) +custom_styles/panel = SubResource( 27 ) +__meta__ = { +"_edit_use_anchors_": true +} -[node name="DebugTextDisplay" type="RichTextLabel" parent="Panel/VBoxContainer/BottomPanel"] +[node name="DebugTextDisplay" type="RichTextLabel" parent="Panel/NoBCViewportsnotworking26181/BottomPanel"] anchor_right = 1.0 anchor_bottom = 1.0 -text = "FPS 60 Mouse Position (0, 0) Canvas Mouse Position (0, 0) Canvas Position (0, 0) +text = "FPS 59 Mouse Position (0, 0) Canvas Mouse Position (0, 0) Canvas Position (0, 0) Cell Position (0, 0) Cell Color 0,0,0,0 " scroll_active = false script = ExtResource( 11 ) @@ -763,7 +815,23 @@ mouse_filter = 1 filters = PoolStringArray( "*.png ; PNG Images" ) script = ExtResource( 9 ) +[node name="LoadFileDialog" type="FileDialog" parent="."] +anchor_left = 0.5 +anchor_top = 0.5 +anchor_right = 0.5 +anchor_bottom = 0.5 +margin_left = -340.0 +margin_top = -165.0 +margin_right = 340.0 +margin_bottom = 165.0 +mouse_filter = 1 +window_title = "Open a File" +mode = 0 +filters = PoolStringArray( "*.png ; PNG Images" ) +script = ExtResource( 2 ) + [node name="Settings" parent="." instance=ExtResource( 10 )] +visible = false anchor_left = 0.5 anchor_top = 0.5 anchor_right = 0.5 @@ -773,19 +841,211 @@ margin_top = -50.0 margin_right = 150.0 margin_bottom = 50.0 mouse_filter = 1 -[connection signal="pressed" from="Panel/VBoxContainer/HBoxContainer/ScrollContainer/ToolMenu/Tools/PaintTool" to="." method="_on_PaintTool_pressed"] -[connection signal="pressed" from="Panel/VBoxContainer/HBoxContainer/ScrollContainer/ToolMenu/Tools/BrushTool" to="." method="_on_BrushTool_pressed"] -[connection signal="pressed" from="Panel/VBoxContainer/HBoxContainer/ScrollContainer/ToolMenu/Tools/BucketTool" to="." method="_on_BucketTool_pressed"] -[connection signal="pressed" from="Panel/VBoxContainer/HBoxContainer/ScrollContainer/ToolMenu/Tools/RainbowTool" to="." method="_on_RainbowTool_pressed"] -[connection signal="pressed" from="Panel/VBoxContainer/HBoxContainer/ScrollContainer/ToolMenu/Tools/LineTool" to="." method="_on_LineTool_pressed"] -[connection signal="pressed" from="Panel/VBoxContainer/HBoxContainer/ScrollContainer/ToolMenu/Tools/RectTool" to="." method="_on_RectTool_pressed"] -[connection signal="pressed" from="Panel/VBoxContainer/HBoxContainer/ScrollContainer/ToolMenu/Tools/DarkenTool" to="." method="_on_DarkenTool_pressed"] -[connection signal="pressed" from="Panel/VBoxContainer/HBoxContainer/ScrollContainer/ToolMenu/Tools/BrightenTool" to="." method="_on_BrightenTool_pressed"] -[connection signal="pressed" from="Panel/VBoxContainer/HBoxContainer/ScrollContainer/ToolMenu/Tools/ColorPickerTool" to="." method="_on_ColorPickerTool_pressed"] -[connection signal="pressed" from="Panel/VBoxContainer/HBoxContainer/ScrollContainer/ToolMenu/Tools/CutTool" to="." method="_on_CutTool_pressed"] -[connection signal="color_changed" from="Panel/VBoxContainer/HBoxContainer/ScrollContainer/ToolMenu/Tools/ColorPicker" to="." method="_on_ColorPicker_color_changed"] -[connection signal="pressed" from="Panel/VBoxContainer/HBoxContainer/ScrollContainer/ToolMenu/Control/VBoxContainer/Button" to="." method="_on_Button_pressed"] + +[node name="ChangeCanvasSize" type="ConfirmationDialog" parent="."] +anchor_left = 0.5 +anchor_top = 0.5 +anchor_right = 0.5 +anchor_bottom = 0.5 +margin_left = -162.0 +margin_top = -69.0 +margin_right = 162.0 +margin_bottom = 69.0 +script = ExtResource( 14 ) +__meta__ = { +"_edit_use_anchors_": false +} + +[node name="VBoxContainer" type="VBoxContainer" parent="ChangeCanvasSize"] +anchor_left = 0.104938 +anchor_top = 0.108696 +anchor_right = 0.891975 +anchor_bottom = 0.695652 +margin_left = -25.9999 +margin_top = -7.00005 +margin_right = 27.0001 +margin_bottom = 6.00002 +__meta__ = { +"_edit_use_anchors_": true +} + +[node name="Label" type="Label" parent="ChangeCanvasSize/VBoxContainer"] +margin_top = 5.0 +margin_right = 255.0 +margin_bottom = 19.0 +size_flags_vertical = 6 +text = "Change canvas size?" +align = 1 + +[node name="HBoxContainer" type="HBoxContainer" parent="ChangeCanvasSize/VBoxContainer"] +margin_top = 28.0 +margin_right = 255.0 +margin_bottom = 52.0 +size_flags_horizontal = 3 +size_flags_vertical = 3 + +[node name="Label" type="Label" parent="ChangeCanvasSize/VBoxContainer/HBoxContainer"] +margin_top = 5.0 +margin_right = 125.0 +margin_bottom = 19.0 +size_flags_horizontal = 3 +size_flags_vertical = 6 +text = "Width (X)" + +[node name="Width" type="SpinBox" parent="ChangeCanvasSize/VBoxContainer/HBoxContainer"] +margin_left = 129.0 +margin_right = 255.0 +margin_bottom = 24.0 +size_flags_horizontal = 3 +size_flags_vertical = 3 +min_value = 1.0 +max_value = 2500.0 +value = 64.0 +align = 1 +__meta__ = { +"_edit_use_anchors_": false +} + +[node name="HBoxContainer2" type="HBoxContainer" parent="ChangeCanvasSize/VBoxContainer"] +margin_top = 56.0 +margin_right = 255.0 +margin_bottom = 81.0 +size_flags_horizontal = 3 +size_flags_vertical = 3 + +[node name="Label" type="Label" parent="ChangeCanvasSize/VBoxContainer/HBoxContainer2"] +margin_top = 5.0 +margin_right = 125.0 +margin_bottom = 19.0 +size_flags_horizontal = 3 +size_flags_vertical = 6 +text = "Height (Y)" + +[node name="Height" type="SpinBox" parent="ChangeCanvasSize/VBoxContainer/HBoxContainer2"] +margin_left = 129.0 +margin_right = 255.0 +margin_bottom = 25.0 +size_flags_horizontal = 3 +size_flags_vertical = 3 +min_value = 1.0 +max_value = 2500.0 +value = 64.0 +align = 1 +__meta__ = { +"_edit_use_anchors_": false +} + +[node name="ChangeGridSizeDialog" type="AcceptDialog" parent="."] +anchor_left = 0.5 +anchor_top = 0.5 +anchor_right = 0.5 +anchor_bottom = 0.5 +margin_left = -127.0 +margin_top = -74.0 +margin_right = 128.0 +margin_bottom = 73.0 +window_title = "Change Grid Size" +resizable = true +script = ExtResource( 15 ) +__meta__ = { +"_edit_use_anchors_": false +} + +[node name="VBoxContainer" type="VBoxContainer" parent="ChangeGridSizeDialog"] +anchor_left = 0.0313726 +anchor_top = 0.0816327 +anchor_right = 0.968627 +anchor_bottom = 0.727891 +margin_left = -1.23978e-05 +margin_top = -4.00001 +margin_right = 0.00012207 +margin_bottom = 4.00002 +__meta__ = { +"_edit_use_anchors_": true +} + +[node name="Label" type="Label" parent="ChangeGridSizeDialog/VBoxContainer"] +margin_right = 239.0 +margin_bottom = 31.0 +size_flags_horizontal = 3 +size_flags_vertical = 3 +text = "Change Grid Size" +align = 1 + +[node name="HBoxContainer" type="HBoxContainer" parent="ChangeGridSizeDialog/VBoxContainer"] +margin_top = 35.0 +margin_right = 239.0 +margin_bottom = 67.0 +size_flags_horizontal = 3 +size_flags_vertical = 3 + +[node name="Label" type="Label" parent="ChangeGridSizeDialog/VBoxContainer/HBoxContainer"] +margin_top = 9.0 +margin_right = 117.0 +margin_bottom = 23.0 +size_flags_horizontal = 3 +size_flags_vertical = 6 +text = "Grid 1" + +[node name="GridValue" type="SpinBox" parent="ChangeGridSizeDialog/VBoxContainer/HBoxContainer"] +margin_left = 121.0 +margin_top = 4.0 +margin_right = 239.0 +margin_bottom = 28.0 +size_flags_horizontal = 3 +size_flags_vertical = 6 +max_value = 2500.0 +value = 1.0 + +[node name="HBoxContainer2" type="HBoxContainer" parent="ChangeGridSizeDialog/VBoxContainer"] +margin_top = 71.0 +margin_right = 239.0 +margin_bottom = 103.0 +size_flags_horizontal = 3 +size_flags_vertical = 3 + +[node name="Label" type="Label" parent="ChangeGridSizeDialog/VBoxContainer/HBoxContainer2"] +margin_top = 9.0 +margin_right = 117.0 +margin_bottom = 23.0 +size_flags_horizontal = 3 +size_flags_vertical = 6 +text = "Grid 2" + +[node name="BigGridValue" type="SpinBox" parent="ChangeGridSizeDialog/VBoxContainer/HBoxContainer2"] +margin_left = 121.0 +margin_top = 4.0 +margin_right = 239.0 +margin_bottom = 28.0 +size_flags_horizontal = 3 +size_flags_vertical = 6 +max_value = 2500.0 +value = 8.0 +[connection signal="mouse_entered" from="Panel/NoBCViewportsnotworking26181/HBoxContainer/PaintCanvasContainer" to="." method="_on_PaintCanvasContainer_mouse_entered"] +[connection signal="mouse_exited" from="Panel/NoBCViewportsnotworking26181/HBoxContainer/PaintCanvasContainer" to="." method="_on_PaintCanvasContainer_mouse_exited"] +[connection signal="pressed" from="Panel/NoBCViewportsnotworking26181/HBoxContainer/Panel/ScrollContainer/ToolMenu/Tools/PaintTool" to="." method="_on_PaintTool_pressed"] +[connection signal="pressed" from="Panel/NoBCViewportsnotworking26181/HBoxContainer/Panel/ScrollContainer/ToolMenu/Tools/BrushTool" to="." method="_on_BrushTool_pressed"] +[connection signal="pressed" from="Panel/NoBCViewportsnotworking26181/HBoxContainer/Panel/ScrollContainer/ToolMenu/Tools/BucketTool" to="." method="_on_BucketTool_pressed"] +[connection signal="pressed" from="Panel/NoBCViewportsnotworking26181/HBoxContainer/Panel/ScrollContainer/ToolMenu/Tools/RainbowTool" to="." method="_on_RainbowTool_pressed"] +[connection signal="pressed" from="Panel/NoBCViewportsnotworking26181/HBoxContainer/Panel/ScrollContainer/ToolMenu/Tools/LineTool" to="." method="_on_LineTool_pressed"] +[connection signal="pressed" from="Panel/NoBCViewportsnotworking26181/HBoxContainer/Panel/ScrollContainer/ToolMenu/Tools/RectTool" to="." method="_on_RectTool_pressed"] +[connection signal="pressed" from="Panel/NoBCViewportsnotworking26181/HBoxContainer/Panel/ScrollContainer/ToolMenu/Tools/DarkenTool" to="." method="_on_DarkenTool_pressed"] +[connection signal="pressed" from="Panel/NoBCViewportsnotworking26181/HBoxContainer/Panel/ScrollContainer/ToolMenu/Tools/BrightenTool" to="." method="_on_BrightenTool_pressed"] +[connection signal="pressed" from="Panel/NoBCViewportsnotworking26181/HBoxContainer/Panel/ScrollContainer/ToolMenu/Tools/ColorPickerTool" to="." method="_on_ColorPickerTool_pressed"] +[connection signal="pressed" from="Panel/NoBCViewportsnotworking26181/HBoxContainer/Panel/ScrollContainer/ToolMenu/Tools/CutTool" to="." method="_on_CutTool_pressed"] +[connection signal="color_changed" from="Panel/NoBCViewportsnotworking26181/HBoxContainer/Panel/ScrollContainer/ToolMenu/Tools/ColorPicker" to="." method="_on_ColorPicker_color_changed"] +[connection signal="pressed" from="Panel/NoBCViewportsnotworking26181/HBoxContainer/Panel/ScrollContainer/ToolMenu/Control/VBoxContainer/Button" to="." method="_on_Button_pressed"] [connection signal="about_to_show" from="SaveFileDialog" to="SaveFileDialog" method="_on_SaveFileDialog_about_to_show"] [connection signal="confirmed" from="SaveFileDialog" to="SaveFileDialog" method="_on_SaveFileDialog_confirmed"] [connection signal="file_selected" from="SaveFileDialog" to="SaveFileDialog" method="_on_SaveFileDialog_file_selected"] [connection signal="visibility_changed" from="SaveFileDialog" to="SaveFileDialog" method="_on_SaveFileDialog_visibility_changed"] +[connection signal="about_to_show" from="LoadFileDialog" to="LoadFileDialog" method="_on_LoadFileDialog_about_to_show"] +[connection signal="confirmed" from="LoadFileDialog" to="LoadFileDialog" method="_on_LoadFileDialog_confirmed"] +[connection signal="file_selected" from="LoadFileDialog" to="LoadFileDialog" method="_on_LoadFileDialog_file_selected"] +[connection signal="visibility_changed" from="LoadFileDialog" to="LoadFileDialog" method="_on_LoadFileDialog_visibility_changed"] +[connection signal="confirmed" from="ChangeCanvasSize" to="ChangeCanvasSize" method="_on_ConfirmationDialog_confirmed"] +[connection signal="visibility_changed" from="ChangeCanvasSize" to="ChangeCanvasSize" method="_on_ChangeCanvasSize_visibility_changed"] +[connection signal="confirmed" from="ChangeGridSizeDialog" to="ChangeGridSizeDialog" method="_on_ChangeGridSizeDialog_confirmed"] +[connection signal="visibility_changed" from="ChangeGridSizeDialog" to="ChangeGridSizeDialog" method="_on_ChangeGridSizeDialog_visibility_changed"] +[connection signal="value_changed" from="ChangeGridSizeDialog/VBoxContainer/HBoxContainer/GridValue" to="ChangeGridSizeDialog" method="_on_GridValue_value_changed"] +[connection signal="value_changed" from="ChangeGridSizeDialog/VBoxContainer/HBoxContainer2/BigGridValue" to="ChangeGridSizeDialog" method="_on_BigGridValue_value_changed"] diff --git a/addons/graphics_editor/Layer.gd b/addons/graphics_editor/Layer.gd index 3c236e3..6eb5be0 100644 --- a/addons/graphics_editor/Layer.gd +++ b/addons/graphics_editor/Layer.gd @@ -5,23 +5,62 @@ class_name GELayer var name var pixels # array of pixels (colors), idx repressents x and y var layer_width -var visible = true +var visible = true setget set_visible + +var texture: ImageTexture +var image: Image +var texture_rect_ref func _init(): + texture = ImageTexture.new() pixels = [] -func resize(width: int, height: int): +func create(texture_rect_ref, width: int, height: int): + self.texture_rect_ref = texture_rect_ref pixels = [] for i in range(height * width): pixels.append(Color.transparent) layer_width = width + + image = Image.new() + image.create(width, height, false, Image.FORMAT_RGBA8) + update_texture() + + +func resize(width: int, height: int): + var pixels_and_colors = [] + for i in range(pixels.size()): + pixels_and_colors.append([ + GEUtils.to_2D(i, layer_width), + pixels[i] + ]) + + layer_width = width + pixels.clear() + pixels.resize(width * height) + + image.create(width, height, false, Image.FORMAT_RGBA8) + + for i in range(height * width): + pixels[i] = Color.transparent + + for i in range(pixels_and_colors.size()): + var pos = pixels_and_colors[i][0] + var color = pixels_and_colors[i][1] + if pos.x >= width or pos.y >= height: + continue + set_pixel(pos.x, pos.y, color) + update_texture() func set_pixel(x, y, color): # print("setting pixel: (", x, ", ", y, ") with ", color) pixels[GEUtils.to_1D(x, y, layer_width)] = color + image.lock() + image.set_pixel(x, y, color) + image.unlock() func get_pixel(x: int, y: int): @@ -32,3 +71,16 @@ func clear(): for idx in range(pixels.size()): if pixels[idx] != Color.transparent: pixels[idx] = Color.transparent + +func update_texture(): + texture.create_from_image(image, 0) + texture_rect_ref.texture = texture + texture_rect_ref.margin_right = 0 + texture_rect_ref.margin_bottom = 0 + + +func set_visible(vis: bool): + visible = vis + texture_rect_ref.visible = visible + + diff --git a/addons/graphics_editor/Navbar.gd b/addons/graphics_editor/Navbar.gd index 7a60372..70a82e5 100644 --- a/addons/graphics_editor/Navbar.gd +++ b/addons/graphics_editor/Navbar.gd @@ -36,6 +36,10 @@ func handle_file_menu(pressed_item: String): match pressed_item: "Save": owner.get_node("SaveFileDialog").show() + "Load": + owner.get_node("LoadFileDialog").show() + "New": + owner.get_node("ConfirmationDialog").show() func handle_edit_menu(pressed_item: String): @@ -46,8 +50,8 @@ func handle_edit_menu(pressed_item: String): func handle_canvas_menu(pressed_item: String): match pressed_item: - "Add Layer": - editor.add_new_layer() + "Change Size": + owner.get_node("ChangeCanvasSize").show() func handle_layer_menu(pressed_item: String): @@ -62,8 +66,10 @@ func handle_layer_menu(pressed_item: String): func handle_grid_menu(pressed_item: String): match pressed_item: - "Add Layer": - editor.add_new_layer() + "Change Grid Size": + owner.get_node("ChangeGridSizeDialog").show() + "Toggle Grid": + owner.paint_canvas.toggle_grid() func handle_magic_menu(pressed_item: String): diff --git a/addons/graphics_editor/SaveFileDialog.gd b/addons/graphics_editor/SaveFileDialog.gd index b7f70e2..f76117f 100644 --- a/addons/graphics_editor/SaveFileDialog.gd +++ b/addons/graphics_editor/SaveFileDialog.gd @@ -7,7 +7,7 @@ var file_path = "" func _enter_tree(): - canvas = get_parent().get_node("Panel/VBoxContainer/HBoxContainer/PaintCanvasContainer/Canvas") + canvas = get_parent().find_node("Canvas") func _ready(): diff --git a/addons/graphics_editor/Settings.tscn b/addons/graphics_editor/Settings.tscn index 43473eb..0bb8d65 100644 --- a/addons/graphics_editor/Settings.tscn +++ b/addons/graphics_editor/Settings.tscn @@ -3,6 +3,7 @@ [ext_resource path="res://addons/graphics_editor/Settings.gd" type="Script" id=1] [node name="Settings" type="WindowDialog"] +visible = true margin_top = 20.0 margin_right = 300.0 margin_bottom = 120.0 diff --git a/addons/graphics_editor/ViewportContainer.gd b/addons/graphics_editor/ViewportContainer.gd index 006f07f..5ff1df6 100644 --- a/addons/graphics_editor/ViewportContainer.gd +++ b/addons/graphics_editor/ViewportContainer.gd @@ -1,8 +1,6 @@ extends ViewportContainer +tool func _ready(): - print(name) - pass + get_child(0).size = rect_size -func _notification(what): - pass diff --git a/addons/graphics_editor/actions/Pencil.gd b/addons/graphics_editor/actions/Pencil.gd index 5e45fe4..d42a5f6 100644 --- a/addons/graphics_editor/actions/Pencil.gd +++ b/addons/graphics_editor/actions/Pencil.gd @@ -7,7 +7,7 @@ func do_action(canvas, data: Array): var pixels = GEUtils.get_pixels_in_line(data[0], data[1]) for pixel in pixels: - if pixel in action_data.undo.cells: + if pixel in action_data.undo.cells or canvas.get_pixel_v(pixel) == null: continue action_data.undo.colors.append(canvas.get_pixel_v(pixel)) diff --git a/addons/graphics_editor/assets/grid.png b/addons/graphics_editor/assets/grid.png new file mode 100644 index 0000000..71a1664 Binary files /dev/null and b/addons/graphics_editor/assets/grid.png differ diff --git a/addons/graphics_editor/assets/grid.png.import b/addons/graphics_editor/assets/grid.png.import new file mode 100644 index 0000000..40b17e6 --- /dev/null +++ b/addons/graphics_editor/assets/grid.png.import @@ -0,0 +1,34 @@ +[remap] + +importer="texture" +type="StreamTexture" +path="res://.import/grid.png-74a92f0786b49dae0c01bd21c08c941f.stex" +metadata={ +"vram_texture": false +} + +[deps] + +source_file="res://addons/graphics_editor/assets/grid.png" +dest_files=[ "res://.import/grid.png-74a92f0786b49dae0c01bd21c08c941f.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/addons/graphics_editor/dialogs/ChangeGridSizeDialog.gd b/addons/graphics_editor/dialogs/ChangeGridSizeDialog.gd new file mode 100644 index 0000000..645e70f --- /dev/null +++ b/addons/graphics_editor/dialogs/ChangeGridSizeDialog.gd @@ -0,0 +1,27 @@ +extends AcceptDialog +tool + +func _ready(): + find_node("GridValue").value = owner.paint_canvas.grid_size + find_node("BigGridValue").value = owner.paint_canvas.big_grid_size + + +func _on_ChangeGridSizeDialog_confirmed(): + var grid_size = find_node("GridValue").value + var big_grid_size = find_node("BigGridValue").value + owner.paint_canvas.grid_size = grid_size + owner.paint_canvas.big_grid_size = big_grid_size + + +func _on_GridValue_value_changed(value): + var grid_size = value + owner.paint_canvas.grid_size = grid_size + + +func _on_BigGridValue_value_changed(value): + var big_grid_size = value + owner.paint_canvas.big_grid_size = big_grid_size + + +func _on_ChangeGridSizeDialog_visibility_changed(): + pass # Replace with function body. diff --git a/addons/graphics_editor/dialogs/ConfirmationDialog.gd b/addons/graphics_editor/dialogs/ConfirmationDialog.gd new file mode 100644 index 0000000..7e86413 --- /dev/null +++ b/addons/graphics_editor/dialogs/ConfirmationDialog.gd @@ -0,0 +1,19 @@ +extends ConfirmationDialog +tool + +func _ready(): + find_node("Width").value = owner.paint_canvas.canvas_width + find_node("Height").value = owner.paint_canvas.canvas_height + + +func _on_ConfirmationDialog_confirmed(): + var width = find_node("Width").value + var height = find_node("Height").value + print("change canvas size: ", width, " ", height) + owner.paint_canvas.resize(width, height) + + +func _on_ChangeCanvasSize_visibility_changed(): + if visible: + find_node("Width").value = owner.paint_canvas.canvas_width + find_node("Height").value = owner.paint_canvas.canvas_height diff --git a/addons/graphics_editor/dialogs/LoadFileDialog.gd b/addons/graphics_editor/dialogs/LoadFileDialog.gd new file mode 100644 index 0000000..f3bf1ac --- /dev/null +++ b/addons/graphics_editor/dialogs/LoadFileDialog.gd @@ -0,0 +1,57 @@ +tool +extends FileDialog + + +var canvas: GECanvas + +var file_path = "" + + +func _ready(): + get_line_edit().connect("text_entered", self, "_on_LineEdit_text_entered") + invalidate() + clear_filters() + add_filter("*.png ; PNG Images") + + +func _on_LineEdit_text_entered(_text): + print(_text) + #load_img() + print("hsadfasd") + + +func _on_LoadFileDialog_file_selected(path): + file_path = path + print("1ere") + load_img() + + +func _on_LoadFileDialog_confirmed(): + print("ere") + #load_img() + + +func load_img(): + var image = Image.new() + if image.load(file_path) != OK: + print("couldn't load image!") + return + + var image_data = image.get_data() + var layer: GELayer = owner.add_new_layer() + + for i in range(image_data.size() / 4): + var color = Color(image_data[i*4], image_data[i*4+1], image_data[i*4+2], image_data[i*4+3]) + var pos = GEUtils.to_2D(i, image.get_width()) + if pos.x > layer.layer_width: + continue + layer.set_pixel(pos.x, pos.y, color) + + + +func _on_LoadFileDialog_about_to_show(): + invalidate() + + +func _on_LoadFileDialog_visibility_changed(): + invalidate() diff --git a/addons/graphics_editor/dialogs/LoadFileDialog.tscn b/addons/graphics_editor/dialogs/LoadFileDialog.tscn new file mode 100644 index 0000000..0d083c0 --- /dev/null +++ b/addons/graphics_editor/dialogs/LoadFileDialog.tscn @@ -0,0 +1,22 @@ +[gd_scene load_steps=2 format=2] + +[sub_resource type="GDScript" id=1] +script/source = "extends ConfirmationDialog + +func _ready(): + get_ok().connect(\"pressed\", self, \"hide\") + get_cancel().connect(\"pressed\", self, \"hide\") + + + +" + +[node name="LoadFileDialog" type="FileDialog"] +margin_right = 604.0 +margin_bottom = 367.0 +window_title = "Open a File" +mode = 0 +access = 2 +current_dir = "/Projects/BitBucket/GraphicsEditor" +current_path = "/Projects/BitBucket/GraphicsEditor/" +script = SubResource( 1 )