mlpcardgame/Scenes/Loading/ScatterCard.gd
2019-06-01 17:38:26 +02:00

12 lines
No EOL
370 B
GDScript

extends Sprite
class_name ScatterCard
func tweenTo(targetPos: Vector2, targetRot: float, duration: float = 1.0):
$Tween.interpolate_property(self, "position",
position, targetPos, duration,
Tween.TRANS_CUBIC, Tween.EASE_IN_OUT)
$Tween.interpolate_property(self, "rotation",
rotation, targetRot, duration,
Tween.TRANS_CUBIC, Tween.EASE_IN_OUT)
$Tween.start()