Please Login First
×
Create a new article
Write your page title here:
We currently have 441 articles on Inside. Type your article name above or click on one of the titles below and start writing!



    Inside

    GSDP:GAM100/CProcessing/CP Vector Zero()

    CP_Vector_Zero()

    Description

    Create a CP_Vector zero vector (both x and y set to zero).

    Example

    CP_Vector default_v;
    CP_Vector zero_v;
    
    void init()
    {
      CP_Font_Set(CP_Font_GetDefault());
      CP_Settings_Fill(CP_Color_Create(0, 0, 0, 255));
    
      zero_v = CP_Vector_Zero();
    }
    
    void update()
    {
      CP_Settings_Background(CP_Color_Create(255, 255, 255, 255));
    
      // Print out the zero vector
      CP_Font_DrawText("Zero: ", 0, 150);
      sprintf_s(matrix, 128, "[%.0f]\n[%.0f]\n",
        zero_v.x, zero_v.y);
      CP_Font_DrawTextBox(matrix, 175, 150, 200);
    }
    

    Related