surface

How to save an image after changing its resolution in Pygame?

How to save an image after changing its resolution in Pygame? Question: Currently, I am a beginner when it comes to Pygame, and have been trying to allow the user to hand-draw digits into a canvas. I have managed to get the code to draw and clear the canvas to work. However, the pictures I …

Total answers: 1

Vispy surface plot highlight particular section with color and image

Vispy surface plot highlight particular section with color and image Question: Question 1: I am trying to highlight particular section from Vispy Surface Plot example in a particular colour somewhat similar to below modified image. Question 2: Similarly I would like to add an image data as overlay texture to the Vispy surface plot Can …

Total answers: 1

Why do I get an error message when trying to assign a rect to a surface?

Why do I get an error message when trying to assign a rect to a surface? Question: I’m making a game and adding enemies to them, but for some reason, when I try to use the .get_rect() method, I get an error message saying "invalid rect assignment". I’ve tried many ways, if you can find …

Total answers: 1

Pygame : image.convert_alpha() won't work

Pygame : image.convert_alpha() won't work Question: So, I’m making a prototype of game using Pygame, Pytmx, and PyScroll (I’m following "Graven" Turorial on youtube) This is my problem : I have a spritesheet (96×38 pixels), and I want to get only one image of it.. class Player(pygame.sprite.Sprite): def __init__(self, x, y): super(Player, self).__init__() self.spritesheet = …

Total answers: 1

surface plots in matplotlib

surface plots in matplotlib Question: I have a list of 3-tuples representing a set of points in 3D space. I want to plot a surface that covers all these points. The plot_surface function in the mplot3d package requires as arguments X,Y and Z to be 2d arrays. Is plot_surface the right function to plot surface …

Total answers: 9