mirror of
https://github.com/tonytins/CozyPixelStudio.git
synced 2025-06-25 05:14:42 -04:00
Fix tiling opacity by drawing currently visible frame to a separate Viewport (#417)
- 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>
This commit is contained in:
parent
bc4d5fa51f
commit
92a22fe9bc
4 changed files with 35 additions and 8 deletions
|
@ -9,6 +9,8 @@ var can_undo := true
|
|||
var cursor_image_has_changed := false
|
||||
var sprite_changed_this_frame := false # for optimization purposes
|
||||
|
||||
onready var currently_visible_frame : Viewport = $CurrentlyVisibleFrame
|
||||
onready var current_frame_drawer = $CurrentlyVisibleFrame/CurrentFrameDrawer
|
||||
onready var grid = $Grid
|
||||
onready var tile_mode = $TileMode
|
||||
onready var indicators = $Indicators
|
||||
|
@ -42,6 +44,8 @@ func _draw() -> void:
|
|||
|
||||
if Global.onion_skinning:
|
||||
onion_skinning()
|
||||
currently_visible_frame.size = Global.current_project.size
|
||||
current_frame_drawer.update()
|
||||
tile_mode.update()
|
||||
draw_set_transform(position, rotation, scale)
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue