Attaching relative gui to train (locomotive) GUI
Posted: Wed Jun 03, 2026 5:37 am
according to all documentation (and the interwebs), this used to work in Factorio 1.1:
-- add an anchor to the topmost frame
anchor = {
gui = defines.relative_gui_type.train_gui,
position = defines.relative_gui_position.top,
},
and then attach this to `player.gui.relative` and you can get a (probably only very small) custom GUI attached to the main locomotive GUI.
This no longer seems to work in 2.0. Any attempt to open a custom GUI, it ends up in the middle of the screen. Looking through the forums I did not find anything and claude speculates that this has to do with the train_gui being fullscreen and therefore the engine unable to render the helper GUI.
Is that true? Is it not possible to attach a gui in a reasonable way to the train gui? Or what would one do? Grateful for any pointers.
-- add an anchor to the topmost frame
anchor = {
gui = defines.relative_gui_type.train_gui,
position = defines.relative_gui_position.top,
},
and then attach this to `player.gui.relative` and you can get a (probably only very small) custom GUI attached to the main locomotive GUI.
This no longer seems to work in 2.0. Any attempt to open a custom GUI, it ends up in the middle of the screen. Looking through the forums I did not find anything and claude speculates that this has to do with the train_gui being fullscreen and therefore the engine unable to render the helper GUI.
Is that true? Is it not possible to attach a gui in a reasonable way to the train gui? Or what would one do? Grateful for any pointers.