GraphicsEditor/addons/graphics_editor/Tools/Rainbow.gd

12 lines
401 B
GDScript3
Raw Normal View History

2019-11-23 12:33:43 +01:00
tool
extends "../Tool.gd"
func on_left_mouse_click():
if cell_mouse_position != last_cell_mouse_position:
var points = canvas.util.get_points_from_line(last_cell_mouse_position, cell_mouse_position)
for i in points:
canvas.set_pixel(i, util.random_color_alt())
func on_right_mouse_click():
canvas.util.set_pixels_from_line(last_cell_mouse_position, cell_mouse_position, Color(0, 0, 0, 0))