GSDP:GAM100/CProcessing/CP Graphics DrawRectAdvanced()

From Inside
Jump to: navigation, search

CP_Graphics_DrawRectAdvanced()

Description

This is a specialized version of the CP_Graphics_DrawRect() 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 CP_POSITION_CENTER CP_Settings_RectMode() will rotate around the center of the rectangle, while the CP_POSITION_CORNER CP_Settings_RectMode() will rotate around the top-left corner.

Parameters

CP_Graphics_DrawRectAdvanced(x, y, w, h, degrees, cornerRadius)

  • 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
  • degrees - (float) the rotation in degrees
  • cornerRadius - (float) the radius of the rounded corners of the rectangle (0 for no rounded corners)

Example

void update() 
{
    // draw a 100x50 rectangle rotated by 45 degrees
    CP_Graphics_DrawRectAdvanced(CP_Input_GetMouseX(), CP_Input_GetMouseY(), 100.0f, 50.0f, 45.0f);
}

Related

Personal tools
Namespaces

Variants
Actions
Navigation
NameSpaces:>
Tools
Dynamic:>