![]() |
Attention | Topic was automatically imported from the old Question2Answer platform. |
![]() |
Asked By | nwgdusr999 |
Hi, so I’m trying to have a large view on the left, with two views stacked vertically on the right. (World with characters on left, two ‘action boards’ on the right; like mini-games).
I found a guide which recommended HBoxContainer, so I thought using a HBoxContainer to split left and right, then a VBoxContainer to split the right on top to bottom. It works, but I can’t get precise values to work… I want the right to be 540 pixels, which leaves 1380 pixels for the left:
Total = 1920x1080.
|- Left = 1380x1080
|- Right = 540x1080
… |- RightTop = 540x540
… |- RightBottom = 540x540
So I set every component’s Rect and Size values using the above values, and everything looks ok on the 2D view, but when I launch the game, the above sizes are not respected and while the gist of placement is respected, the sizes & ratios are wrong… If I close and re-open godot, then it screws up all the values, 1380 becomes 1231, 540 become 685, some heights become 538 instead of 540, so basically the same values I get when I launch the game… If it would be a few pixels it wouldn’t be the end of the world, but resizing from 540 to 685 or 1380 to 1231 is very annoying… (From square to rectangular…)
If I set all the values I want then save, the file contains the correct values, so I commit to Git. If I relaunch Godot, it screws up all the values of the file when loading the scene. The issue seems to be related to Margins… The editor’s Hint says that it should be controlled by the container and shouldn’t be edited…
But yeah I’m new to godot, is there a better way to manage split views than containers? Just seems bugged so far, there’s absolutely no error or output log about incorrect values being fixed or anything… I think I remember reading or watching a tutorial which said that for the Nodes; red = 3D, green = UI and blue = 2D, but the only way to place views seem to be through containers…
Thanks!
(Also could be an issue about some pixels overlapping; if I had a 4x4 pixel project and set 2x4 for right, and 2x2 top right and 2x2 bottom right, that would seem logical, but it seems from the values godot is ‘correcting’ to, it’s like there’s some pixels used as separators even though 0 is specified for separators… But I just tried reducing everything by a few pixels and the result is the same, so that’s not the issue…)