CANVAS:clear_rect

CANVAS:clear_rect(x1, y1, x2, y2)

Make transparent a rectangle defined by the bounding area of x1,y2 to x2,y2.


Parameters:
    x1      The x position of the first corner
    y1      The y position of the first corner
    x2      The x position of the second corner
    y2      The y position of the second corner
                    

-- Fill a canvas with red and poke a transparent hole in the middle of it
function MakeTransparentHole(name)
    local canvas = gre.get_canvas(name)
    local size = canvas:get_dimensions()
    local hole_width = size.width / 3
    local hole_height = size.height / 3

    cavans:fill(0xff0000)
    canvas:clear_rect(hole_width, hole_height, 2*hole_width, 2*hole_height)
end