mirror of
https://github.com/tonytins/CozyPixelStudio.git
synced 2025-05-05 16:34:48 -04:00
- 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>
9 lines
416 B
GDScript
9 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)
|