Szerző Téma: Lekerekített sarkú dxDrawRectangle  (Megtekintve 2477 alkalommal)

Nem elérhető nyomo

  • 159
    • Profil megtekintése
Lekerekített sarkú dxDrawRectangle
« Dátum: 2016. December 19. - 13:25:48 »
0
Hogyan lehet lekerekített sarkokkal rendelkező dxDrawRectangle-t létrehozni vagy formázni? Képet nem akarok használni.

Nem elérhető id100

  • 903
    • Profil megtekintése
Lekerekített sarkú dxDrawRectangle
« Válasz #1 Dátum: 2016. December 19. - 13:34:03 »
+1
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
 
 
« Utoljára szerkesztve: 2016. December 19. - 13:34:47 írta id100 »

Nem elérhető nyomo

  • 159
    • Profil megtekintése
Lekerekített sarkú dxDrawRectangle
« Válasz #2 Dátum: 2016. December 19. - 15:56:38 »
0
Guuut! Danke

Nem elérhető Eduka

  • 214
    • Profil megtekintése
Lekerekített sarkú dxDrawRectangle
« Válasz #3 Dátum: 2016. December 20. - 11:46:27 »
+1

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

 
 

 

SimplePortal 2.3.7 © 2008-2024, SimplePortal