Change radius of circle dynamically

Hi all,

I need to change the radius of circle object dynamically to create animation effect. It is like the circle appears smaller then becomes bigger and bigger, then again goes back to original size and then again bigger and bigger ans this continuous. Please guide me what could be the best way to achieve this.

Thanks [import]uid: 126619 topic_id: 32191 reply_id: 332191[/import]

Hello,
Best option would be to use a transition and increase the xScale and yScale of the circle object. You would specify these as a ratio of the original size… 2.0 would double the size of the circle by transition end, 0.5 would halve it.

http://docs.coronalabs.com/api/library/transition/to.html

For the repeated pulsating effect, you’ll need to use onComplete listeners to trigger the “back to normal” transition, then when that completes, you restart the “enlarge” transition, etc.

Brent
[import]uid: 9747 topic_id: 32191 reply_id: 128243[/import]

Hello,
Best option would be to use a transition and increase the xScale and yScale of the circle object. You would specify these as a ratio of the original size… 2.0 would double the size of the circle by transition end, 0.5 would halve it.

http://docs.coronalabs.com/api/library/transition/to.html

For the repeated pulsating effect, you’ll need to use onComplete listeners to trigger the “back to normal” transition, then when that completes, you restart the “enlarge” transition, etc.

Brent
[import]uid: 9747 topic_id: 32191 reply_id: 128243[/import]