Added rectangle selection tool, copy & paste selection and Tile Mode

- New rectangle selection tool. Hold mouse button to create selection, release to finish it. You cannot draw outside of the selection.
- The selection can be moved around, and if Shift is pressed, selected content gets moved too. Currently cannot be moved outside the canvas.
- You can copy the selection with Ctrl + C, and paste it on a new selection with Ctrl + V.
- Added tile mode. Basically draws the canvas 8 more times in all directions.
This commit is contained in:
OverloadedOrama 2019-09-18 17:47:28 +03:00
parent f83e5b44f3
commit 2b710afd3b
7 changed files with 285 additions and 28 deletions

View file

@ -12,6 +12,8 @@ var onion_skinning_future_rate := 0
# warning-ignore:unused_class_variable
var onion_skinning_blue_red := false
# warning-ignore:unused_class_variable
var tile_mode := false
# warning-ignore:unused_class_variable
var draw_grid := false
var canvases := []
var canvas : Canvas
@ -25,6 +27,9 @@ var left_brush_size := 1
# warning-ignore:unused_class_variable
var right_brush_size := 1
var camera : Camera2D
var selection_rectangle : Polygon2D
var selected_pixels := []
var image_clipboard : Image
var file_menu : MenuButton
var edit_menu : MenuButton
@ -61,6 +66,9 @@ func _ready() -> void:
canvas_parent = canvas.get_parent()
camera = find_node_by_name(canvas_parent, "Camera2D")
selection_rectangle = find_node_by_name(root, "SelectionRectangle")
image_clipboard = Image.new()
file_menu = find_node_by_name(root, "FileMenu")
edit_menu = find_node_by_name(root, "EditMenu")
left_indicator = find_node_by_name(root, "LeftIndicator")