extends CenterContainer

const COLOR_TRANSPARENT = Color(1.0, 1.0, 1.0, 0.0)

var selected = false setget set_selected

onready var tween = $Tween

func set_selected(value):
	selected = value
	if selected:
		tween.interpolate_property($ItemTextureRect, "rect_position", Vector2(0, 0), Vector2(0, -5), 0.2, Tween.TRANS_QUAD, Tween.EASE_IN)
		tween.start()
	else:
		tween.stop_all()
		$ItemTextureRect.rect_position = Vector2.ZERO
	#$ItemTextureRect.rect_position.y = int(value) * 2

func vanish():
	tween.interpolate_property(self, "modulate", Color.white, COLOR_TRANSPARENT, 0.2, Tween.TRANS_QUART, Tween.EASE_OUT)
	tween.interpolate_property(self, "rect_position", Vector2(0, 0), Vector2(0, -5), 0.2, Tween.TRANS_QUAD, Tween.EASE_IN)
	tween.start()
