GSDP:GAM100/CProcessing/ShapeMode

From Inside
Jump to: navigation, search

ShapeMode

Description

The enumeration of methods of drawing shapes. Shapes can be drawn using the reference point of the CENTER or the top-left CORNER

Example

void update() 
{
    // set the background color to gray
    background(color(200, 200, 200, 255));

    // set the rectangle drawing mode to CENTER
    rectMode(CENTER);

    // draw a rectangle at the center of the screen, half the size of the screen
    rect(windowWidth / 2.0f, windowHeight / 2.0f, windowWidth / 2.0f, windowHeight / 2.0f);

    // set the rectangle drawing mode to CORNER
    rectMode(CORNER);

    // draw the same rectangle, different mode
    rect(windowWidth / 2.0f, windowHeight / 2.0f, windowWidth / 2.0f, windowHeight / 2.0f);
}

Related

Personal tools
Namespaces

Variants
Actions
Navigation
NameSpaces:>
Tools
Dynamic:>