Rounded edges?

If you are a new Irrlicht Engine user, and have a newbie-question, this is the forum for you. You may also post general programming questions here.
Post Reply
Mani2010
Posts: 107
Joined: Sat Jan 16, 2010 4:35 pm
Location: London,UK
Contact:

Rounded edges?

Post by Mani2010 »

I am trying to draw rounded edges for my own custom button.

does anyone know how to draw slightly rounded edges for a rectangle/square shape?

I can't post images but i have examples.

examples
- the chrome browser address bar
- the search button beside the search edit box at http://www.youtube.com


this is in 2d btw.
macron12388
Posts: 126
Joined: Wed Sep 29, 2010 8:23 pm

Post by macron12388 »

Um...well...I guess you would just draw the GUI elements...and...give them round edges?!? uh.. I don't know...

So, these are textures you're using for your GUI? Or is it for something else?
Mani2010
Posts: 107
Joined: Sat Jan 16, 2010 4:35 pm
Location: London,UK
Contact:

Post by Mani2010 »

Thanks for the reply.
Um...well...I guess you would just draw the GUI elements...and...give them round edges?!? uh.. I don't know...
Yes but how? What api call? what function? How? I can not see where there is a flag you set.
So, these are textures you're using for your GUI? Or is it for something else?
No textures, i just want to draw a square/rectangle with rounded edges and place some text in the center of it. That way i can have any size button or area with rounded edges.

I could do it by having a background image but that would mean creating a texture for each size of button/area as you lose quality when you stretch a texture to fit all buttons/areas.

Look at my examples to see what i want to do.
vitek
Bug Slayer
Posts: 3919
Joined: Mon Jan 16, 2006 10:52 am
Location: Corvallis, OR

Post by vitek »

You need to use the draw2D*() methods of the IVideoDriver interface to do it. Remember that a curve is a series of lines.

Travis
Mani2010
Posts: 107
Joined: Sat Jan 16, 2010 4:35 pm
Location: London,UK
Contact:

Post by Mani2010 »

ah ok, i will play around with that, thanks
Post Reply