Add Pan Tool (#399)

This commit is contained in:
Laurenz Reinthaler 2020-12-23 19:41:42 +01:00 committed by GitHub
parent 425b11d4b2
commit 2a7e668976
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
25 changed files with 369 additions and 12 deletions

View file

@ -5,6 +5,7 @@ extends VBoxContainer
onready var tools := [
[$RectSelect, "rectangle_select"],
[$Zoom, "zoom"],
[$Pan, "pan"],
[$ColorPicker, "colorpicker"],
[$Pencil, "pencil"],
[$Eraser, "eraser"],

View file

@ -1,4 +1,4 @@
[gd_scene load_steps=26 format=2]
[gd_scene load_steps=27 format=2]
[ext_resource path="res://src/UI/ToolButtons.gd" type="Script" id=1]
[ext_resource path="res://src/UI/Canvas/CanvasPreview.tscn" type="PackedScene" id=2]
@ -21,6 +21,7 @@
[ext_resource path="res://src/UI/Canvas/Canvas.tscn" type="PackedScene" id=19]
[ext_resource path="res://src/Palette/PalettePanelContainer.tscn" type="PackedScene" id=20]
[ext_resource path="res://assets/graphics/dark_themes/tools/zoom.png" type="Texture" id=21]
[ext_resource path="res://assets/graphics/dark_themes/tools/pan.png" type="Texture" id=22]
[ext_resource path="res://src/UI/ViewportContainer.gd" type="Script" id=23]
[sub_resource type="ShaderMaterial" id=1]
@ -83,7 +84,7 @@ __meta__ = {
margin_left = 7.0
margin_top = 7.0
margin_right = 39.0
margin_bottom = 255.0
margin_bottom = 291.0
size_flags_horizontal = 4
size_flags_vertical = 0
script = ExtResource( 1 )
@ -126,7 +127,7 @@ __meta__ = {
"_edit_use_anchors_": false
}
[node name="ColorPicker" type="Button" parent="ToolPanel/PanelContainer/ToolButtons" groups=[
[node name="Pan" type="Button" parent="ToolPanel/PanelContainer/ToolButtons" groups=[
"UIButtons",
]]
margin_top = 72.0
@ -136,6 +137,24 @@ rect_min_size = Vector2( 32, 32 )
mouse_default_cursor_shape = 2
button_mask = 3
[node name="TextureRect" type="TextureRect" parent="ToolPanel/PanelContainer/ToolButtons/Pan"]
margin_right = 32.0
margin_bottom = 32.0
texture = ExtResource( 22 )
__meta__ = {
"_edit_use_anchors_": false
}
[node name="ColorPicker" type="Button" parent="ToolPanel/PanelContainer/ToolButtons" groups=[
"UIButtons",
]]
margin_top = 108.0
margin_right = 32.0
margin_bottom = 140.0
rect_min_size = Vector2( 32, 32 )
mouse_default_cursor_shape = 2
button_mask = 3
[node name="TextureRect" type="TextureRect" parent="ToolPanel/PanelContainer/ToolButtons/ColorPicker"]
margin_right = 32.0
margin_bottom = 32.0
@ -147,9 +166,9 @@ __meta__ = {
[node name="Pencil" type="Button" parent="ToolPanel/PanelContainer/ToolButtons" groups=[
"UIButtons",
]]
margin_top = 108.0
margin_top = 144.0
margin_right = 32.0
margin_bottom = 140.0
margin_bottom = 176.0
rect_min_size = Vector2( 32, 32 )
mouse_default_cursor_shape = 2
button_mask = 3
@ -165,9 +184,9 @@ __meta__ = {
[node name="Eraser" type="Button" parent="ToolPanel/PanelContainer/ToolButtons" groups=[
"UIButtons",
]]
margin_top = 144.0
margin_top = 180.0
margin_right = 32.0
margin_bottom = 176.0
margin_bottom = 212.0
rect_min_size = Vector2( 32, 32 )
mouse_default_cursor_shape = 2
button_mask = 3
@ -183,9 +202,9 @@ __meta__ = {
[node name="Bucket" type="Button" parent="ToolPanel/PanelContainer/ToolButtons" groups=[
"UIButtons",
]]
margin_top = 180.0
margin_top = 216.0
margin_right = 32.0
margin_bottom = 212.0
margin_bottom = 248.0
rect_min_size = Vector2( 32, 32 )
mouse_default_cursor_shape = 2
button_mask = 3
@ -201,9 +220,9 @@ __meta__ = {
[node name="LightenDarken" type="Button" parent="ToolPanel/PanelContainer/ToolButtons" groups=[
"UIButtons",
]]
margin_top = 216.0
margin_top = 252.0
margin_right = 32.0
margin_bottom = 248.0
margin_bottom = 284.0
rect_min_size = Vector2( 32, 32 )
mouse_default_cursor_shape = 2
button_mask = 3