#pygame first program
import pygame
from pygame.locals import *
from sys import exit
__author__ = {'name' : 'Hongten',
'mail' : 'hongtenzone@foxmail.com',
'QQ' : '648719819',
'Version' : '1.0'}
BG_IMAGE = 'c:\\test\\1.gif'
MOUSE_IMAGE = 'c:\\test\\mouse.gif'
pygame.init()
#设置窗口的大小
screen = pygame.display.set_mode((500, 500), 0, 32)
pygame.display.set_caption('Hongten\'s First Pygame Program')
bg = pygame.image.load(BG_IMAGE).convert()
mouse_cursor = pygame.image.load(MOUSE_IMAGE).convert_alpha()
while True:
for event in pygame.event.get():
if event.type == QUIT:
exit()
screen.blit(bg, (0, 0))
#鼠标的x,y坐标
x, y = pygame.mouse.get_pos()
#隐藏鼠标
pygame.mouse.set_visible(False)
x -= mouse_cursor.get_width() / 2
y -= mouse_cursor.get_height() / 2
#用其他图形代替鼠标
screen.blit(mouse_cursor, (x, y))
pygame.display.update()
机械节能产品生产企业官网模板...
大气智能家居家具装修装饰类企业通用网站模板...
礼品公司网站模板
宽屏简约大气婚纱摄影影楼模板...
蓝白WAP手机综合医院类整站源码(独立后台)...苏ICP备2024110244号-2 苏公网安备32050702011978号 增值电信业务经营许可证编号:苏B2-20251499 | Copyright 2018 - 2025 源码网商城 (www.ymwmall.com) 版权所有