Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update level editor splash screen #1290

Merged
merged 2 commits into from
Dec 17, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Binary file added src/modlunky2/static/images/leveleditor.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
50 changes: 22 additions & 28 deletions src/modlunky2/ui/levels/warm_welcome.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
import tkinter as tk
from tkinter import ttk
from PIL import Image, ImageTk

from modlunky2.constants import BASE_DIR

IMAGE_PATH = BASE_DIR / "static/images"


class WarmWelcome(tk.Frame):
Expand All @@ -14,36 +19,25 @@ def __init__(self, parent, on_open, *args, **kwargs):
main_frame.columnconfigure(0, weight=1)
main_frame.rowconfigure(1, weight=1)

self.welcome_label_title = tk.Label(
main_frame,
text=("Spelunky 2 Level Editor"),
anchor="center",
bg="black",
fg="white",
font=("Arial", 45),
)
self.welcome_label_title.grid(
row=0, column=0, sticky="nwe", ipady=30, padx=(10, 10)
)
self.img = Image.open(IMAGE_PATH / "leveleditor.png")
self.background_image = ImageTk.PhotoImage(self.img)

self.welcome_label = tk.Label(
main_frame,
text=(
"Welcome to the Spelunky 2 Level Editor!\n"
"Created by JackHasWifi with lots of help from "
"Garebear, Fingerspit, Wolfo, and the community.\n\n "
"NOTICE: Saving will save "
"changes to a file in your selected pack and never overwrite its extracts counterpart.\n"
"BIGGER NOTICE: Please make backups of your files. This is still in beta stages.."
),
anchor="center",
bg="black",
fg="white",
font=("Arial", 12),
)
self.welcome_label.grid(row=1, column=0, sticky="nwe", ipady=30, padx=(10, 10))
self.background_image_label = tk.Label(main_frame, image=self.background_image)

def resize_image(event):
new_width = event.width
new_height = event.height

img = self.img.resize((new_width, new_height))
background_image = ImageTk.PhotoImage(img)

self.background_image_label.config(image=background_image)
self.background_image_label.image = background_image

self.background_image_label.place(x=0, y=0, relwidth=1, relheight=1)
self.background_image_label.bind("<Configure>", resize_image)

self.button_open = ttk.Button(main_frame, text="Open Editor", command=on_open)
self.button_open.grid(
row=2, column=0, sticky="news", ipady=30, padx=(20, 20), pady=(20, 20)
row=2, column=0, sticky="ews", ipady=20, padx=(20, 20), pady=(10, 10)
)