Jump to content

Can Anyone fix this for me ?


coNolel

Recommended Posts

hey guys , 

unforttunetly , i did a function " round rectangle " like xiti's one,  but i used 2 semi circles , it looks good but bettween each semi sircle and the rectangle there is an empty space i think it's 1 px 

can some one fix it for me ? :)

function dxDrawRoundedRectangle( x, y, width, height, color, postGUI )
	local circlewidth = 12
	local color = color or tocolor( 0, 0, 0, 150)


	dxGetTextWidth ( text, 1, font, true )
	dxDrawImage(x, y, circlewidth, height, "img/semi2.png", 0, 0, 0, color, false)
    dxDrawRectangle(x+circlewidth, y, width, height, color, postGUI)
    dxDrawImage(x+circlewidth+width, y, circlewidth, height, "img/semi.png", 0, 0, 0, color, false)

end

 

Link to comment

Your function is a bit weard, I'm not sure if semi1 is the left or right one, anyways I left u a comment respecting it.

Also, there are some unnecessary things like Circle Width and dxGetTextWidth is not defined as a varaible, so, u can use it like that

function dxDrawRoundedRectangle( x, y, width, height, color, postGUI )
	local color = color or tocolor( 0, 0, 0, 150)
    dxDrawRectangle(x, y, width, height, color, postGUI)
	--Semi 1 Circle must be the LEFT one and Semi 2 Circle must be the RIGHT one
    dxDrawImage(x-height, y, height/2, height, "img/semi.png", 0, 0, 0, color, false)
	dxDrawImage(x+width, y, height/2, height, "img/semi2.png", 0, 0, 0, color, false)
end

NOT TESTED.

PS: I would use dxDrawImageSection using just a circle :D

Edited by Overkillz
  • Like 1
Link to comment

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...