pygame-surface Questions

7

I had been trying to rotate an image around its center in using pygame.transform.rotate() but it's not working. Specifically the part that hangs is rot_image = rot_image.subsurface(rot_rect).copy()...
Lacrimator asked 15/11, 2010 at 9:55

1

import pygame WIDTH, HEIGHT = 1024, 768 pygame.init() WIN = pygame.display.set_mode((WIDTH, HEIGHT)) skala = pygame.image.load("rock2x3b.jpg") play = True if __name__ == "__main__...
Sellars asked 24/8, 2023 at 5:37

10

Solved

In a Pygame application, I would like to render resolution-free GUI widgets described in SVG. How can I achieve this? (I like the OCEMP GUI toolkit, but it seems to be bitmap-dependent for its rend...
Werra asked 23/9, 2008 at 12:13

5

Solved

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...

4

Solved

I have a piece of code that works using my_surface = pygame.image.load('some_image.png') This returns a pygame surface. I'd like to use the same code everywhere else but instead pass in a numpy...
Canica asked 15/12, 2016 at 16:2

1

Solved

I have an SVG graphic represented in a string svg_string='<svg height="100" width="500"><ellipse cx="240" cy="50" rx="220" ry="30&quo...
Sterling asked 10/1, 2021 at 3:42

2

Solved

DeprecationWarning: an integer is required (got type float). Implicit conversion to integers using int is deprecated, and may be removed in a future version of Python. win.blit(playerStand, (x,...
Rowlett asked 14/12, 2019 at 16:19

4

Solved

I've been searching for some good tutorial about making simple sprite animation from few images in Python using Pygame. I still haven't found what I'm looking for. My question is simple: how to ma...
Doro asked 26/12, 2012 at 17:46

1

Solved

I created images from OpenCV/opencv-python (numpy.array) and I want to convert them to a pygame.Surface object: def cvImageToSurface(cv2Image): pygameSurface = # ? create from "cvImage"...
Kahn asked 3/10, 2020 at 10:52

3

Solved

First of all, sorry if this is a duplicate. The answers that I found either seemed irrelevant but perhaps I'm searching with the wrong keywords. What I'd like to do is to take an animated GIF and s...
Hob asked 10/4, 2015 at 22:6

2

Solved

I have this idea for a game where you dodge projectiles while controlling a helicopter. I am wondering if you can make a sprite appear as a GIF image, or something along the lines of two images swi...
Statistical asked 3/10, 2020 at 0:41

2

Solved

So, I have been trying to implement water physics in pygame based on this tutorial https://gamedevelopment.tutsplus.com/tutorials/make-a-splash-with-dynamic-2d-water-effects--gamedev-236 The issue ...
Bivens asked 21/6, 2020 at 14:12

1

Solved

My collide_rect function isn't working properly. It always returns True, when it's not suppose to. I have tried looking on the internet but nothing is working for me. I think the collide rect someh...
Electroluminescence asked 30/8, 2019 at 16:30

2

I'm making a game using pygame, and I have an asteroid class. When I add rotation to the update method and I run the program, the asteroids move really slow and laggy, and even their images look wo...
Snaggletooth asked 16/4, 2019 at 19:3

1

Solved

I am trying to use surface.blits with the area parameter to improve the performance of my code. When I use the area parameter for blits, I run into the following error: SystemError: <'method ...
Elope asked 18/1, 2019 at 21:57

1

Solved

I have several fonts that I would like to use that are basically outlines of letters, but the insides are transparent. How would I go about filling only the inside areas of these fonts with with a ...
Dott asked 2/5, 2018 at 17:25

4

Solved

I'm writing a code that part of it is reading an image source and displaying it on the screen for the user to interact with. I also need the sharpened image data. I use the following to read the da...
Vulgarize asked 13/6, 2015 at 11:53

1

Code: #!/usr/bin/python import pygame, time, sys, random, os from pygame.locals import * from time import gmtime, strftime pygame.init() w = 640 h = 400 screen = pygame.display.set_mode((w, h)...
Weber asked 23/11, 2015 at 14:45
1

© 2022 - 2025 — McMap. All rights reserved.