Jump to content

Correct usage of UI for menus


StOneDOes
 Share

Go to solution Solved by Josh,

Recommended Posts

When it comes to rendering and interacting with different menus, can I assume that the correct way to do this is to have multiple Interface classes, where each Interface would represent a different menu. I'm assuming that you would not want to have every single widget on the same interface, otherwise it is probably going to be inefficient such that every widget would need to be iterated over by its parent each frame to determine whether it needs to be rendered or not. Presumably, if you hide the parent widget (ideally the root widget in this case), the widget would essentially have nothing to do when checked by the engine, and all its child widgets would be implicitly hidden also.

Is this an accurate analysis?

Link to comment
Share on other sites

  • Solution

Since the widgets are hierarchical, there is no downside to putting them all in one interface. If you hide the topmost parent for each sub-interface the children will not be iterated through.

  • Upvote 1

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

Ok I see what you mean. It shows when the panel is at 0,0 and matches the window size. The idea is to have the "root" widget per menu be used for nothing more than logical grouping for showing/hiding the entire menu. So ideally I would want to have the panel be invisible, so I can have a completely customized menu, and maintain efficiency at the engine level.

Link to comment
Share on other sites

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.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

 Share

×
×
  • Create New...