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()