mirror of
https://github.com/tonytins/CozyPixelStudio.git
synced 2025-12-19 02:14:42 -05:00
Var transparent mode (#444)
* allowed and enabled per_pixel_transparency * Added a Transparency menu * Added an Alternate screen for transparency * Added transparency methods Added the transparency methods plus modified fullscreen such that it resets transparency on toggling hence, Removing the issue of blackness * Modified the shader to allow transparency * Added a material to ViewportContainer Fixed the bug that darkens image when decreasing opacity * Update Global.gd * Update Main.gd * Update TopMenuContainer.gd
This commit is contained in:
parent
40f6a24fdc
commit
dc469dd4b5
7 changed files with 85 additions and 2 deletions
|
|
@ -26,3 +26,18 @@ func _on_TransparentChecker_resized() -> void:
|
|||
func fit_rect(rect : Rect2) -> void:
|
||||
rect_position = rect.position
|
||||
rect_size = rect.size
|
||||
|
||||
|
||||
func transparency(value :float) -> void:
|
||||
# first make viewport transparent then background and then viewport
|
||||
if value == 1:
|
||||
get_parent().transparent_bg = false
|
||||
get_tree().get_root().set_transparent_background(false)
|
||||
else:
|
||||
OS.window_per_pixel_transparency_enabled = true
|
||||
get_parent().transparent_bg = true
|
||||
get_tree().get_root().set_transparent_background(true)
|
||||
|
||||
# this controls opacity 0 for transparent, 1 or a greater value than 1 is opaque
|
||||
# i have set a minimum amount for the fade (We would'nt want the canvas to dissapear now would we?)
|
||||
material.set("shader_param/alpha",clamp(value,0.1,1))
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue