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

Add support for get_render_size() #31

Open
abso1utezer0 opened this issue Feb 5, 2023 · 3 comments
Open

Add support for get_render_size() #31

abso1utezer0 opened this issue Feb 5, 2023 · 3 comments

Comments

@abso1utezer0
Copy link

The get_display_size() method returns the size of the window, which may differ from the actual render size. It is possible to calculate the render size using aspect ratios, but it would be a lot nicer to be able to get it easily through Dolphin. With the render size, you can align text and other GUI elements to be in the actual game render instead of all over the window.

image
Here is an example. get_display_size() currently gives the size of the red outline in this image, and the proposed get_render_size() would give the size of the yellow outline in the image.

@Felk
Copy link
Owner

Felk commented Feb 5, 2023

Thanks for reporting! Yeah, I agree, getting the size of the yellow outline sounds more useful.

With the render size, you can align text and other GUI elements to be in the actual game render instead of all over the window

Hmm, that would work. But how do you feel about the offsets passed to gui.draw_text and co also beaing relative to the game area? I think that might be the majority usecase

@abso1utezer0
Copy link
Author

You could add a method to switch the mode maybe. The original way could be default for compatibility, and then the scripter could do gui.set_offset_type(["display"/"render"]) to choose which version to use. "display" would use the original mode, which is the offset from the sides of the actual display/window, and "render" would go off the sides of the actual game render.

@Avasam
Copy link

Avasam commented Jul 17, 2024

But how do you feel about the offsets passed to gui.draw_text and co also beaing relative to the game area? I think that might be the majority usecase

I would personally prefer that, so that the alignement is the same whether fullscreen or windowed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants