Rounded rectangle with different corner radius for each corner?

Hi there,

Does anyone know if there’s a way to set the corner radius of each corner on a rounded rectangle to be different?

I want to create a “tab” type button with the top 2 corners rounded and the bottom 2 square.

I know I can use images / 9 slice image if necessary but I’d prefer to use rounded rectangles if possible for a variety of reasons.

Thanks,

Ian

Don’t think the API supports it… But if you want to make something up that would visually do it, one way is to create a rounded and a regular rect (regular rect on top). For the regular rect, you can give it a fill gradient (rounded rects don’t support fill gradient, so the regular has to be on top).

For the gradient of the regular rect, set it to whatever color you want, but set the alpha portion to change from 0 --> 255… This will make the regular rect completely transparent at one end (allowing rounded corners to be visible), and completely opaque at the other (covering the rounded edges there)… You *might* notice a couple pixels of almost zero alpha peeking out over the rounded corners, but probably not much…

Have been paying with the fill gradients, so just thought I’d throw that out there…

Nice idea - like it.

Thanks! I’ll go with that I think as long as it looks convincing, which I’m sure it will.

Cheers,

Ian

Don’t think the API supports it… But if you want to make something up that would visually do it, one way is to create a rounded and a regular rect (regular rect on top). For the regular rect, you can give it a fill gradient (rounded rects don’t support fill gradient, so the regular has to be on top).

For the gradient of the regular rect, set it to whatever color you want, but set the alpha portion to change from 0 --> 255… This will make the regular rect completely transparent at one end (allowing rounded corners to be visible), and completely opaque at the other (covering the rounded edges there)… You *might* notice a couple pixels of almost zero alpha peeking out over the rounded corners, but probably not much…

Have been paying with the fill gradients, so just thought I’d throw that out there…

Nice idea - like it.

Thanks! I’ll go with that I think as long as it looks convincing, which I’m sure it will.

Cheers,

Ian