mirror of
https://github.com/godotengine/godot-demo-projects.git
synced 2026-01-04 06:09:46 +03:00
Made changes to gd_paint demo based on feedback by aaronfranke
This commit is contained in:
@@ -51,7 +51,7 @@ func _ready():
|
||||
set_process(true)
|
||||
|
||||
|
||||
func _process(delta):
|
||||
func _process(_delta):
|
||||
var mouse_pos = get_viewport().get_mouse_position()
|
||||
|
||||
# Check if the mouse is currently inside the canvas/drawing-area
|
||||
@@ -135,6 +135,7 @@ func undo_stroke():
|
||||
# Figure out how many elements/brushes we've added in the last stroke
|
||||
var elements_to_remove = brush_data_list.size() - undo_element_list_num
|
||||
# Remove all of the elements we've added this in the last stroke
|
||||
#warning-ignore:unused_variable
|
||||
for elment_num in range(0, elements_to_remove):
|
||||
brush_data_list.pop_back()
|
||||
|
||||
|
||||
@@ -16,6 +16,7 @@ func _ready():
|
||||
paint_control = get_parent().get_node("PaintControl")
|
||||
save_dialog = get_parent().get_node("SaveFileDialog")
|
||||
|
||||
# warning-ignore-all:return_value_discarded
|
||||
# Assign all of the needed signals for the oppersation buttons
|
||||
get_node("ButtonUndo").connect("pressed", self, "button_pressed", ["undo_stroke"])
|
||||
get_node("ButtonSave").connect("pressed", self, "button_pressed", ["save_picture"])
|
||||
@@ -47,7 +48,7 @@ func _ready():
|
||||
set_physics_process(true)
|
||||
|
||||
|
||||
func _physics_process(delta):
|
||||
func _physics_process(_delta):
|
||||
# Update the status label with the newest brush element count
|
||||
label_stats.text = "Brush objects: " + String(paint_control.brush_data_list.size())
|
||||
|
||||
|
||||
Reference in New Issue
Block a user