Is using IMGUI for game UI a dumb idea?

I tend to find it easier to do things by writing codes than by other means, so when it comes to creating UI for my game project, I blindly chose IMGUI as it is said to be a ‘code-driven GUI system’ in the Unity manual.

However, the documentation also seems to discourage using it for anything other than editor extensions or debugging console. And the fact that the title of this forum contains the word ‘legacy’ in it sent me a big warning sign in my head.

So, would it really be a dumb idea to rely on IMGUI for creating a game UI? I’m planning to create a desktop like UI system, like one you can see in Eve Online or Second Life with it.

It seems that the both UI systems for now lacks some important features or controls to achieve that (I know there’s some commercial assets in the store, but I’d like to implement one on my own), and I already created a wrapper API around IMGUI as a starting point.

But I’m suspecting if there could be some serious road blocks along the way, if I stick to a ‘legacy’ system instead of a recommended one, or there could be a chance that more features will be added to the new system in future while the legacy one stays behind.

On the other hand, it’s my understanding that the old system is used for creating editor extensions, which is of course, one of the most important aspect of Unity. So, in this case, can I expect to get new features and improvements in future, even though it’s labeled as ‘legacy’?

I don’t really care if the new UI system can be easier to work with than the old one. But I’ll probably abandon IMGUI, if it’d be impossible to do certain things with it, while the new system is capable of doing so.

I doubt IMGUI will get any new features except maybe on the editor-only side.

I say use whichever one gets you to your goal most effectively. For programmatically-created UIs, there may be cases where IMGUI works better for you. Just be aware of how it works under the hood. For example, OnGUI is usually invoked multiple times per frame, once for each event (repaint, mouse move, mouse button change, keypress, etc.). And there’s significant overhead in invoking an OnGUI method, even if the method itself is empty.

2 Likes

@TonyLi It seems more and more like I better switch over to the new UI system. Thanks for the explanation! :slight_smile: