GSDP:GAM100/CProcessing/rectRotated()

From Inside
Jump to: navigation, search

rectRotated()

Description

This is a specialized version of the rect() function which additionally allows you to specify a rotation (in degrees). This rotates the rectangle around the reference point at which you draw the rectangle, so the CENTER rectMode() will rotate around the center of the rectangle, while the CORNER rectMode() will rotate around the top-left corner.

Parameters

rectRotated(x, y, w, h, d)

  • x - (float) the horizontal position of the rectangle
  • y - (float) the vertical position of the rectangle
  • w - (float) the width of the rectangle
  • h - (float) the height of the rectangle
  • d - (float) the rotation in degrees

Example

void update() 
{
    // draw a 100x50 rectangle rotated by 45 degrees
    rectRotated(mouseX, mouseY, 100.0f, 50.0f, 45.0f);
}

Related

Personal tools
Namespaces

Variants
Actions
Navigation
NameSpaces:>
Tools
Dynamic:>