Basic tablet pen pressure sensitivity, brush alpha now gets blended

Instead of replacing the pixels with the new color's alpha value, the alpha values of the selected color and the current pixel color get blended together. This means that, if you have a pixel with 50% alpha and you draw a color over it with 25% alpha, the final result will have 75% alpha, instead of 25% as it used to be.

The pressure sensitivity is still experimental and may not work properly. Works only with Godot 3.2 and above.

draw_pixel() has also been renamed to draw_brush()
This commit is contained in:
OverloadedOrama 2020-02-09 01:34:37 +02:00
parent 5d0b39f14c
commit f28a3a4405
3 changed files with 68 additions and 45 deletions

View file

@ -16,7 +16,7 @@ var canvases := []
# warning-ignore:unused_class_variable
var hidden_canvases := []
enum PRESSURE_SENSITIVITY {NONE, ALPHA, SIZE}
var pressure_sensitivity_mode = PRESSURE_SENSITIVITY.NONE
var pressure_sensitivity_mode = PRESSURE_SENSITIVITY.ALPHA
var smooth_zoom := true
var left_cursor_tool_texture : ImageTexture
var right_cursor_tool_texture : ImageTexture