UwUHax/mouse.h
2021-08-27 18:58:23 +07:00

43 lines
767 B
C++
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

#define MAX_DRAG_OBJECTS 3
class cMouse
{
public:
void Update();
bool LeftClick(int x,int y,int w,int h);
bool OneLeftClick(int x,int y,int w,int h);
bool IsOver(int x,int y,int w,int h);
void Drag(bool& bDrag, bool bCheck, bool bDragCheck,int& x, int& y, int& xdif, int& ydif);
void GetMousePosition(int &posx, int &posy)
{
posx = mouse_x;
posy = mouse_y;
}
bool HasMouseOneJustBeenReleased()
{
return mouse1released;
}
bool IsMouseTwoBeingHeld()
{
return mouse2pressed;
}
bool bDragged[MAX_DRAG_OBJECTS];
int iDiffX[MAX_DRAG_OBJECTS];
int iDiffY[MAX_DRAG_OBJECTS];
int mouse_x, mouse_y;
private:
bool mouse1pressed;
bool mouse2pressed;
bool mouse2released;
bool mouse1released;
};
extern cMouse g_Mouse;