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

Custom GUI Style / GUI scaling #23

Open
4Magma opened this issue Mar 24, 2021 · 17 comments
Open

Custom GUI Style / GUI scaling #23

4Magma opened this issue Mar 24, 2021 · 17 comments
Labels
enhancement New feature or request

Comments

@4Magma
Copy link

4Magma commented Mar 24, 2021

How can i change font size, color and background color?
BCM appears in white on grey in small font size.

@ManlyMarco
Copy link
Member

ManlyMarco commented Mar 24, 2021

You have to compile your own build with a custom gui skin, or make a plugin that hooks config manager and change the gui skin from there. Something like this https://github.com/ManlyMarco/RuntimeUnityEditor/blob/master/RuntimeUnityEditor/UI/InterfaceMaker.cs#L43

@4Magma
Copy link
Author

4Magma commented Mar 24, 2021

Isn't there a easier way?
I use BCM with Valheim, but the small white text on gray is bad to read.
The Pic on the intro page shows BCM in white on black.

@ManlyMarco
Copy link
Member

At the moment the game's own skin is used, there's no built in way to change this. The only way would be to change the code to use a custom skin like in runtime editor.

@Baccanno
Copy link

I'm interested in this too, every UI is very small on my QHD panel.
I got the source code, now I'm just wondering how I should override the GUISkin.

@ManlyMarco
Copy link
Member

You would have to recalculate sizes of at least fonts for all the different gui styles based on resolution. Create a copy of GUI.skin, make your changes, and then set your copy as the skin to use on every ongui call.

@Baccanno
Copy link

I would also have to do it for all plugins additional UI calls? It does not seem manageable. Maybe going with dnSpy and changing some values ?
Also, any idea of the base police size on Unity ?

@ManlyMarco
Copy link
Member

Yes, this would have to be done in every plugin separately. Some plugins would work fine with just a copy of the code, but others would require major rewrites if they use GUI instead of GUILayout and autoscaling windows. A custom skin like this could be exposed from some API library to make it easier to add it to plugins, like what RuntimeUnityEditor does with its own custom skin.

@ManlyMarco ManlyMarco mentioned this issue Jun 30, 2021
@Faithfinder
Copy link

Yes please?

@ManlyMarco ManlyMarco added the enhancement New feature or request label Dec 24, 2022
@shaojiaxu
Copy link

You have to compile your own build with a custom gui skin, or make a plugin that hooks config manager and change the gui skin from there. Something like this https://github.com/ManlyMarco/RuntimeUnityEditor/blob/master/RuntimeUnityEditor/UI/InterfaceMaker.cs#L43

The link is 404 now :(

@ManlyMarco
Copy link
Member

@ManlyMarco ManlyMarco changed the title [Question] Gui Style Custom GUI Style / GUI scaling May 6, 2023
@JoewAlabel
Copy link

I found a good solution for this problem:

1- Find the exe file of your game, and RMB click it.
2- Click at > Properties
3- Click at Compatibility tab.
4- Click the button: Change high DPI settings
5- Check (enable) the first option below Program DPI
6- Check (enable) the last option below High DPI scaling override
7- At this drop-down list, select > System

Screen Shot

@Stroichik
Copy link

I can add, that if i run Valheim with Vulkan from Steam - i get whitewashed GUI from Config Menu. If i run it from exe or without Vulkan - GUI looks normal colored.

@ManlyMarco
Copy link
Member

@JoewAlabel @Stroichik Can you check if the latest version of RuntimeUnityEditor also has this GUI issue?

@Stroichik
Copy link

@ManlyMarco If i run with Vulkan - it looks same whitewashed
image

And this is how it both looks without Vulkan

image

Its not something very critical, but a fix would be appreciated

@ManlyMarco
Copy link
Member

ManlyMarco commented Nov 9, 2023

The second screenshot is how it should always look like, I have no idea how Vulkan can affect this outside of it being an Unity bug. I guess it could be partially resolved by having a darker version of the skin but there's no way to fix it automatically.

@Stroichik
Copy link

Well, as i said, its not really that critical.

@y0soro
Copy link

y0soro commented Nov 28, 2024

I have wrote the https://github.com/y0soro/Unity.IMGUI.HiDPI.Patcher to adrress the scaling issue.

Also it's possible to apply method described in https://github.com/y0soro/Unity.IMGUI.HiDPI.Patcher#implement-hidpi-scaling-for-your-imgui-application so BepInEx.ConfigurationManager or any other IMGUI application can have native scaling support.

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

No branches or pull requests

8 participants