zhu.jun Posted April 26, 2020 Posted April 26, 2020 I need to do a display like this,The world scene is on the left and the UI is on the right.。
moriVotum Posted February 12 Posted February 12 You need to use EngineWindowGroup: https://developer.unigine.com/docs/future/api/library/gui/class.enginewindowgroup but the first window needs to be equated to the main window in the application so that the render is displayed there: EngineWindowViewport main = WindowManager.MainWindow; Add second: EngineWindowViewport second = new("Second", 100, 100); The sizes are not important, because adding them to a group resets them. In example, two windows are created, after which the width of the second one (at index 1) is changed to 1/5 of the total. EngineWindowGroup group = new(EngineWindowGroup.GROUP_TYPE.HORIZONTAL, "Group", 1920, 1080); group.Add(main); group.Add(second); main.UpdateGuiHierarchy(); main.SetHorizontalTabWidth(1, 1920 / 5); main.Show();
dmitrij.knutarev Posted February 15 Posted February 15 On 2/12/2025 at 7:42 PM, moriVotum said: EngineWindowGroup group = new(EngineWindowGroup.GROUP_TYPE.HORIZONTAL, "Group", 1920, 1080); group.Add(main); group.Add(second); main.UpdateGuiHierarchy(); group.SetHorizontalTabWidth(1, 1920 / 5); group.Show(); I've already tried it. The window decorations are turned on and I can't disable it.
moriVotum Posted February 15 Posted February 15 (edited) 10 hours ago, dmitrij.knutarev said: I've already tried it. The window decorations are turned on and I can't disable it. Yes, you cannot change the styles of child elements in window groups. If you need to "split" without separate windows, then there is an option to use WidgetVBox: Code: Gui gui = WindowManager.MainWindow.Gui; WidgetVBox widgetVBox = new(gui); widgetVBox.Height = gui.Height; widgetVBox.Width = 200; widgetVBox.SetSpace(0, 5); widgetVBox.Background = 1; widgetVBox.BackgroundColor = new vec4(0, 0, 1, 1); WidgetButton but = new WidgetButton(gui, "button"); but.SetPosition(2, 2); widgetVBox.AddChild(but); WindowManager.MainWindow.AddChild(widgetVBox, Gui.ALIGN_EXPAND | Gui.ALIGN_OVERLAP | Gui.ALIGN_TOP | Gui.ALIGN_RIGHT); Edited Saturday at 08:25 PM by moriVotum
dmitrij.knutarev Posted Sunday at 07:57 AM Posted Sunday at 07:57 AM Such panel rendered on top of 3D-vewport. The question was about separate 3D-view.
Amerio.Stephane Posted Sunday at 07:03 PM Posted Sunday at 07:03 PM Hello, there is a sample doing something really similar to what you need: SDK Browser > Samples > Demos > C++ Samples > multi_view_split > SplitScreenCamera.h/cpp The trick is to capture the 3D rendering into a WidgetSpriteViewport for your 3D view and render this widget over the left side of your game window. 1
Recommended Posts