atomic-junky / Monologue

Design complex dialogues for games!
https://atomic-junky.itch.io/monologue
MIT License
12 stars 2 forks source link

Scale and resize window according to screen dpi #25

Closed atomic-junky closed 2 months ago

atomic-junky commented 2 months ago

When a screen has a hidpi, the window becomes very small, which makes it rather complicated to use at such a small size. The solution is to calculate the scale of the window according to the dpi of the screen.

Summary by Sourcery

Scale the application window according to the screen's DPI to ensure proper sizing on high-DPI displays and enhance user experience by centering the window upon resize.

New Features:

Enhancements:

sourcery-ai[bot] commented 2 months ago

Reviewer's Guide by Sourcery

This pull request implements window scaling and resizing based on screen DPI to improve usability on high-DPI displays. The changes involve modifying the WelcomeWindow behavior and introducing a new global App script to handle DPI-based scaling.

File-Level Changes

Files Changes
Scripts/Global/App.gd Implemented DPI-based window scaling calculation
Scripts/Windows/WelcomeWindow.gd Added window centering functionality
Scripts/Windows/WelcomeWindow.gd Refactored window resizing logic
Scripts/Windows/WelcomeWindow.gd Connected resized signal to update window position

Tips - Trigger a new Sourcery review by commenting `@sourcery-ai review` on the pull request. - Continue your discussion with Sourcery by replying directly to review comments. - You can change your review settings at any time by accessing your [dashboard](https://app.sourcery.ai): - Enable or disable the Sourcery-generated pull request summary or reviewer's guide; - Change the review language; - You can always [contact us](mailto:support@sourcery.ai) if you have any questions or feedback.
atomic-junky commented 2 months ago

Okay, I'll try to find a solution.

atomic-junky commented 2 months ago

Does it work better now? I took over the Godot c++ code logic.

Btw I created a discussion (in the discussion tab) I don't know if it has any interest but it does exist

atomic-junky commented 2 months ago

Thank you, I'm glad it's working well!