Paint.ellipse
From codeTank
Contents |
Description
paint.ellipse will draw an ellipse in a window. It must be used on a paint object, which is passed to the onpaint event when a window needs to be redrawn.
Arguments
pnt:ellipse(x, y, width, height) pnt:ellipse(x, y, width, height, color) pnt:ellipse(x, y, width, height, color, fill) pnt:ellipse(x, y, width, height, color, fill, thickness)
x, y, width, and height define the properties of the ellipse. Think of these coordinates just like a paint.rectangle rectangle, but instead of a rectangle being drawn, an ellipse is drawn inside the same area.
color is the border color, which can either be a normal color (generated using rgb), or it can be the value false, which means no border will be drawn. If no border color is provided, it will default to black.
fill is the color used to fill the ellipse. If no fill color is provided, then it will default to transparent, and the ellipse will not be filled.
thickness is the thickness (in pixels) of the border. If a border isn't drawn, then this parameter doesn't matter. If it isn't specified, it will default to 0, which means the border will be 1 pixel thick.
Returns
paint.ellipse doesn't return anything.
Example
wnd = window.create{ width = 300, height = 300, onpaint = function(wnd, pnt) -- draw a black border ellipse pnt:ellipse(10, 10, 50, 20) -- draw a solid blue ellipse, without a border pnt:ellipse(10, 90, 50, 20, false, rgb(0, 0, 255)) -- draw a solid red ellipse, with a thick dark green border pnt:ellipse(10, 150, 50, 20, rgb(0, 127, 0), rgb(255, 0, 0), 5) end, } while window.getcount() > 0 do window.pumpmessages() end

