python code
background_p_w_picpath_filename = 'sushiplate.jpg'
mouse_p_w_picpath_filename = 'fugu.png'
import pygame
from pygame.locals import *
from sys import exit
pygame.init()
screen = pygame.display.set_mode((640, 480), 0, 32)
pygame.display.set_caption('Hello, World!')
pygame.p_w_picpath.load(background_p_w_picpath_filename).convert()
mouse_cursor = pygame.p_w_picpath.load(mouse_p_w_picpath_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()
转载于:https://blog.51cto.com/writer/1305255