sdxsdx Posted June 20, 2023 Share Posted June 20, 2023 std::shared_ptr<UltraEngine::Interface> ui = UltraEngine::CreateInterface(window); auto sz = ui->root->ClientSize(); ui->SetRenderLayers(128); auto text = CreateTextField(0, 50, 100, 30, ui->root,UltraEngine::TEXTFIELD_DEFAULT); text->SetText("Hello World!"); auto uicam = CreateCamera(world, PROJECTION_ORTHOGRAPHIC); uicam->SetClearMode(CLEAR_DEPTH); uicam->SetRenderLayers(128); uicam->SetPosition(framebuffer->size.x / 2, framebuffer->size.y / 2); //Main loop while (window->Closed() == false and window->KeyDown(KEY_ESCAPE) == false) { text->SetText("Hello World!"); while (PeekEvent()) { auto event = WaitEvent(); ui->ProcessEvent(event); } world->Update(); world->Render(framebuffer); } Am I missing anything? I have two camera, one camera runs the 3d world, one runs the interface; But the 3d world camera seems to override the interface camera. Quote Link to comment Share on other sites More sharing options...
sdxsdx Posted June 20, 2023 Author Share Posted June 20, 2023 I have two camera, one camera runs the 3d world, one runs the interface; But the 3d world camera seems to override the interface camera. Once the world is loaded, the interface is disappeared. Quote Link to comment Share on other sites More sharing options...
Josh Posted June 20, 2023 Share Posted June 20, 2023 You need to create the 3D camera before the UI camera, or call camera->SetOrder() to adjust the order they render in. 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...
sdxsdx Posted June 20, 2023 Author Share Posted June 20, 2023 8 minutes ago, Josh said: You need to create the 3D camera before the UI camera, or call camera->SetOrder() to adjust the order they render in. CreateTextField does not work but CreateLabel works fine. May be I am setting something wrong? Quote Link to comment Share on other sites More sharing options...
sdxsdx Posted June 20, 2023 Author Share Posted June 20, 2023 CreateLabel works fine. CreateButton works fine. CreateTextField does't work. It appeared in screen first but once the game world is complete loaded, the TextField becomes disappeared. Maybe there is something wrong with CreateTextField? Quote Link to comment Share on other sites More sharing options...
Josh Posted June 20, 2023 Share Posted June 20, 2023 That is possible. The UI rendering in Vulkan is something I have put off because I want to work on the editor right now. 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.