Skip to content
This repository has been archived by the owner on Dec 8, 2024. It is now read-only.

Commit

Permalink
Added force-quit function and update to docs
Browse files Browse the repository at this point in the history
  • Loading branch information
dimkauzh committed Aug 30, 2023
1 parent 0ddafff commit 77b1937
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 0 deletions.
1 change: 1 addition & 0 deletions docs/api/api.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ new_window(title: str, width: int, height: int)
change_icon(image_path: str)
loop(your_loop_func)
set_fps(self, fps: int)
force_quit()
```

## Event
Expand Down
7 changes: 7 additions & 0 deletions docs/wiki/wiki.md
Original file line number Diff line number Diff line change
Expand Up @@ -321,3 +321,10 @@ main.ui.text.print_text(window, "Your text", 10, 10, "Arial", 20, main.color.WHI
## Quit

The quitting of the engine is done automaticly for you, so you dont have to worry about it.

### Force to quit
If you want to force quit due to some reason, its pretty easy:
```python
main.window.force_quit()
```

9 changes: 9 additions & 0 deletions src/fusionengine/files/window.py
Original file line number Diff line number Diff line change
Expand Up @@ -95,6 +95,15 @@ def set_fps(self, fps: int) -> None:
"""
self._fps = fps

def force_quit(self) -> None:
"""Force quits the window.
Args:
window: Your window
"""
self._running = False
del self.window

def _refresh(self, window: _CustomRenderer) -> None:
"""Does all things for refreshing window. (Not for the user)
Expand Down

0 comments on commit 77b1937

Please sign in to comment.