Skip to content
This repository has been archived by the owner on Oct 31, 2023. It is now read-only.

OverlayGUI (Popups) #38

Open
Seneral opened this issue Feb 18, 2016 · 5 comments
Open

OverlayGUI (Popups) #38

Seneral opened this issue Feb 18, 2016 · 5 comments

Comments

@Seneral
Copy link
Owner

Seneral commented Feb 18, 2016

Description: For the Node Editor to properly work at runtime, we need support for all kinds of popups (GenericMenu, EnumPopup, IntPopup, etc., even Tooltip). This will also fix some bugs regarding node focussing problems, as these will not block user input straight away when clicking it (even the first click event). Additionally, this will open up the possibility to let them account for the zooming - respective built-in controls will simply ignore the GUI scaling:/

State: This is easily possible using the Popup Engine I already made for the GenericMenu to work.

Location: OverlayGUI.cs and RTEditorGUI.cs for implementing new popups

@yeneZan
Copy link

yeneZan commented Jun 7, 2016

When curEditorState.zoom != 1,the hint&popups wouldn't draw on the node.It troubles me the whole daytime,but I have no idea what's the renderring space when use the GUI class instead of GUILayout.
I was trying to fix it with GUI.BeginArea(Node.rect) but failed. I'm looking for your suggestion, thank you.

@Seneral
Copy link
Owner Author

Seneral commented Jun 7, 2016

That's an internal error of Unity. Apparently they considered the GUI scaling not as important to adjust popups, generic menus and tooltips to it:/
So these elements do not consider that their controls have been scaled and so they are offsetted very weirdly.
I'm partially trying to fix this, by replacing these messed controls. This is why the context menu in this framework is not looking the same as it does in the rest of the editor, because it's a custom one that accounts for scaling:)

@yeneZan
Copy link

yeneZan commented Jun 8, 2016

That's what I explained to my teammates.I just want to check out whether you guys have any idea.
As I say above, GUI.BeginArea(Node.rect) could make these draw at a certain point. But the position would also be influenced with scaling and window size. And I try a function to make this position come close to the node. It do work but because of some mistake it still not render correct,so I finally make scale become 1.

Finally, I want to show you my usage and thank you for your answer and great work.

image

@Seneral Seneral mentioned this issue Jun 29, 2017
@thinklikeanarchitect
Copy link

So, is there a solution to use enum popup at runtime?

@Seneral
Copy link
Owner Author

Seneral commented Oct 1, 2018

Not one that I know of. I've had plans to extend this - which isn't too hard given the base of the popups already in the framework - but not came to this so far. OverlayGUI is where I would put it, if you want you can check it out and see if it's something you want to tackle yourself.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

3 participants