2014-10-18 80 views

回答

0

要做到这一点很简单。

例如,

cat_image = "cat.png" 
mouse_c = pygame.image.load(mouse_image).convert_alpha() 

while True: 
for event in pygame.event.get(): 
    if event.type == QUIT: 
     pygame.quit() 
     sys.exit() 

x,y = pygame.mouse.get_pos() 
x -= mouse_c.get_width()/2 
y -= mouse_c.get_height()/2 

screen.blit(mouse_c,(x,y)) 

pygame.display.update() 

你需要减去一半的高度和宽度到达市中心。

相关问题