GSDP:GAM100/CProcessing/CP Image DrawAdvanced()

From Inside
Jump to: navigation, search

CP_Image_DrawAdvanced()

Description

Draws a given CP_Image to the screen using the given position, size, alpha, and rotation

Function Definition

void CP_Image_DrawAdvanced(CP_Image image, float x, float y, float w, float h, int alpha, float degrees);

Parameters

  • image- (CP_Image) The image that you want to draw to the screen
  • x- (float) The x coordinate of the image in screen coordinates
  • y- (float) The y coordinate of the image in screen coordinates
  • w- (float) The width to draw the image in pixels
  • h- (float) The height to draw the image in pixels
  • alpha- (int) The alpha value to draw the image with (0-255)
  • degrees- (float) The degrees to rotate the image

Return

  • void- This function does not return anything

Example

CP_Image justinFace = NULL;

void init()
{
  justinFace = CP_Image_Load("./Assets/Justins_face.png");
}

void update()
{
  CP_Settings_Background(CP_Color_Create(255, 255, 255, 255));
 
  int width = CP_System_GetWindowWidth();
  int height = CP_System_GetWindowHeight();

  CP_Image_DrawAdvanced(justinFace, width / 2, height / 2, width / 2, width / 2, 255, 180);
}

void shutdown()
{
  CP_Image_Free(justinFace);
}

Related

Personal tools
Namespaces

Variants
Actions
Navigation
NameSpaces:>
Tools
Dynamic:>