Drawing rounded rectangles with ISurface.

Posts 1–6 of 6 · Page 1 of 1
Drawing rounded rectangles with ISurface.
Hello, is there any way to draw rounded rectangles in ISurface? I have tried to make my own rounded rectangles, but I gave up at corners, cause drawin them pixel by pixel is a little bit annoying >.> Anyone got any idea?
Could you please post an pic of how it looks like rn?
Quote Originally Posted by An0m4ly_15 View Post
Could you please post an pic of how it looks like rn?
Yeah, of course.
Right now it looks like that:
imgur . com/6nLZPE5.png - remove spaces, i'm not allowed to post links lol
I need to draw 5 pixels in each corner, but I have problems with the math XD I drawed also white background to make it more visible :P

I want to get somehing like that:
i . gyazo . com/e05f16a76bcc80b4765267ee54877c78.png - remove spaces too -_-
It's so great I wanted to re-create this (or ******* GUI) to make a menu for my hack.

Is it even possible? Author of that ******* GUI remake said, he made it in Surface.
Code:
std::vector< Vertex_t > p;
	for( int _i = 0; _i < 3; _i++ )
	{
		int _x = x + ( _i < 2 && r || w - r );
		int _y = y + ( _i % 3 > 0 && r || h - r );
		for( int i = 0; i < v; i++ )
		{
			int a = RAD2DEG( ( i / v ) * -90 - _i * 90 );
			p.push_back( Vertex_t( Vector2D( _x + sin( a ) * r, _y + cos( a ) * r ) ) );
		}
	}

D::DrawPolygon( 4 * ( v + 1 ), &p[ 0 ], col );
pasted
Quote Originally Posted by certmemer View Post
Code:
std::vector< Vertex_t > p;
	for( int _i = 0; _i < 3; _i++ )
	{
		int _x = x + ( _i < 2 && r || w - r );
		int _y = y + ( _i % 3 > 0 && r || h - r );
		for( int i = 0; i < v; i++ )
		{
			int a = RAD2DEG( ( i / v ) * -90 - _i * 90 );
			p.push_back( Vertex_t( Vector2D( _x + sin( a ) * r, _y + cos( a ) * r ) ) );
		}
	}

D::DrawPolygon( 4 * ( v + 1 ), &p[ 0 ], col );
pasted
What arguments DrawPolygon takes? I need to create this function lol
Quote Originally Posted by mimikus1234 View Post
What arguments DrawPolygon takes? I need to create this function lol
Here you go bro
a simple google search would of found your answer but i like helping.
void DrawPolygon(int count, Vertex_t* Vertexs, Color color);
Posts 1–6 of 6 · Page 1 of 1

Post a Reply

Similar Threads

Tags for this Thread

None

Talk with us