←back to thread

205 points samspenc | 1 comments | | HN request time: 0.204s | source
Show context
kg ◴[] No.45146889[source]
This is one scenario where IMGUI approaches have a small win, even if it's by accident - since GUI elements are constructed on demand in immediate mode, invisible/unused elements won't have tooltip setup run, and the tooltip setup code will probably only run for the control that's showing a tooltip.

(Depending on your IMGUI API you might be setting tooltip text in advance as a constant on every visible control, but that's probably a lot fewer than 38000 controls, I'd hope.)

It's interesting that every control previously had its own dedicated tooltip component, instead of having all controls share a single system wide tooltip. I'm curious why they designed it that way.

replies(3): >>45147379 #>>45147966 #>>45147993 #
1. bob1029 ◴[] No.45147966[source]
Unity uses an IMGUI approach and it makes all the difference in the universe. Overriding an OnDrawGizmos method to quickly get at an editor viz of a new component is super efficient. There are some sharp edges like forgetting to set/reset colors, etc, but I much prefer these little annoyances for the convenience I get in return.

AFAIK, UE relies on a retained mode GUI, but I never got far enough into that version of Narnia to experience it first hand.