mirror of
https://github.com/Orama-Interactive/Pixelorama.git
synced 2025-02-01 16:09:49 +00:00
92a22fe9bc
- Now the current frame is drawn to a separate Viewport (with transparent background) taking into account only per layer opacity, - Tiling is drawn by drawing current frame's ViewportTexture with tile mode opacity applied (using premultiply alpha blending). Co-authored-by: kleonc <kleonc@users.noreply.github.com>
10 lines
416 B
GDScript
10 lines
416 B
GDScript
extends Node2D
|
|
|
|
|
|
func _draw() -> void:
|
|
var current_cels : Array = Global.current_project.frames[Global.current_project.current_frame].cels
|
|
for i in range(Global.current_project.layers.size()):
|
|
if Global.current_project.layers[i].visible and current_cels[i].opacity > 0:
|
|
var modulate_color := Color(1, 1, 1, current_cels[i].opacity)
|
|
draw_texture(current_cels[i].image_texture, Vector2.ZERO, modulate_color)
|