InteligentnySaper/classes/system.py

31 lines
846 B
Python
Raw Normal View History

2022-03-09 01:36:46 +01:00
import pygame
class Window:
window:None
width:int
height:int
title:str
icon_path:str
def __init__(self, width:int=640, height:int=480, title="", icon_path=""):
self.set_resolution(width,height)
self.set_title(title)
self.set_icon(icon_path)
self.mount()
def set_resolution(self, width:int, height:int):
self.width = width
self.height = height
def set_title(self, title:str):
self.title=title
def set_icon(self, icon_path:str):
self.icon_path= icon_path
def mount(self):
self.window = pygame.display.set_mode((self.width,self.height))
pygame.display.set_caption(self.title)
if self.icon_path != "":
icon = pygame.image.load(self.icon_path)
pygame.display.set_icon(icon)