pygame-surface

What does the parameter DestSurface in Pygame.transform.scale mean and how do I use it?

What does the parameter DestSurface in Pygame.transform.scale mean and how do I use it? Question: The documentation for the pygame.transform.scale method is as follows. scale(Surface, (width, height), DestSurface = None) -> Surface` Resizes the Surface to a new resolution. This is a fast scale operation that does not sample the results. An optional destination surface …

Total answers: 1

Pygame not returning events while embedded in PyQt

Pygame not returning events while embedded in PyQt Question: I’m testing out an application and the UI uses PyQt4 with Pygame embedded into it. It uses a timer to “update” itself so to speak and in the timerEvent function Pygame attempts to retrieve all detected events. Issue is, Pygame isn’t detecting any events. Here’s a …

Total answers: 3

How to scale every image in a list? pygame

How to scale every image in a list? pygame Question: How do I scale every picture within a list in pygame? I can’t really figure it out. Whenever I try, an error says the item I am transform.scaling is a str or a bool and that I need a surface to work with. I understand …

Total answers: 2

How do I detect collision in pygame?

How do I detect collision in pygame? Question: I have made a list of bullets and a list of sprites using the classes below. How do I detect if a bullet collides with a sprite and then delete that sprite and the bullet? #Define the sprite class class Sprite: def __init__(self,x,y, name): self.x=x self.y=y self.image …

Total answers: 5