Handling floating UI

I assume BBS used this for positioning UI relative to window size so that it would for example float relative to the window sides / corners / edges. Any tips for doing this?

1 Like

We store the render.get_window_width() and render.get_window_height() in a Lua module so that it can be accessed by the floating gui when it’s animating in from the side to the middle of the screen.

2 Likes

Good to know for sure. Making an example which has floating UI and includes one of your render scripts.

By the way, I also mean the top bar (which positions at the top of the window no matter window size?) and the buttons in the lower left corner on the map screen.

1 Like

Got it all working nicely. Making a thing that will give: top left corner, top center, top right corner… of window translated to game space etc. for more customizable relative positioning of floating UI.

edit: Thinking it should be north west, north, northeast etc. to follow what GUI already uses? The existing built in anchors use left / right / top / bottom terminology though.