Hi Im using a small semi transparent ColorLayer to display a HUD. Is there a way to make the corners rounded? Thanks!
rounded corners on ColorLayer?
(12 posts) (9 voices)-
Posted 2 years ago #
-
I'm about to attempt this myself. Maybe a PNG overlay with a transparent section in the middle to mask the ColorLayer?
Good luck,
Adem
Posted 2 years ago # -
Is clipping a possibilty in OpenGL? we can probably overide the
-(void)drawmethod of the layer and use something like glScissor or something?~ Natanavra.
Posted 2 years ago # -
Thanks for the responses. I ended up just using a PNG as the background with rounded corners and the edges transparent. I then set the opacity to be semi transparent. I ended up getting the same effect I wanted without much effort.
Posted 2 years ago # -
I have extended the ColorLayer class so that it shows a rectangle with rounded corners. I also added the ability to draw/not draw a border using a different color.
Let me know if you are still interested.Posted 2 years ago # -
Hi urubu
I'm interested in ColorLayer class, could you please post it here or email to me? tianlangxing@gmail.com
Thanks!
Posted 2 years ago # -
Sorry to resurrect this thread, I've just been trying to find a solution to this issue as well. Can anybody lend a hand?
Posted 1 year ago # -
You can use the PNG workarround or create your own RoundedBorderColorLayer by overriding the draw method.
By using a PNG you'll be using less CPU but more memory. That's your choice :)Posted 1 year ago # -
Do you know of any resources that would help me get started on how to do the drawing? I've looked before and haven't really found anything good, but I'm likely not searching for the right thing. I know how do do it with CoreGraphics, but this seems very different.
Posted 1 year ago # -
You can also use a CALayer and render it to a sprite in about 10 lines of code.
Posted 2 weeks ago #
Reply
You must log in to post.