Useful Function
You can make a hexagon with circle math. Just limit the points to 8. https://wiki.multitheftauto.com/wiki/DxDrawCircle -IIYAMA [/quote]
angleAmount 360 / 8 = 45 Just play with it and debug it. It is the only way to understand it... [/quote] Ezt küldte, viszont én akárhogy átírom az angleAmount-ot, nem jön ki hatszög.
angleAmount
Just play with it and debug it. It is the only way to understand it... [/quote] Gondolom 45 fokra állítsd az angleAmountot?
local sx, sy = guiGetScreenSize()local gyok3 = math.sqrt(3)function drawHatszog(kx, ky, w)local x, y = kx-w/2, ky-(w/2*gyok3)local csucsok = {{x, y}, {x+w, y}, {x+w+w/2, y+(w/2*gyok3)}, {x+w, y+(w/2*gyok3)*2}, {x, y+(w/2*gyok3)*2}, {x-w/2, y+(w/2*gyok3)}, {x, y}}for i=1,6 do dxDrawLine(csucsok[1], csucsok[2], csucsok[i+1][1], csucsok[i+1][2], tocolor(255,255,255,255))endendaddEventHandler(\'onClientRender\', root, function()drawHatszog(sx/2, sy/2, 100)end)