1
0
Fork 0
mirror of https://github.com/Orama-Interactive/Pixelorama.git synced 2025-03-16 00:05:18 +00:00
Pixelorama/src/UI/Canvas/Previews.gd
Emmanouil Papadeas fbe2952346 Make shape previews look like they did in v1.0
The AutoInvertColors shader has been updated to make shapes hollow, similar to how the marching ants outline works.
2024-08-04 22:12:57 +03:00

19 lines
378 B
GDScript

extends Node2D
func _ready() -> void:
Global.camera.zoom_changed.connect(_update_on_zoom)
func _input(event: InputEvent) -> void:
if event is InputEventMouse or event is InputEventKey:
queue_redraw()
func _draw() -> void:
if Global.can_draw:
Tools.draw_preview()
func _update_on_zoom() -> void:
material.set_shader_parameter("width", 1.0 / Global.camera.zoom.x)