GSDP:GAM100/CProcessing/CP Input MouseDragged()

From Inside
Jump to: navigation, search

CP_Input_MouseDragged()

Description

Returns TRUE if the mouse button is being held while the mouse is also moved. Returns false otherwise.

Parameters

CP_Input_MouseDragged(CP_MOUSE button)

  • button - (CP_MOUSE) The mouse button being checked.

Example

float delta = 0.0f;

void update(void)
{
  if (CP_Input_MouseDragged(MOUSE_BUTTON_LEFT))
  {
    if (CP_Input_GetMouseDeltaX() < 0.0f)
    {
      delta -= 5.0f;
    }
    else
    {
      delta += 5.0f;
    }
  }

  CP_Settings_Background(CP_Color_Create(255, 255, 255, 255));
  CP_Graphics_DrawCircle(CP_System_GetWindowWidth() / 2.0f + delta, (float)CP_System_GetWindowHeight() / 2.0f, 4.0f);
}

Related

Personal tools
Namespaces

Variants
Actions
Navigation
NameSpaces:>
Tools
Dynamic:>