# How to make expanding ring with constant thickness?

I need to generate this burst or (donut-shaped) pulse.
I'm having a difficult time how to generate such shape.
At first, I was thinking of scaling the image but that didnt work out because the line or "diameter" of the donut shape gets bigger accordingly..

• This is simply a circle of radius R with a circle of radius R - C removed from its center. R = Outer Radius, C = Ring Thickness. – MickLH Apr 28 '16 at 18:35

This code is adapted from a game demo in 'Cocos2d-x by Example Beginner's Guide' by Roger Engelbert.

circleSprite->setScale(0.1f);
circleSprite->runAction(ScaleTo::create(1.0f, 5.0f));


First it makes the sprite tiny (0.1f) and then runs an action to scale it up over 1.0 second (I have used an arbitrary scale to value of 5.0f for this example).

The circle sprite is just an image of a thick circle outline with the middle and outside transparent.

HTH

• Did you read the question thoroughly? It specifically says that "At first, I was thinking of scaling the image but that didnt work out because the line or "diameter" of the donut shape gets bigger accordingly.." – Kromster says support Monica May 23 '16 at 4:55