First of all, all interface textures are drawn in a window with a resolution of 1024x768, and then scaled to the window's resolution. Therefore, when creating a mod with an interface, you need to calculate (the position and occupied size of the window element) based on 1024x768.
Attachment 69883 Attachment 69884
Initially, I planned something like in the screenshots below.