extends Node2D class_name ItemObjectSprite @onready var icon_sprite = $Icon const PARTICLES_SCENE : PackedScene = preload("res://common/vfx/particles/particles.tscn") func apply_texture_to_sprite(texture, item_sprite_size = 50.): if texture: icon_sprite.texture = texture icon_sprite.scale = Vector2( 1./(texture.get_width()/item_sprite_size), 1./(texture.get_height()/item_sprite_size) ) func generate_particles(particles_params : Array[Particles.Parameters]): for c in get_children(): if c is Particles: queue_free() for params in particles_params: var particles_emitter : Particles = PARTICLES_SCENE.instantiate() as Particles particles_emitter.setup_particles(params) add_child(particles_emitter) func pickup_animation(): %AnimationPlayer.play("pickup")