Analysis of approaches to adaptive layout and element identifiers in Immediate Mode GUI for its use in Unity
DOI: 10.31673/2412-9070.2025.022617
DOI:
https://doi.org/10.31673/2412-9070.2025.022617Abstract
Immediate Mode GUI (IMGUI) is widely used for creating graphical user interfaces in programming. Many modern libraries implement this paradigm to enable dynamic, real-time rendering of interface elements. The use of IMGUI allows for efficient redrawing of interface components every frame and direct handling of user interactions through function calls.
However, IMGUI presents challenges related to the adaptive layout of elements and their identification between frames. This paper examines two key issues of IMGUI: adaptive layout and element identification. Various approaches to solving the adaptive layout problem are analyzed, including methods that require re-execution of code or introduce a one-frame delay in program response. It is determined that the delayed input approach is more promising.
The study also explores mechanisms for identifying interface elements between frames, including automatic and developer-defined generation of identifiers. Based on the analysis, it is concluded that in the Unity environment, the most optimal method for element identification is hashing text labels, which ensures a balance between implementation convenience and system performance.
The results obtained provide a foundation for the further development of IMGUI libraries in the context of modern requirements for the performance and flexibility of user interfaces. The application of the proposed approaches will simplify the development of in-application interfaces in Unity, making them more integrated into the ECS architecture and more convenient for developers. This opens up prospects for creating a universal tool for building fully functional dynamic interfaces in modern gaming and interactive applications.
Keywords: IMGUI, GUI, adaptive layout, library, paradigm, architecture, approach, identification.