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

ScriptHawk Options window scale is wrong and has cutoff #14

Open
retrobenny opened this issue Feb 1, 2021 · 7 comments
Open

ScriptHawk Options window scale is wrong and has cutoff #14

retrobenny opened this issue Feb 1, 2021 · 7 comments

Comments

@retrobenny
Copy link

I am on 4K screen resolution,setting the DPI options in properties for BizHawk doesn't help it likely due to being a seperate entity after opening the script.
I can't read most of the settings properly due to it being crunched in too small,how would one fix this issue?
If I could resize the window,that would at least help for accessing the buttons and other parts,but you can't change the window size from what I can tell.

Testing this on BizHawk 2.5.2 with Banjo-Tooie and the script itself appears to be running correctly,just not the UI window scale.

Bugged ScriptHawk Options Window Size

@Isotarge
Copy link
Owner

Isotarge commented Feb 1, 2021

In BizHawk's Lua API, form control size is based on raw pixel values, with no way to get the DPI of the current screen into Lua and no way to set the font size used in the component (that I am aware of anyway), not to mention the problem of dragging the window across screens with different DPI.
You can try playing around with adjusting ScriptHawk.UI.button_height (around line 51 in ScriptHawk.lua), but the results are less than ideal.
See https://twitter.com/Isotarge/status/963992829746855937
It might be better to solve for the general case, and get BizHawk itself to automatically scale anything passed to their Lua forms API (since C# would have access to DPI) and make it completely transparent for scripts.
Otherwise if I were to handle it downstream it would litter the main directory with separate scripts for each DPI like "ScriptHawk 96DPI (TAS Safe).lua" and I don't really wanna go down that route honestly.
Edit: I suppose we could put adjusting button_height into the modifyOSD() window to retain only two scripts for launching ScriptHawk, but it's still a band aid solution rather than a proper fix.

@retrobenny
Copy link
Author

retrobenny commented Feb 2, 2021

Thanks,please let me know when the changes are made in relation to the other issue post,then I can confirm if it fixes things on my end.

Sorry for the delay,I first saw your post when too tired to respond coherently and then didn't know what to say afterward.
Should I chime in on that mention-linked issue post as well?

Edit: Didn't check the other issue until already posting,I should test those changes on my 4K screen to see if it happens to make it look right.
I feel like I remember Windows 10 desktop scaling options being buggy in some cases but don't remember.

Yes,I remember that Win10 desktop scaling meddles with UI sizes and spacing.
For the record I am on 100% size,not using a scaling value since I can sit directly in front of my monitor to look closer at it to easily be able to read things.

@Isotarge
Copy link
Owner

Isotarge commented Feb 3, 2021

You're getting the squished window at 100% scaling size?
If you're wanting to use ScriptHawk with Windows' scaling setting over 100%, one workaround would be to set the scaling to 100%, open BizHawk + ScriptHawk, and then turn the scaling up to the desired value.
With that workaround I get a window that looks like this:
100percent to 200percent
It's not ideal I know, but it might work until the BizHawk people figure something out, the initial lead about the AutoScaleMode Enum didn't work for me.

@retrobenny
Copy link
Author

retrobenny commented Feb 6, 2021

Turns out I was on 150% scale on Windows Settings,but turning that to 100% still has the cutoff... ☹️
And I can't just change resolution because that would break my G-Sync and not allow me to keep a higher refresh rate either due to dumb limitations beyond my control.

@Isotarge
Copy link
Owner

Isotarge commented Feb 6, 2021

Just to be clear, turning it down to 100% before launching BizHawk + ScriptHawk still has the cutoff?

@retrobenny
Copy link
Author

I turned down to 100%,did a shutdown then booted back up,then opened the stuff and it still has cutoff.
I wonder if adding the ability to resize the window could help at all,if you can even add that to it.

Another idea may be to overcompensate sizes to make it work on 4K but it would look odd on other resolutions while still working otherwise fine there.

@Isotarge
Copy link
Owner

Isotarge commented Feb 6, 2021

Alrighty, I'm not sure what else I can do from here sadly. I think I'll leave it with the BizHawk people for now.

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

2 participants