GTA Közösség - A magyar GTA fórum

Multi Theft Auto (MTA) => MTA: Szerverfejlesztés => Segítségkérés => A témát indította: nyomo - 2016. December 19. - 13:25:48

Cím: Lekerekített sarkú dxDrawRectangle
Írta: nyomo - 2016. December 19. - 13:25:48
Hogyan lehet lekerekített sarkokkal rendelkező dxDrawRectangle-t létrehozni vagy formázni? Képet nem akarok használni.
Cím: Lekerekített sarkú dxDrawRectangle
Írta: id100 - 2016. December 19. - 13:34:03
1. Nézz bele a chatbubbles resourceba, 
 
2. tudtommal van wikin is egy roundedrectangle funkció,
 
3. illetve a fórumjaikon is van róla egy téma (lehet van benne megoldás): https://forum.mtasa.com/topic/63551-helprounded-rectangle/
 
 
 
Githubon is találtam neked: https://github.com/Pioruniasty/MTA_rounded_rectangle
 
 
Cím: Lekerekített sarkú dxDrawRectangle
Írta: nyomo - 2016. December 19. - 15:56:38
Guuut! Danke
Cím: Lekerekített sarkú dxDrawRectangle
Írta: Eduka - 2016. December 20. - 11:46:27

function roundedRectangle(x, y, w, h, borderColor, bgColor, postGUI)
if (x and y and w and h) then
   if (not borderColor) then
      borderColor = tocolor(0, 0, 0, 200);
   end
   
   if (not bgColor) then
      bgColor = borderColor;
   end
   
   --> Background
   dxDrawRectangle(x, y, w, h, bgColor, postGUI);
   
   --> Border
   dxDrawRectangle(x + 2, y - 1, w - 4, 1, borderColor, postGUI); -- top
   dxDrawRectangle(x + 2, y + h, w - 4, 1, borderColor, postGUI); -- bottom
   dxDrawRectangle(x - 1, y + 2, 1, h - 4, borderColor, postGUI); -- left
   dxDrawRectangle(x + w, y + 2, 1, h - 4, borderColor, postGUI); -- right
end
end