Initial commit of Calculator

This commit is contained in:
Junior 2024-06-04 14:08:43 -04:00
parent 59503067e6
commit 905eaed96c
5 changed files with 34 additions and 0 deletions

34
PyGame/Calculator/calc.py Normal file
View 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()

Binary file not shown.

Binary file not shown.

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.7 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.9 KiB