paint_root.tscn 5.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223
  1. [gd_scene load_steps=5 format=2]
  2. [ext_resource path="res://paint_control.gd" type="Script" id=1]
  3. [ext_resource path="res://tools_panel.gd" type="Script" id=2]
  4. [ext_resource path="res://paint_tools.png" type="Texture" id=3]
  5. [sub_resource type="StyleBoxFlat" id=1]
  6. bg_color = Color( 1, 1, 1, 1 )
  7. [node name="PaintRoot" type="Control"]
  8. margin_right = 40.0
  9. margin_bottom = 40.0
  10. __meta__ = {
  11. "_edit_use_anchors_": false
  12. }
  13. [node name="DrawingAreaBG" type="Panel" parent="."]
  14. margin_left = 350.0
  15. margin_right = 1280.0
  16. margin_bottom = 720.0
  17. custom_styles/panel = SubResource( 1 )
  18. [node name="PaintControl" type="Control" parent="."]
  19. margin_right = 40.0
  20. margin_bottom = 40.0
  21. script = ExtResource( 1 )
  22. __meta__ = {
  23. "_edit_use_anchors_": false
  24. }
  25. [node name="TLPos" type="Position2D" parent="PaintControl"]
  26. position = Vector2( 350, 0 )
  27. [node name="ToolsPanel" type="Panel" parent="."]
  28. margin_right = 350.0
  29. margin_bottom = 720.0
  30. script = ExtResource( 2 )
  31. [node name="LabelTools" type="Label" parent="ToolsPanel"]
  32. margin_left = 20.0
  33. margin_top = 10.0
  34. margin_right = 330.0
  35. margin_bottom = 24.0
  36. text = "Selected tool: Pencil"
  37. align = 1
  38. [node name="ButtonToolPencil" type="Button" parent="ToolsPanel"]
  39. margin_left = 40.0
  40. margin_top = 40.0
  41. margin_right = 100.0
  42. margin_bottom = 100.0
  43. [node name="Sprite" type="Sprite" parent="ToolsPanel/ButtonToolPencil"]
  44. position = Vector2( 30, 30 )
  45. scale = Vector2( 2.5, 2.5 )
  46. texture = ExtResource( 3 )
  47. region_enabled = true
  48. region_rect = Rect2( 0, 0, 16, 16 )
  49. [node name="ButtonToolEraser" type="Button" parent="ToolsPanel"]
  50. margin_left = 110.0
  51. margin_top = 40.0
  52. margin_right = 170.0
  53. margin_bottom = 100.0
  54. [node name="Sprite" type="Sprite" parent="ToolsPanel/ButtonToolEraser"]
  55. position = Vector2( 30, 30 )
  56. scale = Vector2( 2.5, 2.5 )
  57. texture = ExtResource( 3 )
  58. region_enabled = true
  59. region_rect = Rect2( 16, 0, 16, 16 )
  60. [node name="ButtonToolRectangle" type="Button" parent="ToolsPanel"]
  61. margin_left = 180.0
  62. margin_top = 40.0
  63. margin_right = 240.0
  64. margin_bottom = 100.0
  65. [node name="Sprite" type="Sprite" parent="ToolsPanel/ButtonToolRectangle"]
  66. position = Vector2( 30, 30 )
  67. scale = Vector2( 2.5, 2.5 )
  68. texture = ExtResource( 3 )
  69. region_enabled = true
  70. region_rect = Rect2( 0, 16, 16, 16 )
  71. [node name="ButtonToolCircle" type="Button" parent="ToolsPanel"]
  72. margin_left = 250.0
  73. margin_top = 40.0
  74. margin_right = 310.0
  75. margin_bottom = 100.0
  76. [node name="Sprite" type="Sprite" parent="ToolsPanel/ButtonToolCircle"]
  77. position = Vector2( 30, 30 )
  78. scale = Vector2( 2.5, 2.5 )
  79. texture = ExtResource( 3 )
  80. region_enabled = true
  81. region_rect = Rect2( 16, 16, 16, 16 )
  82. [node name="LabelBrushColor" type="Label" parent="ToolsPanel"]
  83. margin_left = 20.0
  84. margin_top = 120.0
  85. margin_right = 330.0
  86. margin_bottom = 134.0
  87. text = "Current color"
  88. align = 1
  89. [node name="ColorPickerBrush" type="ColorPickerButton" parent="ToolsPanel"]
  90. margin_left = 20.0
  91. margin_top = 140.0
  92. margin_right = 330.0
  93. margin_bottom = 190.0
  94. [node name="BrushSettings" type="Control" parent="ToolsPanel"]
  95. margin_top = 200.0
  96. margin_right = 350.0
  97. margin_bottom = 375.0
  98. [node name="LabelBrushSize" type="Label" parent="ToolsPanel/BrushSettings"]
  99. margin_left = 20.0
  100. margin_top = 10.0
  101. margin_right = 330.0
  102. margin_bottom = 24.0
  103. text = "Brush size: 32px"
  104. align = 1
  105. [node name="HScrollBarBrushSize" type="HScrollBar" parent="ToolsPanel/BrushSettings"]
  106. margin_left = 20.0
  107. margin_top = 30.0
  108. margin_right = 330.0
  109. margin_bottom = 60.0
  110. min_value = 2.0
  111. step = 1.0
  112. value = 32.0
  113. [node name="LabelBrushShape" type="Label" parent="ToolsPanel/BrushSettings"]
  114. margin_left = 20.0
  115. margin_top = 80.0
  116. margin_right = 330.0
  117. margin_bottom = 94.0
  118. text = "Brush shape: Circle"
  119. align = 1
  120. [node name="ButtonShapeBox" type="Button" parent="ToolsPanel/BrushSettings"]
  121. margin_left = 100.0
  122. margin_top = 100.0
  123. margin_right = 160.0
  124. margin_bottom = 160.0
  125. [node name="Sprite" type="Sprite" parent="ToolsPanel/BrushSettings/ButtonShapeBox"]
  126. position = Vector2( 30, 30 )
  127. scale = Vector2( 2.5, 2.5 )
  128. texture = ExtResource( 3 )
  129. region_enabled = true
  130. region_rect = Rect2( 0, 16, 16, 16 )
  131. [node name="ButtonShapeCircle" type="Button" parent="ToolsPanel/BrushSettings"]
  132. margin_left = 190.0
  133. margin_top = 100.0
  134. margin_right = 250.0
  135. margin_bottom = 160.0
  136. [node name="Sprite" type="Sprite" parent="ToolsPanel/BrushSettings/ButtonShapeCircle"]
  137. position = Vector2( 30, 30 )
  138. scale = Vector2( 2.5, 2.5 )
  139. texture = ExtResource( 3 )
  140. region_enabled = true
  141. region_rect = Rect2( 16, 16, 16, 16 )
  142. [node name="LabelBackgroundColor" type="Label" parent="ToolsPanel"]
  143. margin_left = 20.0
  144. margin_top = 400.0
  145. margin_right = 330.0
  146. margin_bottom = 414.0
  147. text = "Background color"
  148. align = 1
  149. [node name="ColorPickerBackground" type="ColorPickerButton" parent="ToolsPanel"]
  150. margin_left = 20.0
  151. margin_top = 420.0
  152. margin_right = 330.0
  153. margin_bottom = 470.0
  154. color = Color( 1, 1, 1, 1 )
  155. edit_alpha = false
  156. [node name="LabelStats" type="Label" parent="ToolsPanel"]
  157. modulate = Color( 0.414062, 0.414062, 0.414062, 1 )
  158. margin_left = 20.0
  159. margin_top = 590.0
  160. margin_right = 330.0
  161. margin_bottom = 604.0
  162. text = "Brush objects: 00000"
  163. align = 1
  164. [node name="ButtonUndo" type="Button" parent="ToolsPanel"]
  165. margin_left = 10.0
  166. margin_top = 520.0
  167. margin_right = 340.0
  168. margin_bottom = 560.0
  169. text = "Undo last stroke"
  170. [node name="ButtonSave" type="Button" parent="ToolsPanel"]
  171. margin_left = 10.0
  172. margin_top = 620.0
  173. margin_right = 340.0
  174. margin_bottom = 660.0
  175. text = "Save picture"
  176. [node name="ButtonClear" type="Button" parent="ToolsPanel"]
  177. margin_left = 10.0
  178. margin_top = 670.0
  179. margin_right = 340.0
  180. margin_bottom = 710.0
  181. text = "Clear picture"
  182. [node name="SaveFileDialog" type="FileDialog" parent="."]
  183. margin_right = 600.0
  184. margin_bottom = 400.0
  185. resizable = true
  186. access = 2
  187. filters = PoolStringArray( "*.png" )
  188. current_dir = "/home/aaronfranke/workspace/godot-demo-projects/2d/gd_paint"
  189. current_path = "/home/aaronfranke/workspace/godot-demo-projects/2d/gd_paint/"