mirror of
https://github.com/Orama-Interactive/Pixelorama.git
synced 2025-02-23 05:53:14 +00:00
This is both an optimization and it restores live changes of the canvas preview when the user is drawing, without any extra performance cost, since the material is the same. The only case when the canvas preview is using a different material is when its animation preview is being played, so it can show a different frame than the main canvas.
18 lines
692 B
Text
18 lines
692 B
Text
[gd_scene load_steps=4 format=3 uid="uid://c546tskdu53j1"]
|
|
|
|
[ext_resource type="Script" path="res://src/UI/Canvas/CanvasPreview.gd" id="1"]
|
|
[ext_resource type="Shader" path="res://src/Shaders/BlendLayers.gdshader" id="1_28j41"]
|
|
|
|
[sub_resource type="ShaderMaterial" id="ShaderMaterial_21d5l"]
|
|
shader = ExtResource("1_28j41")
|
|
shader_parameter/opacities = null
|
|
shader_parameter/blend_modes = null
|
|
shader_parameter/origins = null
|
|
|
|
[node name="CanvasPreview" type="Node2D"]
|
|
material = SubResource("ShaderMaterial_21d5l")
|
|
script = ExtResource("1")
|
|
|
|
[node name="AnimationTimer" type="Timer" parent="."]
|
|
|
|
[connection signal="timeout" from="AnimationTimer" to="." method="_on_AnimationTimer_timeout"]
|