Active4 months ago
I would like to know how to draw images using pygame. I know how to load them.I have made a blank window.When I use
Pika the Wizard of the Whalesscreen.blit(blank, (10,10))
, it does not draw the image and instead leaves the screen blank. Free color contact trial pair.Pygame.draw.lines(screen, color, closed, pointlist, thickness) draws a series of lines, connecting the points specified in pointlist pointlist is a list of tuples, specifying a series of points, e.g. To draw a V you might use (100,100), (150,200), (200,100), with closed = False. Pygame.draw.line(screen, COLOUR, fromx, fromy, tox, toy, linethickness) This example will draw a line that is black from the point 100, 100 to the point 200, 200. The thickness of the line is 10 pixels.
2,1968 gold badges18 silver badges29 bronze badges
jtl999jtl9994752 gold badges6 silver badges17 bronze badges
3 Answers
joaquin
Pygame Draw Line
joaquin59.9k22 gold badges129 silver badges141 bronze badges
Loads the file
Pika the Wizard of the Whalesplayer.png
.Run this and it works perfectly. So hopefully you learn something.2,1968 gold badges18 silver badges29 bronze badges
John RiselvatoJohn Riselvato11.4k5 gold badges55 silver badges85 bronze badges
After using
jsbuenojsbuenoblit
or any other update on your drawing surface, you have to call pygame.display.flip()
to actually update what is displayed.61.4k7 gold badges87 silver badges139 bronze badges