GSDP:GAM100/CProcessing/rectMode()

From Inside
Jump to: navigation, search

rectMode

Description

Lets you set the way rectangles will be drawn. Check ShapeMode for options on which modes you can set. Defaults to 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);
}

Related

Personal tools
Namespaces

Variants
Actions
Navigation
NameSpaces:>
Tools
Dynamic:>