class OptionLabel : ActionRole { @Attribute var showInSeconds = 0f var action : Action override fun activated() { super.activated() actor.scaleXY = 0.1 } override fun createAction() : Action { actor.x -= actor.stage.firstView().worldWidth /2 val duration = 0.5 val animation = MoveBy( actor.position, duration, Vector2(actor.stage.firstView().worldWidth/2, 0), Eases.easeOut ) and ScaleTo( actor, duration, 1.0 ) return Delay( showInSeconds ) then animation } }