GSDP:GAM100/CProcessing/CP Graphics DrawEllipse()

From Inside
Jump to: navigation, search

CP_Graphics_DrawEllipse()

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 CP_Settings_Fill() and the stroke color with CP_Settings_Stroke(). The method for drawing ellipses can be changed to different modes using CP_Settings_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
    CP_Settings_Background(CP_Color_Create(255, 100, 100, 255));

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

    // Draw an ellipse at the mouse position
    CP_Graphics_DrawEllipse(CP_Input_GetMouseX(), CP_Input_GetMouseY(), 20.0f, 60.0f);
}

Related

Personal tools
Namespaces

Variants
Actions
Navigation
NameSpaces:>
Tools
Dynamic:>