Урок как сделать круглые края

Image

Описание

dxDrawRoundedRectangle = function (x, y, rx, ry, color, radius)
    rx = rx - radius * 2
    ry = ry - radius * 2
    x = x + radius
    y = y + radius


    if (rx >= 0) and (ry >= 0) then
        dxDrawRectangle(x, y, rx, ry, color)
        dxDrawRectangle(x, y - radius - 1, rx, radius+1, color)
        dxDrawRectangle(x, y + ry, rx, radius, color)
        dxDrawRectangle(x - radius, y - 1, radius, ry+1, color)
        dxDrawRectangle(x + rx, y-1, radius, ry+1, color)


        dxDrawCircle(x, y-1, radius, 180, 270, color, color, 64)
        dxDrawCircle(x + rx, y - 1, radius, 270, 360, color, color, 64)
        dxDrawCircle(x + rx, y + ry, radius, 0, 90, color, color, 64)
        dxDrawCircle(x, y + ry, radius, 90, 180, color, color, 64)
    end
end

Вывод - dxDrawRoundedRectangle(screenW, screenH, Размер, Размер, цвет, радиус)