GSDP:GAM100/CProcessing/ellipse()

From Inside
Jump to: navigation, search

ellipse()

Description

Ellipse allows you to draw an ellipse with differing width and height. To draw an ellipse, provide the x and y values of a point and the width and height (diameters) of your ellipse. You can set the fill color of the drawn shape with fill() and the stroke color with stroke() . The method for drawing ellipses can be changed to different modes using ellipseMode() .

Parameters

  • x - (float) the horizontal coordinate of the ellipse
  • y - (float) the vertical coordinate of the ellipse
  • w - (float) the width of the ellipse as a diameter
  • h - (float) the height of the ellipse as a diameter

Example

void update() 
{
    // Set the background color to red
    background(color(255, 100, 100, 255));

    // Draw an ellipse at the point (100, 100)
    ellipse(100.0f, 100.0f, 50.0f, 80.0f);

    // Draw an ellipse at the mouse position
    ellipse(mouseX, mouseY, 20.0f, 60.0f);
}

Related

Personal tools
Namespaces

Variants
Actions
Navigation
NameSpaces:>
Tools
Dynamic:>