Using The Mouse In Pygame - Beginner Tutorial

Published: 05 February 2023
on channel: Coding With Russ
18,502
435

In this video I will explain how to get mouse inputs from the player in pygame.

I'll show the two methods for doing this, which are the event handler as well as using the mouse.get_clicked() function to check the state of the mouse buttons. I'll show examples of each method and discuss the pros and cons.
Additionally I'll explain how to work out the mouse coordinates on the screen using the mouse.get_pos() function.

Take a look at the tutorial on my website for a reference on working with mouse input here: http://www.codingwithruss.com/pygame/...

Credit for thumbnail mouse image: https://www.vexels.com/vectors/previe...


Watch video Using The Mouse In Pygame - Beginner Tutorial online, duration hours minute second in high quality that is uploaded to the channel Coding With Russ 05 February 2023. Share the link to the video on social media so that your subscribers and friends will also watch this video. This video clip has been viewed 18,502 times and liked it 435 visitors.