Layer Opacity - Change alpha of each layer

Added a slider under the layer add/remove/etc buttons that changes the currently selected layer's transparency. It gets saved in .png and .pxo files, while respecting non-opaque pixels in the image too. Which means, their alpha values aren't being overwritten.
This commit is contained in:
OverloadedOrama 2019-12-24 23:51:08 +02:00
parent aa860960e2
commit ed2e757c11
7 changed files with 77 additions and 35 deletions

View file

@ -43,9 +43,10 @@ func changed_selection() -> void:
child.label.visible = true
child.line_edit.visible = false
child.line_edit.editable = false
if Global.canvas.current_layer_index == child.i:
if Global.canvas.current_layer_index == child.i: # The selected layer
child.currently_selected = true
child.pressed = true
Global.layer_opacity_slider.value = Global.canvas.layers[child.i][4] * 100
if Global.canvas.current_layer_index < Global.canvas.layers.size() - 1:
Global.move_up_layer_button.disabled = false