Open Seneral opened 8 years ago
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.
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:)
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.
So, is there a solution to use enum popup at runtime?
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.
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