Warcraft III resources & community, 2003–2006 · archived

RegionAddCircle

not rated
Submitted by PepparVariable Change0 downloads
Similar to RegionAddRect, this function adds a circle to region whichRegion with the specified parameters.

Source

function RegionAddCircle takes region whichRegion, real x, real y, real radius returns nothing
    local real r = 16.00
    local real w = 0
    local rect t = Rect(0, 0, 0, 0)
    loop
        exitwhen r > radius
        set w = Cos(Asin(r / radius)) * radius
        call SetRect(t, x - w, y + r - 16.00, x + w, y + r + 16.00)
        call RegionAddRect(whichRegion, t)
        call SetRect(t, x - w, y - r - 16.00, x + w, y - r + 16.00)
        call RegionAddRect(whichRegion, t)
        set r = r + 32.00
    endloop
    call RemoveRect(t)
    set t = null
endfunction

Comments

0

No comments.