From e51ae47bcfce6e4892cbce44c41c40dec0790b67 Mon Sep 17 00:00:00 2001 From: cobrapitz <12397702+cobrapitz@users.noreply.github.com> Date: Fri, 30 Oct 2020 12:32:04 +0100 Subject: [PATCH] added resize, toggle grid, fix mouse interacting with canvas outside of window, improved performance, only render when changed, using TextureRects' set_pixel instead of drawing rects, canvas size can be changed, load file added ( loadfile and save file might be broken due to change of layer rendering/data structure change) --- ...t.png-2b0b935732229e5bd5e655f2644b2498.md5 | 3 - ....png-2b0b935732229e5bd5e655f2644b2498.stex | Bin 336 -> 0 bytes ...2.png-dc930d6a9dd4d7b13b21ba611cfdebca.md5 | 3 - ....png-dc930d6a9dd4d7b13b21ba611cfdebca.stex | Bin 165 -> 0 bytes ...3.png-8f9b5bfe1c2a8f5f1fc480e2ea82bb92.md5 | 3 - ....png-8f9b5bfe1c2a8f5f1fc480e2ea82bb92.stex | Bin 993 -> 0 bytes ...d.png-a13f0a261f39166a0d5d0b76154a64e2.md5 | 3 - ....png-a13f0a261f39166a0d5d0b76154a64e2.stex | Bin 395 -> 0 bytes ...1.png-167afecc24d1a4f652165e618d695c31.md5 | 3 - ....png-167afecc24d1a4f652165e618d695c31.stex | Bin 129 -> 0 bytes ...2.png-f0dad7baf25c6e54b41a6f2a116ecf42.md5 | 3 - ....png-f0dad7baf25c6e54b41a6f2a116ecf42.stex | Bin 372 -> 0 bytes ...3.png-feec22cacb1aa18f93c44c7160f20f42.md5 | 3 - ....png-feec22cacb1aa18f93c44c7160f20f42.stex | Bin 416 -> 0 bytes ...4.png-8619abbd051622dc3a1a96b29ef7aaae.md5 | 3 - ....png-8619abbd051622dc3a1a96b29ef7aaae.stex | Bin 268 -> 0 bytes ...5.png-952e9ca6dabcfbaa26ca722fb438460d.md5 | 3 - ....png-952e9ca6dabcfbaa26ca722fb438460d.stex | Bin 229 -> 0 bytes ...6.png-c312879c7424d3f742a8629bdf12c861.md5 | 3 - ....png-c312879c7424d3f742a8629bdf12c861.stex | Bin 302 -> 0 bytes ...7.png-3fa1be78ca4193859b8a428052ed246f.md5 | 3 - ....png-3fa1be78ca4193859b8a428052ed246f.stex | Bin 487 -> 0 bytes ...8.png-8430826c445aa334cda4e6aa4e2be776.md5 | 3 - ....png-8430826c445aa334cda4e6aa4e2be776.stex | Bin 306 -> 0 bytes addons/graphics_editor/Canvas.gd | 77 +- addons/graphics_editor/Editor.gd | 110 +- addons/graphics_editor/Editor.tscn | 1390 ++++++++++------- addons/graphics_editor/Layer.gd | 56 +- addons/graphics_editor/Navbar.gd | 14 +- addons/graphics_editor/SaveFileDialog.gd | 2 +- addons/graphics_editor/Settings.tscn | 1 + addons/graphics_editor/ViewportContainer.gd | 6 +- addons/graphics_editor/actions/Pencil.gd | 2 +- addons/graphics_editor/assets/grid.png | Bin 0 -> 148 bytes addons/graphics_editor/assets/grid.png.import | 34 + .../dialogs/ChangeGridSizeDialog.gd | 27 + .../dialogs/ConfirmationDialog.gd | 19 + .../graphics_editor/dialogs/LoadFileDialog.gd | 57 + .../dialogs/LoadFileDialog.tscn | 22 + 39 files changed, 1210 insertions(+), 643 deletions(-) delete mode 100644 .import/test.png-2b0b935732229e5bd5e655f2644b2498.md5 delete mode 100644 .import/test.png-2b0b935732229e5bd5e655f2644b2498.stex delete mode 100644 .import/test2.png-dc930d6a9dd4d7b13b21ba611cfdebca.md5 delete mode 100644 .import/test2.png-dc930d6a9dd4d7b13b21ba611cfdebca.stex delete mode 100644 .import/test3.png-8f9b5bfe1c2a8f5f1fc480e2ea82bb92.md5 delete mode 100644 .import/test3.png-8f9b5bfe1c2a8f5f1fc480e2ea82bb92.stex delete mode 100644 .import/test_blend.png-a13f0a261f39166a0d5d0b76154a64e2.md5 delete mode 100644 .import/test_blend.png-a13f0a261f39166a0d5d0b76154a64e2.stex delete mode 100644 .import/test_blend1.png-167afecc24d1a4f652165e618d695c31.md5 delete mode 100644 .import/test_blend1.png-167afecc24d1a4f652165e618d695c31.stex delete mode 100644 .import/test_blend2.png-f0dad7baf25c6e54b41a6f2a116ecf42.md5 delete mode 100644 .import/test_blend2.png-f0dad7baf25c6e54b41a6f2a116ecf42.stex delete mode 100644 .import/test_blend3.png-feec22cacb1aa18f93c44c7160f20f42.md5 delete mode 100644 .import/test_blend3.png-feec22cacb1aa18f93c44c7160f20f42.stex delete mode 100644 .import/test_blend4.png-8619abbd051622dc3a1a96b29ef7aaae.md5 delete mode 100644 .import/test_blend4.png-8619abbd051622dc3a1a96b29ef7aaae.stex delete mode 100644 .import/test_blend5.png-952e9ca6dabcfbaa26ca722fb438460d.md5 delete mode 100644 .import/test_blend5.png-952e9ca6dabcfbaa26ca722fb438460d.stex delete mode 100644 .import/test_blend6.png-c312879c7424d3f742a8629bdf12c861.md5 delete mode 100644 .import/test_blend6.png-c312879c7424d3f742a8629bdf12c861.stex delete mode 100644 .import/test_blend7.png-3fa1be78ca4193859b8a428052ed246f.md5 delete mode 100644 .import/test_blend7.png-3fa1be78ca4193859b8a428052ed246f.stex delete mode 100644 .import/test_blend8.png-8430826c445aa334cda4e6aa4e2be776.md5 delete mode 100644 .import/test_blend8.png-8430826c445aa334cda4e6aa4e2be776.stex create mode 100644 addons/graphics_editor/assets/grid.png create mode 100644 addons/graphics_editor/assets/grid.png.import create mode 100644 addons/graphics_editor/dialogs/ChangeGridSizeDialog.gd create mode 100644 addons/graphics_editor/dialogs/ConfirmationDialog.gd create mode 100644 addons/graphics_editor/dialogs/LoadFileDialog.gd create mode 100644 addons/graphics_editor/dialogs/LoadFileDialog.tscn 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 795b9fd639e6db17d684290fb2690c610de24942..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 336 zcmZ>F2@Ww}U|^5{Viq7~U=Uzu1d=8|BEZjGp%X~(a!GLkg?K$ZT!Mf!SUCq9khSM; z-5nssSRCZ;#IWw1%u68Wm8XkiNJQ(?>4E&s1{^IfH~s%VeRsR-WkHQQQ>Db;pY`&$ zi_+evcd0cb`1&o4UGWRs7+$ov?3=vyW2BF&2S-C#<@7x&_pd$BS($U_F>|=cdHEoM!d_4a96Pvyp2>sM#{-(qL#Sk=eSTO8)MI^0a)u2F{0V|^wDgJ&!B zKhJYuus$mG+>Bw(Jk|x@GmMX|3zIrfb@A9njudf?Qm#x6-a~76xIMNC%{0FKIwsQo zyJh%Sr`bP0l+XkKnj3;6 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 70b9a47ddb3dbcf077a674016ca7199b94399aff..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 165 zcmZ>F2@Ww}U|^5|Viq7~U=Uzu1d^RV9N_1!&Qu73fh0U#{an^LB{Ts5S`95| 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 db77785d5cf14e7d7247fad97ece70679cc142c1..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 993 zcmV<710MWGL{n5S0000S000040000001yWO0002R0{{R}PDdb#P)Px&dr3q=R9J=8m`!%0IuM1w z%3%Rv33ypBfQ5LNg}?wW%U%NB!F_|0gaFxby3?J0l~cz=NUB>uDqS0pG^4Ruq!|e$ z1;xk5X7TZv&7Alrk@kpVX}@`$yI+S8XtOTa37?>ZCq74;2vuWq$2x$T9*iHBsaeDs zdeuy)g|WG>FJ(-p1%1^1Zwu9Mt-&0)b)X-C?J}Mg_(~8BRRR#0#j&4pB7lEcrt<;~ zR8v?uHvVF`)!&Wn`=x^($7vvONZT(Sg;MHFjLn@s3(VB4(eAJH##+oofAupEpChWB z300^7_C@@fcLNuo1N)5{^fM_2TjM$;JUT$D%GMrxpwjfq3&>`mdtu%ey{}%Iwr&~^ zyGoghv+XI4M{n#i@S2Y{t0IuYkTEq2!|lDibB9N`U~@kZ>VIp&q%ik+@wUgIHw&wB zeM!m_BM^vK%@PiQ#>@6{#AV*{wn6*~r7pHRsYJZ@XI2hCrt_*Ge-8A3Y;B?+nWk~rZMx2nKhtEig!FUE zywVWOs5&xd72DOH5QVccHg|?=oxVD3)6Wadi1YIq~Q6F0iiH#Z0=|_8FDHS((=C$1Gv`oc#HlIOWl2Af9ow9 P00000NkvXXu0mjfn|{iF 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 ece96471ea6f367606c1afc0690adf95dacb5bf3..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 395 zcmZ>F2@Ww}U|^5|Viq7~U=Uzu1d{ncBEZjGp%X~(a!GLkg?K$ZT!Mf!SUCq9kfoku za|%c?76-XIF|0c$^AgBb^>lFziD-R0VnVDIIOuREi<@x78 zs}ILkS?v4qh9zj%&S?w(B+gcUaj-D*=}7~d8|;A#)1A40h-Yv|uG=E4l(7Eq^+R0_ zW@|)$bFML5vc1FB)a8jwfZ{4Sr|Jbee^1MuS9j~dJhg38UtAJeDAEyeVv_d7Ey2fb zotkJOvfJlHL1MzfES{#UJz?>(Q5-o(6fJXEkCgt-nbHQ)#$A7u&=tAuMGr9a7(8A5T-G@yGywp9yr4b+ 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 6625786131c666947b474001f4728ca451f16acc..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 129 zcmZ>F2@Ww}U|^5|Viq7~U=Uzu1d^#h9N_1!&5YN-q K&t;ucLK6V_k{F2q 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 a4fb35f9eb8d5fd17f804af9da40e25911332d13..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 372 zcmZ>F2@Ww}U|^5|Viq7~U=Uzu1dEpSOukb$U1bP0l+XkKJCltZ 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 9f8f01404119d257d3557797ccf569100bf44c97..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 416 zcmZ>F2@Ww}U|^5|Viq7~U=Uzu1d=U4BEZjGp%X~(a!GLkg?K$ZT!Mf!SUCq9kfoku za|%c?76-XIF|0c$^AgCm@^oEBV#qOGA z#s(T{A{OVi%KS>WzwX(bNROutZVU;+f*aKm4gV*$Osmm1VS0CKL0g1LWr6{-&_T&3 zjB^`U)VLkYFGfdQZkm5w>G)1N))fLJi;F70IAtpua<|-k!Whll6LoT~O@QD6i|*Jx zuUWHs16Xt~svLatXX5O=S&GNQ8e7^Xv~MxE@TF9H(^;KLmaHdAi%(q3Qd*K=DdekR zG_mEq)}EYOcRVUDKa1qp?#p-4NjCRT$fq}LY>!eE{Wb5%+~t@0kg~k1A~)sBZkM7c zMf=$jC!+Hn6bPO)e08UOq0$zAuZ^+-53aUt&fxs8Bhb^uLtL9PV0nBZ2|fmufQN>@O1TaS?83{ F1OO52qCo%v 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 648bbbe71d6dfedf90f700ee6279035a713d554f..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 268 zcmZ>F2@Ww}U|^5|Viq7~U=Uzu1d<<|A4`e0Hu418M(=QrQJDEu{RUe@*Uj&BM;Lk=muc`s-1gYE z^@gIK#nGrH)q`PM0yeWTDKY;o)c<~czNK3$o1?&&=L{cB#TV=?ZCnO)F@vY8pUXO@ GgeCyAkY4Bj 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 519371dc7087be542f8b5e752572dc2f40c5a551..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 229 zcmZ>F2@Ww}U|^5|Viq7~U=Uzu1d=C#IKasQ4(SPPo-t3EL_SUyFh zI#HO##bwDsv+4$+?uAupHyiX1GatBD+4oMw;Kt8?8&Vw7{@?v@U=bthyNik31tJC> zMgJM+F(_>Of01t$!||jCd<;9nG&=1Lr15_^{8@FEzKOTPx9#)mT16Ck_1?yF`7oLp R>;yW6!PC{xWt~$(69D90OcekC 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 34d91ffd4734207c8958b21702bdd17fdd2f0dde..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 302 zcmZ>F2@Ww}U|^5|Viq7~U=Uzu1d>8PBEZjGp%X~(a!GLkg?K$ZT!Mf!SUCq9kfoku za|%c?76-XIF|0c$^AgB8;pyTS64Cm0dLmbY0*_mG$%J(`Ja;9jpRAjba4qZdOSK;k zN?o5mTk1CS={dg?U-Q{-SN_doOP{J^Ff5|!ipg@JR&>c37i>!cWK?(Tfx!6&-d zw6$&Z&KG|U&S&K|eb8)@%JAUL2KlcyPW0+?i}9o^6jhMPx$fk{L`R9J=WSWAw=Fbs7@ zTqNt6tTR| zadiqw>2O-RvbA0rfs;`D>`oKG`@Kenn2i7>*HWb$Ar-O4ZKhwu08Z$7fCCBO#6~MjwPb39+Zj^#@`^I^-_yTQ zKx6lYJkE{SY5;x@YRPbaJgqUqL@jxn0f%tJsPi0qUU-UlbU=9yrv|^H1r?^vMd8`# z%>c!VqcK=oZ{$kd>twLA(0R>M7{J$sC?Q{m(K-qacN)gc`A-~X9uEeugOrTUUO{gN zOrK(nm=PEZSQJ-`6CQ}qv5L3}S7O%`W=Cr)0$aRGjfnoB`MQ54YRRFfd~%wa0(N4_ dkNSTE@B%};nT)4SkZk|}002ovPDHLkV1jUd%%A`O 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 81f7d2be45e9101b41175bb1de14a731afad2bab..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 306 zcmZ>F2@Ww}U|^5|Viq7~U=Uzu1d?JvBEZjGp%X~(a!GLkg?K$ZT!Mf!SUCq9kfoku za|%c?76-XIF|0c$^AgB8uYa4CWUi{%(|f|%m@_@{ zV$seFU5Ab0S6KF*PnP&>>sM|h78l5!>5?X(#*on8u|aIonk>!L%()^PPVx3L`&!#y z<~=Xx5MVK}w_JE~N3N5SpCZeA>2*viSTw3DuJLv)WttISZJ?O+giSotZ_bRYg`Jm| zs5^z-nQOE6gvi!``Q#r= 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 0000000000000000000000000000000000000000..71a1664785972c0037b5c3d88fc9328619671bc4 GIT binary patch literal 148 zcmeAS@N?(olHy`uVBq!ia0vp^3LwnE1|*BCs=fdz#^NA%Cx&(BWL^R}ex5FlArY;~ zb4-hW)w6LmG{)Mf-jbZ5amkm};8jB)dyiGZ6~@JU5~T-LFiZHy{&x$kesE}EtB7U7 i0cV7an=Du{1H+~zob#9(9e)B%X7F_Nb6Mw<&;$U~#V#xW literal 0 HcmV?d00001 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 )