mirror of
https://github.com/Orama-Interactive/Pixelorama.git
synced 2025-01-19 09:39:48 +00:00
7ff823f3a5
Also moved blend_image_with_color() to Global and the custom brush image (resized & blended accordingly with the selected color and interpolation factor) is now updated every time something changes (size, color etc) and not every time you draw. This is not true for the eraser, however, as it must be blended with Color(0, 0, 0, 0)
17 lines
569 B
GDScript
17 lines
569 B
GDScript
extends Button
|
|
|
|
var brush_type = Global.BRUSH_TYPES.PIXEL
|
|
var custom_brush_index := -1
|
|
|
|
func _on_BrushButton_pressed() -> void:
|
|
if Input.is_action_just_released("left_mouse"):
|
|
Global.current_left_brush_type = brush_type
|
|
if custom_brush_index > -1:
|
|
Global.custom_left_brush_index = custom_brush_index
|
|
Global.update_left_custom_brush()
|
|
|
|
elif Input.is_action_just_released("right_mouse"):
|
|
Global.current_right_brush_type = brush_type
|
|
if custom_brush_index > -1:
|
|
Global.custom_right_brush_index = custom_brush_index
|
|
Global.update_right_custom_brush() |