What is a good way to draw images using pygame?

前端 未结 4 855
灰色年华
灰色年华 2020-12-06 05:49

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 screen.blit(blank, (10,10)), it does not d

4条回答
  •  一生所求
    2020-12-06 06:15

    This is a typical layout:

    myimage = pygame.image.load("myimage.bmp")
    imagerect = myimage.get_rect()
    
    while 1:
        your_code_here
    
        screen.fill(black)
        screen.blit(myimage, imagerect)
        pygame.display.flip()
    

提交回复
热议问题