Initial commit of Calculator
This commit is contained in:
parent
59503067e6
commit
905eaed96c
34
PyGame/Calculator/calc.py
Normal file
34
PyGame/Calculator/calc.py
Normal file
|
@ -0,0 +1,34 @@
|
|||
import os
|
||||
os.environ['PYGAME_HIDE_SUPPORT_PROMPT'] = "hide"
|
||||
import pygame
|
||||
import sys
|
||||
|
||||
pygame.init()
|
||||
|
||||
width = 600
|
||||
height = 900
|
||||
|
||||
screen = pygame.display.set_mode((width, height))
|
||||
pygame.display.set_caption('CheesyCalc')
|
||||
icon = pygame.image.load(os.path.join("img", "cheesy_icon_32x32.png"))
|
||||
icon.convert_alpha()
|
||||
pygame.display.set_icon(icon)
|
||||
logo = pygame.image.load(os.path.join("img", "cheesy.png"))
|
||||
logo.convert_alpha()
|
||||
screen.blit(logo, (30, 20))
|
||||
cheesy_font = pygame.font.Font(os.path.join("font", "Cheese.ttf"), 60)
|
||||
logo_text_1 = cheesy_font.render("Cheesy", True, (240, 240, 20))
|
||||
logo_text_2 = cheesy_font.render("Calculator", True, (240, 240, 20))
|
||||
screen.blit(logo_text_1, (width // 2 - logo_text_1.get_width() // 2 + 80, -15))
|
||||
screen.blit(logo_text_2, (width // 2 - logo_text_2.get_width() // 2 + 80, 30))
|
||||
sevenseg_font = pygame.font.Font(os.path.join("font", "Seven Segment.ttf"), 120)
|
||||
text = sevenseg_font.render("9378675309", True, (255, 255, 255))
|
||||
screen.blit(text, (width // 2 - text.get_width() // 2, 100))
|
||||
pygame.draw.rect(screen, (240, 240, 20), pygame.Rect(10, 95, 580, 130), 2)
|
||||
|
||||
while True:
|
||||
for event in pygame.event.get():
|
||||
if event.type == pygame.QUIT:
|
||||
pygame.quit()
|
||||
sys.exit()
|
||||
pygame.display.flip()
|
BIN
PyGame/Calculator/font/Cheese.ttf
Normal file
BIN
PyGame/Calculator/font/Cheese.ttf
Normal file
Binary file not shown.
BIN
PyGame/Calculator/font/Seven Segment.ttf
Normal file
BIN
PyGame/Calculator/font/Seven Segment.ttf
Normal file
Binary file not shown.
BIN
PyGame/Calculator/img/cheesy.png
Normal file
BIN
PyGame/Calculator/img/cheesy.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 5.7 KiB |
BIN
PyGame/Calculator/img/cheesy_icon_32x32.png
Normal file
BIN
PyGame/Calculator/img/cheesy_icon_32x32.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 1.9 KiB |
Loading…
Reference in New Issue
Block a user