Master_MTA Posted September 30, 2018 Share Posted September 30, 2018 this function about drawing rounded rectangle it's have 100% work correctly (i hope that ) so there is function to draw rounded rectangle with dxDrawCircle but it's not work correctly when u but the postgui value to true and change it's color so there my source code enjoy function dxDrawRoundedRectangle(x,y,width,height,raduis,color,postgui) dxDrawRectangle(x,y+raduis,width+1,height-(raduis*2),color,postgui)--horezantal rectangle dxDrawRectangle(x+raduis,y,width-(raduis*2),height+1,color,postgui)--vertical rectangle for k=180,270 do--left top local co=math.cos(math.rad(k))* raduis local si=math.sin(math.rad(k))* raduis dxDrawLine((x+raduis)+co,(y+raduis)+si,x+raduis,y+raduis,color,1,postgui) end for k=270,360 do--right top local co=math.cos(math.rad(k))* raduis local si=math.sin(math.rad(k))* raduis dxDrawLine((x+width-raduis)+co,(y+raduis)+si,x+width-raduis,y+raduis,color,1,postgui) end for k=90,180 do--left bottom local co=math.cos(math.rad(k))* raduis local si=math.sin(math.rad(k))* raduis dxDrawLine((x+raduis)+co,(y+height-raduis)+si,x+raduis,y+height-raduis,color,1,postgui) end local k=360 while(k<=(360+90))do if k~= 360 then local co=math.cos(math.rad(k))* raduis local si=math.sin(math.rad(k))* raduis dxDrawLine((x-raduis+width)+co,(y+height-raduis)+si,x+width-raduis,y+height-raduis,color,1,postgui) end k=k+1; end end i think there is no need to explain the arguments enjoy 1 1 Link to comment
iMr.WiFi..! Posted September 30, 2018 Share Posted September 30, 2018 Thanks for your function, but there more useful function that doesn't use any loops. Link to comment
Master_MTA Posted September 30, 2018 Author Share Posted September 30, 2018 11 minutes ago, iMr.WiFi..! said: that doesn't use any loops. it's only 90 line not a big deal & also the function that u shared need to add shader file to ur resource but this doesn't any way it's up to user to use any of them thx for ur replay Link to comment
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now