Difference between revisions of "GSDP:GAM100/CProcessing/CP Vector Zero()"
From Inside
< GSDP:GAM100 | CProcessing
>Dow.zabolio (New page: {{GSDP:GAM100API.css}} =CP_Vector_Zero()= ==Description== Create a CP_Vector zero vector (both x and y set to zero). ==Example== <syntaxhighlight lang='c'> CP_Vector default_v; CP_Vector ...) |
(No difference)
|
Latest revision as of 18:51, 4 October 2020
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);
}