Gellin
04-23-2008, 03:59 AM
I was bored and i wanted to make some buttons that had rounded edges so here goes.
i probably over did the entire thing and could've done it 1000 times easier but i don't know how :(
void DrawRoundedButtonz(IDirect3DDevice8* dev, int x, int y, int w, int h, DWORD color)
{
DrawRect(dev, x, y , w, 1, color);
DrawRect(dev, x - 6, y + 6, 1, h - 13, color);
DrawRect(dev, x - 2, y + 1 , 2, 1, color);
DrawRect(dev, x - 3, y + 2 , 1, 1, color);
DrawRect(dev, x - 4, y + 3 , 1, 1, color);
DrawRect(dev, x - 5, y + 4 , 1, 1, color);
DrawRect(dev, x - 5, y + 5 , 1, 1, color);
DrawRect(dev, x, y + h, w, 1, color);
DrawRect(dev, x + w + 5, y + h + - 13, 1, 5, color);
DrawRect(dev, x + w, y + 1, 2, 1, color);
DrawRect(dev, x + w + 2, y + 2, 1, 1, color);
DrawRect(dev, x + w + 3, y + 3, 1, 1, color);
DrawRect(dev, x + w + 4, y + 4, 1, 2, color);
DrawRect(dev, x - 2, y + 18, 2, 1, color);
DrawRect(dev, x - 3, y + 17, 1, 1, color);
DrawRect(dev, x - 4, y + 16, 1, 1, color);
DrawRect(dev, x - 5, y + 14, 1, 2, color);
DrawRect(dev, x - 6, y + 12, 1, 2, color);
DrawRect(dev, x + w, y + 18, 2, 1, color);
DrawRect(dev, x + w + 2, y + 17, 1, 1, color);
DrawRect(dev, x + w + 3, y + 16, 1, 1, color);
DrawRect(dev, x + w + 4, y + 14, 1, 2, color);
DrawRect(dev, x + w + 5, y + 11, 1, 3, color);
}
To Draw
DrawRoundedButtonz(m_pD3Ddev, 500, 400, 68, 19, D3DCOLOR_ARGB( 255, 0, 255, 0));
Please do not change the size unless u are going to edit everything else....
The Result is: http://img99.imageshack.us/img99/8490/roundedbuttonzkj5.jpg
http://img99.imageshack.us/img99/8490/roundedbuttonzkj5.jpg
Credits :
who ever made the draw rect
Cobra
Massacre
Ghouster
Kriss
Konvict - one of meh hero's
Micro - my papa
-CD- He is Mr SEE DEE
Ms Paint - " used to count pixels"
i might start a D3D tut of the week or something getting more advanced every week :p
i probably over did the entire thing and could've done it 1000 times easier but i don't know how :(
void DrawRoundedButtonz(IDirect3DDevice8* dev, int x, int y, int w, int h, DWORD color)
{
DrawRect(dev, x, y , w, 1, color);
DrawRect(dev, x - 6, y + 6, 1, h - 13, color);
DrawRect(dev, x - 2, y + 1 , 2, 1, color);
DrawRect(dev, x - 3, y + 2 , 1, 1, color);
DrawRect(dev, x - 4, y + 3 , 1, 1, color);
DrawRect(dev, x - 5, y + 4 , 1, 1, color);
DrawRect(dev, x - 5, y + 5 , 1, 1, color);
DrawRect(dev, x, y + h, w, 1, color);
DrawRect(dev, x + w + 5, y + h + - 13, 1, 5, color);
DrawRect(dev, x + w, y + 1, 2, 1, color);
DrawRect(dev, x + w + 2, y + 2, 1, 1, color);
DrawRect(dev, x + w + 3, y + 3, 1, 1, color);
DrawRect(dev, x + w + 4, y + 4, 1, 2, color);
DrawRect(dev, x - 2, y + 18, 2, 1, color);
DrawRect(dev, x - 3, y + 17, 1, 1, color);
DrawRect(dev, x - 4, y + 16, 1, 1, color);
DrawRect(dev, x - 5, y + 14, 1, 2, color);
DrawRect(dev, x - 6, y + 12, 1, 2, color);
DrawRect(dev, x + w, y + 18, 2, 1, color);
DrawRect(dev, x + w + 2, y + 17, 1, 1, color);
DrawRect(dev, x + w + 3, y + 16, 1, 1, color);
DrawRect(dev, x + w + 4, y + 14, 1, 2, color);
DrawRect(dev, x + w + 5, y + 11, 1, 3, color);
}
To Draw
DrawRoundedButtonz(m_pD3Ddev, 500, 400, 68, 19, D3DCOLOR_ARGB( 255, 0, 255, 0));
Please do not change the size unless u are going to edit everything else....
The Result is: http://img99.imageshack.us/img99/8490/roundedbuttonzkj5.jpg
http://img99.imageshack.us/img99/8490/roundedbuttonzkj5.jpg
Credits :
who ever made the draw rect
Cobra
Massacre
Ghouster
Kriss
Konvict - one of meh hero's
Micro - my papa
-CD- He is Mr SEE DEE
Ms Paint - " used to count pixels"
i might start a D3D tut of the week or something getting more advanced every week :p