Lastly, the image module it doesn't find and I thought Pygame deals with images. I did try to import the image module.
Thanks!
#!/usr/bin/python2.6
import pygame
from pygame.locals import *
from sys import exit
pygame.init()
# file:///Users/kytriya/Desktop/
background_image_filename = 'jadeuniversity.png'
mouse_image_filename = 'handle.png'
screen = pygame.display.set_mode((1000, 900), 0, 32)
pygame.display.set_caption("Jade University Mouse Movement")
background = pygame.image.load(background_image_filename).convert()
mouse_cursor = pygame.image.load(mouse_image_filename).convert_alpha()
while True:
for event in pygame.event.get():
if event.type == QUIT:
exit()
screen.blit(background, (0,0))
x, y = pygame.mouse.get_pos()
x-= mouse_cursor.get_width() / 2
y-= mouse_cursor.get_height() / 2
screen.blit(mouse_cursor, (x,y))
pygame.display.update()
Traceback (most recent call last):
File "/Users/kytriya/Desktop/CodeLearning/Python/PyCode-Mine/MouseCursorMovement.py", line 18, in <module>
background = pygame.image.load(background_image_filename).convert()
error: Couldn't open file:///Users/kytriya/Desktop/jadeuniversity.png
>>> ================================ RESTART ================================
>>> ================================ RESTART ================================
>>>
Traceback (most recent call last):
File "/Users/kytriya/Desktop/CodeLearning/Python/PyCode-Mine/MouseCursorMovement.py", line 18, in <module>
background = pygame.image.load(background_image_filename).convert()
error: Couldn't open jadeuniversity.png

New Topic/Question
Reply




MultiQuote



|