Skip to content

Commit

Permalink
feat: enable borderless and always on top
Browse files Browse the repository at this point in the history
  • Loading branch information
u8slvn committed Aug 14, 2024
1 parent bc62f68 commit 9562d5e
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions src/doggo/world.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,12 @@ class World:
"""

def __init__(self, title: str, size: tuple[int, int], fps: int = 60) -> None:
self.window: pg.window.Window = pg.window.Window(title=title, size=size)
self.window: pg.window.Window = pg.window.Window(
title=title,
size=size,
borderless=True,
always_on_top=True,
)
self.screen: pg.Surface = self.window.get_surface()
self.draggable: DraggableWindow = DraggableWindow(window=self.window)
self.fps: int = fps
Expand All @@ -34,7 +39,9 @@ def __init__(self, title: str, size: tuple[int, int], fps: int = 60) -> None:
def process_inputs(self) -> None:
"""Process the inputs of the world."""
for event in pg.event.get():
if event.type == pg.QUIT:
if event.type == pg.QUIT or (
event.type == pg.KEYDOWN and event.key == pg.K_ESCAPE
):
self.running = False

self.draggable.process_event(event=event)
Expand Down

0 comments on commit 9562d5e

Please sign in to comment.