Zylann / godot_heightmap_plugin

HeightMap terrain for Godot implemented in GDScript
Other
1.72k stars 159 forks source link

Terrain Generation GUI scale #111

Closed CuL8Rg8r closed 4 years ago

CuL8Rg8r commented 4 years ago

Is there any way to make your plugin work on a large scale screen? I'm on a 4k and I cant use the terrain generator at all because the window doesn't scale with the sliders and buttons (they are all hidden behind the render preview window. Is there like a gui size setting I could change or something link an ini file for preference settings?

Zylann commented 4 years ago

None of the UI in this plugin (and any other I know of) have high-DPI settings in particular. Godot scales itself automatically but I have no idea if it does so for plugin-created UIs.

Can you post a screenshot?

ivantomac commented 4 years ago

Editor settings: godot-editor-settings

Generate terrain dialog: godot-generate-terrain-1

Generate terrain dialog after resizing it: godot-generate-terrain-2

Some other things are also a bit off but this one is the most notable one.

Calinou commented 4 years ago

Unfortunately, there's no way to get the current editor scale from GDScript, so you'll have to add a setting or try to infer it from the resolution and screen DPI like the engine does and resize Control nodes as needed. If this can't be done, the GUI will have to be modified to ensure nothing can overlap, but this will still break spacing between controls.

Zylann commented 4 years ago

I'm having a look at the node tree and the screenshots, it seems minimum_size is not being affected by the DPI resizing. But also, in the second and third screenshot of https://github.com/Zylann/godot_heightmap_plugin/issues/111#issuecomment-573396567, it's actually two parts of an HBoxContainer overlapping with each other, even after some resizing. How is that even possible? None of the sizes are hardcoded here, such container usually doesn't permit that, and the viewport is inside a container with stretch on Oo

Only the overflow below the limits of the window dialog looks familiar and might be fixable by giving the window a larger minimum size (again cuz min size isnt affected for some reason), but I don't know what do to with the overlapping elements.

I also can't test any fix I do because the editor doesn't have a setting to override DPI scaling...

Zylann commented 4 years ago

Ok, with a bunch of digging, I managed to fix the UI in 1.5x DPI, so I hope it would work for 2x as well. Improvement made in b4ac92ca799dc6c96f5514c06f13b0f63031defe Thanks to @Calinou for the heads-up on the engine DPI code