View Single Post
Join Date: Sep 2008
Posts: 350
Reputation: tomtetlaw is an unknown quantity at this point 
Solved Threads: 4
tomtetlaw's Avatar
tomtetlaw tomtetlaw is offline Offline
Posting Whiz

Yet another pygame help thread

 
0
  #1
Dec 3rd, 2008
Im testing out blit() and i ran into this error:
  1. Traceback (most recent call last):
  2. File "/home/tom/Desktop/pygame/test/main.py", line 15, in <module>
  3. screen.blit('image.jpg', (10,10))
  4. TypeError: argument 1 must be pygame.Surface, not str
  5.  
  6. this is my code:
  7.  
  8. import pygame
  9. pygame.init()
  10. running = 1
  11. while running == 1:
  12. screen = pygame.display.set_mode((800, 600))
  13. event = pygame.event.poll()
  14. for event in pygame.event.get():
  15. if event.type == pygame.QUIT:
  16. running = 0
  17. image = pygame.image.load('image.jpg').convert()
  18. screen.blit('image.jpg', (10,10))
  19. screen.fill((0, 0, 0))
  20. pygame.display.flip()

any ideas?
Last edited by tomtetlaw; Dec 3rd, 2008 at 4:28 am.
...
Reply With Quote