Add opacity slider with shader-based rendering that preserves clip mask behavior

- Added opacity slider (0-100%) in sprite options with 'affect children' checkbox
- Implemented hierarchical opacity that affects entire sprite hierarchy when enabled
- Created shader-based opacity system that doesn't interfere with clip mask functionality
- Clip masks now work with original image pixels regardless of opacity settings
- Removed shadow effects from selected sprites to prevent visual conflicts
- Updated save/load system to persist opacity properties with backward compatibility

Fixes clipping behavior issues where opacity changes previously affected clip mask detection
This commit is contained in:
2025-07-20 04:07:41 +10:00
parent 758f2ca885
commit 1295bcbcba
9 changed files with 153 additions and 25 deletions

View File

@@ -73,6 +73,10 @@ func setImage():
$Animation/animFramesLabel.text = "sprite frames: " + str(Global.heldSprite.frames)
$Animation/animFrames.value = Global.heldSprite.frames
$Opacity/opacityLabel.text = "opacity: " + str(int(Global.heldSprite.spriteOpacity * 100)) + "%"
$Opacity/opacitySlider.value = Global.heldSprite.spriteOpacity
$Opacity/affectChildrenCheck.button_pressed = Global.heldSprite.affectChildrenOpacity
$VisToggle/setToggle/Label.text = "toggle: \"" + Global.heldSprite.toggle + "\""
changeRotLimit()
@@ -369,3 +373,12 @@ func _on_set_toggle_pressed():
var key = keys[0]
Global.heldSprite.toggle = key
$VisToggle/setToggle/Label.text = "toggle: \"" + Global.heldSprite.toggle + "\""
func _on_opacity_slider_value_changed(value):
$Opacity/opacityLabel.text = "opacity: " + str(int(value * 100)) + "%"
Global.heldSprite.spriteOpacity = value
Global.heldSprite.updateOpacity()
func _on_affect_children_check_toggled(button_pressed):
Global.heldSprite.affectChildrenOpacity = button_pressed
Global.heldSprite.updateOpacity()