fixed the gui and added a background image

This commit is contained in:
Cuptain 2024-06-21 20:59:26 +10:00
parent 45e9c791b5
commit ae4873971d
2 changed files with 18 additions and 13 deletions

BIN
CityBase.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.3 MiB

31
Main.py
View File

@ -6,7 +6,7 @@ import Backend
import customtkinter import customtkinter
from customtkinter import * from customtkinter import *
import PIL import PIL
from PIL import Image from PIL import Image, ImageTk
# Initialize a configparser object for managing the configuration file # Initialize a configparser object for managing the configuration file
config = configparser.ConfigParser() config = configparser.ConfigParser()
@ -62,32 +62,37 @@ def main():
set_default_color_theme("blue") set_default_color_theme("blue")
#Add a frame for the tabs #Add a frame for the tabs
tab_frame = CTkFrame(master=app) #tab_frame = CTkFrame(master=app)
tab_frame.pack() #tab_frame.pack()
#Title image
#Add Canvas for background and title
titleimage = Image.open(Backend.resource_path("Title.png")) titleimage = Image.open(Backend.resource_path("Title.png"))
titlelabel = CTkLabel(master=app, text="", image=CTkImage(titleimage, size=(700, 250))) titlephoto = ImageTk.PhotoImage(titleimage)
titlelabel.pack(expand=True, padx=0, pady=0) season6_bg = Image.open(Backend.resource_path("CityBase.png"))
season6_scale = season6_bg.resize((1280,720))
season6_ph = ImageTk.PhotoImage(season6_scale)
bg_canvas = CTkCanvas(master=app, height=720, width=1280)
bg_canvas.pack(expand=True, fill='both')
bg_canvas.create_image(1,1, anchor=NW, image = season6_ph)
bg_canvas.create_image(130,1, anchor=NW, image = titlephoto)
# Tabs to seperate options from launching the game # Tabs to seperate options from launching the game
guitabs = CTkTabview(master=app, bg_color="transparent", corner_radius=20) guitabs = CTkTabview(master=bg_canvas, bg_color="#292929", corner_radius=20)
guitabs.pack(expand=True, fill='y', padx=0, pady=(0), anchor="ne") guitabs.pack(expand=True, fill='x', padx=0, pady=(0), anchor="s")
guitabs.add("Launcher") guitabs.add("Launcher")
guitabs.add("Options") guitabs.add("Options")
#root.title("Select Prism Instance Path") #root.title("Select Prism Instance Path")
# Label for instructions # Label for instructions
label = CTkLabel(master=guitabs.tab("Options"), text="Select Prism instance path:", font=("Impact", 30)) label = CTkLabel(master=guitabs.tab("Options"), text="Select Prism instance path:", font=("Arial", 30))
label.pack(pady=10) label.pack(pady=10)
# Entry widget for Prism instance path # Entry widget for Prism instance path