How To Drag And Drop Items In Pygame

preview_player
Показать описание
In this video I will explain how to drag and drop items in pygame.

I'll show how to use the event handler to select a box and move it around with the mouse.

Рекомендации по теме
Комментарии
Автор

Excellent example -- short, to the point, very clear.

davecolburn
Автор

Hey sorry I'm late! I'm glad I could find your tutorial because it's actually exactly what I am looking for. Whenever I searched drag and drop, it would only give me tutorials on making things "snappy" rather than leaving the item where your mouse is on the screen.

walkastray
Автор

Gracias, tus enseñanzas son magistrales!!!!

ricardoaa
Автор

Ооо это очень полезная информация 😌👍👍👍👍

Dayplaylist
Автор

Hello. What if i only want to move them using the corners only?

Thank you in advance

KIRANTS-sw
Автор

Hey man, what if I have a grid of hundreds of boxes.
Wouldn't this be terribly slow to check if my mouse is clicking on which box

fuzzy-
Автор

Hey Russ! Could you tell me how to make it when MOUSEBUTTONUP the boxes have gravity and they fall to a surface? So they have gravity in general and you can pick them up and when MOUSEBUTTONUP they fall again.

Formulaah
Автор

Cannot find reference 'collidepoint' in 'Surface | SurfaceType'
Cannot find reference 'move_ip' in 'Surface | SurfaceType'

i get these errors and idk why. the pygame window opens, but then i click on anything it crashes D:

lio_
Автор

Thanks for the video. In my version the boxes appear one after another every time when I click to close the window. I wanted all boxes to appear directly at the beginning. Can anyone help and tell me what I did wrong? Thanks in advance

alexanderwolter
Автор

is there a tutorial for making the boxes transparent so that you can look through them?

-_Nuke_-
Автор

Love your videos, man! How do I go about moving a .png that I've got on the screen?

tacobeartaco
Автор

if we want to, how can we change the number of blocks?

lightingzr
Автор

just (well nearly) what I was looking for, I want to only drag in X and Y but struggling to do so. Any ideas? (btw, nearly finished your Udemy platformer!)

chrisnorthall
Автор

Could you please make a tutorial on tile collisions for platformers ?

justinoo