import pygame
from color import Color
# import math
pygame.init()
window = pygame.display.set_mode((600, 600))
window.fill(Color.white)
pygame.draw.rect(window, Color.blue, (100, 150, 400, 300), 0)
font1 = pygame.font.Font('aa.ttf', 25, bold=True)
text1 = font1.render('欢迎杨海来到学生管理系统!', True, Color.red)
window.blit(text1, (150, 160))
pygame.draw.rect(window, Color.yellow, (200, 200, 200, 50))
font2 = pygame.font.Font('aa.ttf', 30, bold=True)
text2 = font2.render('账号:', True, Color.black)
window.blit(text2, (210, 205))
pygame.draw.rect(window, Color.yellow, (200, 270, 200, 50))
font3 = pygame.font.Font('aa.ttf', 30, bold=True)
text3 = font3.render('密码:', True, Color.black)
window.blit(text3, (210, 275))
pygame.draw.rect(window, Color.red, (200, 350, 200, 50))
font4 = pygame.font.Font('aa.ttf', 30, bold=True)
text4 = font4.render('登录', True, Color.black)
window.blit(text4, (270, 355))
image_obj = pygame.image.load('美女.jpg')
image_obj = pygame.transform.rotozoom(image_obj, 0, 0.04)
window.blit(image_obj, (105, 205))
window.blit(image_obj, (415, 205))
pygame.display.flip()
while True:
    for event in pygame.event.get():
        if event.type == pygame.QUIT:
            exit()
        elif event.type == pygame.MOUSEBUTTONDOWN:
            # 鼠标按下要做什么就写在这儿
            x, y = event.pos
            if 200 <= x <= 400 and 350 <= y <= 400:
                window.fill(Color.white)
                font5 = pygame.font.Font('aa.ttf', 50)
                text5 = font5.render('恭喜发财,红包拿来!', True, Color.red)
                window.blit(text5, (85, 265))
                pygame.display.flip()
day15-作业
©著作权归作者所有,转载或内容合作请联系作者
平台声明:文章内容(如有图片或视频亦包括在内)由作者上传并发布,文章内容仅代表作者本人观点,简书系信息发布平台,仅提供信息存储服务。
 平台声明:文章内容(如有图片或视频亦包括在内)由作者上传并发布,文章内容仅代表作者本人观点,简书系信息发布平台,仅提供信息存储服务。
推荐阅读更多精彩内容
- 0.定义一个学生类。有属性:姓名、年龄、成绩(语文,数学,英语)【每科成绩的类型为是整数】方法:A.获取学生的姓名...
 - 0.定义一个学生类。有属性:姓名、年龄、成绩(语文,数学,英语)[每课成绩的类型为整数]方法: a. 获取学生的姓...