Pardon the mess, Play My Code is in beta!

READY TO PLAY?
CLICK TO LOG IN!

sign up - lost password

drawEllipse

This is similar to drawCircle, except it allows you to specify a separate width and height for the circle drawn (which makes it become an ellipse).

drawEllipse( x, y, width, height, isCentred=false )

Draws an ellipse at the x/y location given. If 'isCentred' is true, then x/y is the centre of the ellipse. If it is false, then it refers to the top-left corner.

/** Draws lots of ellipses, each inside each other */
onEachFrame() do
    fill( :white )
    setColor( :green )
    
    10.times() do |i|
        drawEllipse( 200, 180, 20 + 20*i, 230 + 2*i, true )
    end
end

drawEllipse( x, y, width, height, xAlign, yAlign )

The same 'drawEllipse' function, but with x and y alignment options. See the article on How Alignment Works for details.

See Also