Closed Mine228 closed 6 years ago
If you set the parent of the panel to the PANEL_GAMEUIDLL VPANEL pointer you can get from enginevgui->GetPanel it should keep drawing and be visible. You can probably toggle the panel parent depending on what the user does. On Fri, Aug 11, 2017, at 17:49, Mince228 wrote:
So I've been trying to make it so a vgui hud element that is supposed to be rendered would continue to render when the main menu is displayed. This Element is supposed to work as an in game overlay on the screen when the players is withing the game world. However, it's Paint() function doesn't get called if the main menu is rendered. This seems to mimic the same behaviour that all the other player hud elements perform (like health, crosshairs, suit zoom overlay). I've been trying to track down a way to make it render regardless, but without any results. I've tried to force the Paint() function call within PaintTraverse() inside Panel.cpp, but it doesn't call my desired code.> So I would like to ask if anyone knows a solution to this problem, because at the moment I am left clueless.> — You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub[1], or mute the thread[2].>
Links:
Thanks a lot for your response. I've tried using PANEL_ROOT and it seems to work exactly like I wanted. The hud element is drawn while the main menu is closed and when its open. Thanks again!
This is similar what I was going to do, thanks for the useful information. 👍
Btw, is there a way to control the depth layering of the hud elements? I want to specify which elements should be drawn on top of others.
You can use the zpos res file property when you use ApplySettings or the equivalent C++ function. (https://wiki.empiresmod.com/Panel)
Closing as this appears to have been resolved.
So I've been trying to make it so a vgui hud element that is supposed to be rendered would continue to render when the main menu is displayed. This Element is supposed to work as an in game overlay on the screen when the players is withing the game world. However, it's Paint() function doesn't get called if the main menu is rendered. This seems to mimic the same behaviour that all the other player hud elements perform (like health, crosshairs, suit zoom overlay). I've been trying to track down a way to make it render regardless, but without any results. I've tried to force the Paint() function call within PaintTraverse() inside Panel.cpp, but it doesn't call my desired code.
So I would like to ask if anyone knows a solution to this problem, because at the moment I am left clueless.