
import importlib
import time
import platform
import ctypes
import os
import math
import qfs
from enum import Enum

global stopExecution
global mousePos
global screen
global uiPosition
uiPosition = (0, 0)

class UIFLAG:
	STRETCH = 0x0001
	HIDE = 0x0002

global entMaster
class Entity():
	flags = 0
	owner = None
	entList = []
	
	origin = (0, 0)
	size = (0, 0)
	anchor = (0, 0)
	justify = (0, 0)

	def __init__(self):
		self.entList = []
		pass
	def render(self):
		pass
entMaster = Entity()

def ThrowError(err_text):
	print(err_text + "\n")
	if (platform.system() == "Windows"):
		ctypes.windll.user32.MessageBoxW(None, err_text, err_text, 0)

debugImport = False
if (debugImport):
	import pygame
else:
	packageList = {"pygame"}
	for package in packageList:
		try:
			lib = importlib.import_module(package)
			globals()[package] = lib
			continue
		except:
			ThrowError(u"Please install pip package \"" + package + "\"")
			time.sleep(0.1)
			print("the UI editor will now close...")
			time.sleep(3)
			print("(it's now safe to turn off your computer.)")
			time.sleep(0.2)
			exit(1)
			break

