I am trying to make my background image move in the opposite direction as the mouse is moving when it is clicked. So it looks like you are dragging the screen left and right, like you can see in many mobile apps. Does anyone have a simple way of doing this?
Share
What you need is to detect the event type, such as
MOUSEBUTTONDOWN, MOUSEBUTTONUP, MOUSEMOTION.When you detected a mouse motion, check if it’s clicked using the
event.buttonsattribute.Here’s my implement:
You may need to read: Pygame event document