CANVAS:set line width

CANVAS:set_line_width(value)

Set the line width in pixels that all subsequent stroke operations should use. The default value for line width is 1.

Parameters: value An integer value greater than 1 indicating the pixel width.

-- Draw three colored outlines width different widths across the canvas
function StrokeRGB(name)
    local canvas = gre.get_canvas(name)
    local size = canvas:get_dimensions()
    local rw = size.width / 3
    canvas:set_line_width(5)
    canvas:stroke_rect(0,    0, rw-1,   size.height, 0xff0000)
    canvas:set_line_width(3)
    canvas:stroke_rect(rw,   0, 2*rw-1, size.height, 0x00ff00)
    canvas:set_line_width(1)
    canvas:stroke_rect(2*rw, 0, 3*rw-1, size.height, 0x0000ff)
end
Was this article helpful?
0 out of 0 found this helpful
Have more questions? Submit a request

Comments

0 comments

Article is closed for comments.