Python Pygame - How To Create A Drag And Drop With Multiple Images?
So I've been trying to create a jigsaw puzzle using pygame in python.The only problem is that I'm having trouble creating the board with multiple images that i can drag along the s
Solution 1:
You pass a position to your sprites and store it in self.pos
, but to draw a Sprite
a sprite group uses the rect
attribute:
From pygame.sprite.Group.draw()
:
Draws the contained Sprites to the Surface argument. This uses the Sprite.image attribute for the source surface, and Sprite.rect for the position.
Post a Comment for "Python Pygame - How To Create A Drag And Drop With Multiple Images?"