How to Track the Mouse Position in PyGame! (Python GUI Tutorial)

preview_player
Показать описание
This quick and easy tutorial shows how to track and use the mouse position in your PyGame games and applications. This is very commonly needed in games involving buttons or any type of aiming!

Be sure to check out the channel for a ton of other great python and pygame tutorials! And let me know in the comments if you have questions or what you want to see in a future video!
Рекомендации по теме
Комментарии
Автор

Nice short and to the point, good job as usual :)

rethanon
Автор

amazing video, I can see this video being lengthened to 8 minutes whilst still being quick useful as heck. I honestly wouldn't mind.

theaslam
Автор

Very useful and quick because I was trying to make an
if clicked destroyer game to protect something. Good job

vedhriyer
Автор

hey just wondering is there a way to make the circle stop flickering

mattsimkins
Автор

I'm actually making a fighting game in which the mouse is used for the directional inputs, first, I wonder if there's a way to track the mouse position even if it's not hovering over the screen, in fact, I really want to get the motion of it instead of the position because then it wouldn't be bound by even the size of the monitor, and it would let me set mouse sensitivity to anything I want, instead of what the computer offers, is there any way to track that raw motion?

Nzargnalphabet
Автор

Hello do you know how i can get the position and show the X coordinate and the Y of a sprite? Thanks you very much

FacundoMartinez-sfbq
Автор

Is there any way to get the position x and position y of the mouse position?

ThangHoang-flcg
Автор

i think you should have made short for this

Tech_Brigadier
Автор

i tried this but it doesn't work
pygame.draw.rect(surface, (255, 255, 255), pygame.Rect(mouseposition, 120, 30))

Dyotar
Автор

My computer is 10 years old and the latest python version i can run is 3.4.3 and no modules work when i try to install them. :(

I'm having second thoughts about learning Python now....

undeadpresident