Page 1 of 1

custom gui in tips and tricks simulation

Posted: Thu Jul 09, 2026 12:35 pm
by mystify
I am trying to make tips and tricks pages for my mod, and want to show demonstrations of using the new gui elements I've added. however, I can't seem to get game.simulation.get_widget_position to locate my new elements, and retreiving it directly from the player.gui doesn't seem to be able to either simulate a click on it or find the screen location to simulate the mouse movement for.

Am I missing how to actually retreive the gui elements with get_widget_position for modded guis? I've seen stuff suggesting this only works for the vanilla gui. Or is there another approach to demoing mod guis that people have used?

Re: custom gui in tips and tricks simulation

Posted: Thu Jul 09, 2026 4:55 pm
by Osmo
What element are you trying to get position of? Only certain types of elements with certain content work. But for modded guis, you can place a child label with 0 size inside an element, and target it with get_widget_position by its caption, as a hack to make any element targetable.

Re: custom gui in tips and tricks simulation

Posted: Thu Jul 09, 2026 6:54 pm
by mystify
Right now its a choose-elem-button