1
0
Fork 0
mirror of https://github.com/Orama-Interactive/Pixelorama.git synced 2025-01-31 15:39:49 +00:00

Transparent canvas now works properly with scaled UI

This commit is contained in:
Manolis Papadeas 2022-03-18 01:05:41 +02:00
parent dbc8873d17
commit 9128b455e6

View file

@ -18,6 +18,9 @@ func _on_main_canvas_visibility_changed() -> void:
func update_transparent_shader() -> void: func update_transparent_shader() -> void:
# Works independently of the transparency feature # Works independently of the transparency feature
var canvas_size: Vector2 = (main_canvas_container.rect_size - Vector2.DOWN * 2) * Global.shrink
material.set("shader_param/screen_resolution", get_viewport().size) material.set("shader_param/screen_resolution", get_viewport().size)
material.set("shader_param/position", main_canvas_container.rect_global_position) material.set(
material.set("shader_param/size", main_canvas_container.rect_size - Vector2.ONE * 2) "shader_param/position", main_canvas_container.rect_global_position * Global.shrink
)
material.set("shader_param/size", canvas_size)