Page 1 of 1

Relative GUI for static GUI elements

Posted: Tue May 04, 2021 6:47 pm
by raiguard
Just throwing this out there: It would be stupendously amazing if we could position GUI elements relative to the "static" GUI elements that are almost always shown. For example, the top-right GUI, the quickbar, shortcut bar, guns/ammo GUI, map editor GUI, etc. Right now it is possible to position elements like this by using hardcoded constants combined with display resolution and scale, but it is a very ugly method that is prone to error.

Thanks!

Re: Relative GUI for static GUI elements

Posted: Wed May 05, 2021 1:15 pm
by PFQNiet
+1

I would love to attach some gui to the hotbar, such as a custom additional progress bar (alongside health, shield, mining progress...) and other uses.

Re: Relative GUI for static GUI elements

Posted: Sun Feb 04, 2024 11:02 am
by SupplyDepoo
Is this possible yet?

Re: Relative GUI for static GUI elements

Posted: Sat Dec 28, 2024 7:36 pm
by i142857
+1 maybe now that raiguard is on the other side of the "fence"? :)

The relative gui system is so cool and it's so annoying to fall back to easily broken coordinate hacks :(

Re: Relative GUI for static GUI elements

Posted: Sat Dec 28, 2024 8:43 pm
by ownlyme
we already have player.gui.relative.add(...) .anchor = https://lua-api.factorio.com/latest/def ... e_gui_type

what we REALLY need is displaying these relative guis *above* the anchor gui.
currently they can only be displayed to the side...
for example you could display a bunch of extra stats in a crafting machine window, or i didn't need to manually calculate the inventory position for my https://mods.factorio.com/mod/market2 which is a HUGE hassle, doesnt look perfect and is generally a ridiculous solution.

that's what i tried to propose in player.gui.relative[].bring_to_front() ?
maybe i didn't explain it well

I've been waiting for this for 3 years. PLEASE make it happen

Re: Relative GUI for static GUI elements

Posted: Sun Dec 29, 2024 6:48 am
by picklock
+1

I also want an possibillity to displaying these relative guis *above* the anchor gui.

Re: Relative GUI for static GUI elements

Posted: Fri Apr 04, 2025 1:52 pm
by ownlyme
oh sorry, now i understand what you meant.
defines.relative_gui_type doesn't contain the quickbar, the weapon box, the map etc yet

was about to make a ui for induction charging and wanted to attach it to the weapons because that's where the battery is

Re: Relative GUI for static GUI elements

Posted: Fri Apr 04, 2025 5:42 pm
by Fabriken AGI
raiguard wrote: Tue May 04, 2021 6:47 pm Just throwing this out there: It would be stupendously amazing if we could position GUI elements relative to the "static" GUI elements that are almost always shown. For example, the top-right GUI, the quickbar, shortcut bar, guns/ammo GUI, map editor GUI, etc. Right now it is possible to position elements like this by using hardcoded constants combined with display resolution and scale, but it is a very ugly method that is prone to error.

Thanks!
I Agree. You mean like CSS's position: and align: ? Maybe in combination with some markup-like language for defining gui-hierarcies, sprinkled with inspiration from XAML/UWP?

Controversal take: hide the existing gui and overlaying pure web-tech-based rendering elements of chosen flavor, that subscribes to channels of events and data? I.E Angular+RxJS or *MQ-channels?

Re: Relative GUI for static GUI elements

Posted: Sun Apr 06, 2025 10:14 pm
by Rseding91
Now that Raiguard is a developer, he is free to implement this himself :)