I have an issue with resizing the game window and getting accurate values from get_physical_size and get_mouse_pos functions and I'm unsure if I'm missing something or if this is a bug. Have been reading through some of the documentation pertaining this but haven't found anything that would explain this behaviour.
I have attached a small example project where anyone can test this if they want, but below is the code in it's entirety for this test.
Code: Select all
init python:
def show_info():
print("physical size = {}".format(renpy.get_physical_size()[0]))
print("mouse pos = {}".format(renpy.get_mouse_pos()[0]))
screen my_screen:
modal True
key "K_SPACE" action Function(show_info)
label start:
call screen my_screen
return
In my test, I launch the game, resize the window to be maybe around 30 - 50% smaller, then press the start button of the game menu.
I then position my mouse in a location on the x-axis inside the game window, press space, then move to another location further to the right, press space etc., always within the game window.
Then afterwards, I check the log to see what has been printed out, and I find that even though I've always stayed inside the game window, the output shows the last time I pressed space, the x position of the mouse is a larger value than the actual size of the window.
Screenshot of the console below from one of these tests:
I can't make any sense of why this happens. I'm trying to make this work in an actual project and have kind of hit a snag with the results of this. Does anyone know the reasons for this happening? Should I perhaps file this as a bug?
Thanks!