2020-04-18 07:03:18 +00:00
|
|
|
extends ColorRect
|
|
|
|
|
2020-04-20 16:12:22 +00:00
|
|
|
|
2020-05-01 17:47:10 +00:00
|
|
|
func _ready() -> void:
|
2020-06-04 20:20:20 +00:00
|
|
|
rect_size = Global.current_project.size
|
2020-06-13 12:33:59 +00:00
|
|
|
if get_parent().get_parent() == Global.main_viewport:
|
|
|
|
Global.second_viewport.get_node("Viewport/TransparentChecker")._ready()
|
|
|
|
Global.small_preview_viewport.get_node("Viewport/TransparentChecker")._ready()
|
2020-04-18 07:03:18 +00:00
|
|
|
material.set_shader_param("size", Global.checker_size)
|
|
|
|
material.set_shader_param("color1", Global.checker_color_1)
|
|
|
|
material.set_shader_param("color2", Global.checker_color_2)
|
2020-08-17 19:30:58 +00:00
|
|
|
material.set_shader_param("follow_movement", Global.checker_follow_movement)
|
|
|
|
material.set_shader_param("follow_scale", Global.checker_follow_scale)
|
|
|
|
|
|
|
|
|
|
|
|
func update_offset(offset : Vector2, scale : Vector2) -> void:
|
|
|
|
material.set_shader_param("offset", offset)
|
|
|
|
material.set_shader_param("scale", scale)
|
|
|
|
|
|
|
|
|
|
|
|
func _on_TransparentChecker_resized():
|
|
|
|
material.set_shader_param("rect_size", rect_size)
|