Slimwaffle Posted November 16, 2018 Posted November 16, 2018 So I am able to successfully create widgets inside the menu. But is there a way to create them directly on to the player camera? Quote
aiaf Posted November 17, 2018 Posted November 17, 2018 Have a look in menu.lua. For what you need draw widgets with last parameter gui:Getbase(). It's like the parent to draw on, when you draw on a panel you have the panel variable there. Quote I made this with Leadwerks/UAK: Structura | Stacky Desktop Edition Website: Binary Station
Slimwaffle Posted November 18, 2018 Author Posted November 18, 2018 So instead of gui:GetBase(). I would use context? Quote
aiaf Posted November 18, 2018 Posted November 18, 2018 Use gui:GetBase() Draw your widgets similar to the panel. Quote I made this with Leadwerks/UAK: Structura | Stacky Desktop Edition Website: Binary Station
GorzenDev Posted November 18, 2018 Posted November 18, 2018 you can create multiple GUI to hold widgets. but only one event loop can be used. Quote
Slimwaffle Posted November 19, 2018 Author Posted November 19, 2018 So if I wanted to create a second GUI that doesn't use the menu or a background panel I would have to put the if events for the second GUI in the menu script? Quote
GorzenDev Posted November 19, 2018 Posted November 19, 2018 that is one option. i recommend moving the event loop outside of the menu file though. then call processevent(event) with a return value on any table that needs to process events. for example in my current c++ project i actualy have a class called GUIManager which holds the event loop. which in turn calls other gui classes to update and grab events. when that call returns true then the event is processed and there is no need to call other classes with that event. example code(C++) : //Handle GUI events while (EventQueue::Peek()) { Event event = EventQueue::Wait(); // //Update menu UI events if (!gamemenu->Hidden()) { //exit game if (gamemenu->ProcessEvent(event) == false) return false; } //update game UI events if (!gameui->Hidden()) gameui->ProcessEvent(event); } Quote
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.