I’ve run into a strange issue where gui.get_screen_position()
works if it’s called on init()
and then re-used. But if it’s called after init()
, and the screen has been resized, it returns the wrong position.
Please see a minimal example: Archive.zip (38.1 KB)
Scenario 1:
- Click the screen
- The rectangle travels from and to the right place
Scenario 2:
- Resize the window
- Click the screen
- The rectangle travels from and to the wrong place
On init()
I store the get_screen_position()
of the rectangles, and if they are re-used it works(!). I demonstrate this by firing a rectangle automatically after 3 seconds, which always move from and to the right place, regardless of screen resize.
I noticed that @AGulev has posted something that might solve this here, but I thought I’d see if this is expected behaviour or if I’m missing something.