Alienhead Posted January 10 Share Posted January 10 Not 100% sure this is a bug or not... but I cannot create a top shelf menu bar when Im running the interface in 3d window mode. The command is ran and gives no error and by all means the menu exist since I can get a ssid off it... but no menu appears. Quote Alienhead Components and Software Link to comment Share on other sites More sharing options...
Josh Posted January 21 Share Posted January 21 Menus might not work correctly with a 3D interface because all their submenus are created as separate windows. For an interface like you are showing here, or like the level editor has, I recommend using the first setup example here: https://www.ultraengine.com/learn/CreateInterface The menu widget is meant more for applications than games. You can then create a borderless child window for the viewport, parented to your main window, using WINDOW_CHILD for the window style. This is how any WIndows program that shows the WIn32 GUI with a 3D rendering viewport works. The last step is you need to detect window size events, and resize the viewport window whenever the main window is resized using Window:SetShape(). This is best done in an event callback so the viewport window will resize as you are dragging the window edges. This will give you menus that appear on top of the 3D window, a more responsive interface, faster window resizing, and better text rendering. Quote My job is to make tools you love, with the features you want, and performance you can't live without. Link to comment Share on other sites More sharing options...
Josh Posted January 21 Share Posted January 21 What language are you developing this program in? I can probably put together an example quickly that shows the recommended setup. Quote My job is to make tools you love, with the features you want, and performance you can't live without. Link to comment Share on other sites More sharing options...
Solution Josh Posted January 23 Solution Share Posted January 23 For the reasons listed, I am changing it so CreateMenu will return NULL if the interface it is on was not created directly on a window. If you would like help with the recommend UI setup please tell me the programming language you are using. A note of this has been added in the documentation. Quote My job is to make tools you love, with the features you want, and performance you can't live without. Link to comment Share on other sites More sharing options...
Alienhead Posted January 24 Author Share Posted January 24 Lua, and thanks. Quote Alienhead Components and Software Link to comment Share on other sites More sharing options...
Josh Posted January 24 Share Posted January 24 --Get the displays local displays = GetDisplays() --Create window local window = CreateWindow("Ultra Engine", 0, 0, 1280, 720, displays[1], WINDOW_TITLEBAR | WINDOW_CENTER) --Create user interface local ui = CreateInterface(window) --Create widget local sz = ui.background:ClientSize() local button = CreateButton("Button", sz.x / 2 - 75, sz.y / 2 - 15, 150, 30, ui.background) sz = window:ClientSize() local viewport = CreateWindow("Viewport", 50, 50, sz.x - 100, sz.y - 100, window, WINDOW_CHILD) local framebuffer = CreateFramebuffer(viewport) local world = CreateWorld() local camera = CreateCamera(world) camera:SetClearColor(0,0,1) while (true) do local ev = WaitEvent() if (ev.id == EVENT_WINDOWCLOSE and ev.source == window) then return 0 elseif ev.id == EVENT_WINDOWPAINT then world:Render(framebuffer) end end 1 Quote My job is to make tools you love, with the features you want, and performance you can't live without. Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.