Graphics pass
This commit is contained in:
parent
51af0ea751
commit
fb47693a99
42 changed files with 821 additions and 95 deletions
24
components/scripts/drop_shadow_component.gd
Normal file
24
components/scripts/drop_shadow_component.gd
Normal file
|
|
@ -0,0 +1,24 @@
|
|||
extends Node2D
|
||||
|
||||
@export var parent_sprite : Sprite2D = null
|
||||
@export var drop_shadow_distance : int = 10
|
||||
|
||||
var drop_shadow_sprite = null
|
||||
|
||||
func _ready():
|
||||
if parent_sprite is Sprite2D:
|
||||
drop_shadow()
|
||||
pass
|
||||
|
||||
func drop_shadow():
|
||||
drop_shadow_sprite = parent_sprite.duplicate()
|
||||
|
||||
drop_shadow_sprite.scale = Vector2(1.1, 1.1)
|
||||
|
||||
drop_shadow_sprite.set_modulate(Color(0, 0, 0, 0.1))
|
||||
|
||||
drop_shadow_sprite.set_position(Vector2(drop_shadow_distance, drop_shadow_distance))
|
||||
#drop_shadow_sprite.global_position = parent_sprite.global_position + Vector2(drop_shadow_distance, drop_shadow_distance)
|
||||
drop_shadow_sprite.show_behind_parent = true
|
||||
|
||||
parent_sprite.add_child.call_deferred(drop_shadow_sprite)
|
||||
Loading…
Add table
Add a link
Reference in a new issue