As we know, the mobile devices' ratio are different, mostly is 16:9 or 21:9. To fit this two ratio, I made a system to toggle the display reatio between 1920x1080 and 1920x900, by using gui.rebuild and reset physical size on renpy 7.3.5. The code would be like:
Code: Select all
init python:
def screenheight():
if persistent.displayss==1:#if player chooses 16:9
config.screen_height=1080#adjust the height to 1080, so the size would be 1920x1080
gui.ratio=1.0#I define this variable to adjust the position of all the items in my screen
gui.rebuild
renpy.reset_physical_size()#adjust the physical size
preferences.fullscreen = True
renpy.force_full_redraw
else:#if the play choose 21:9
config.screen_height=900#adjust the height to 900, so the size would be 1920x900
renpy.reset_physical_size()
gui.ratio=0.5
gui.rebuild
preferences.fullscreen = True
renpy.force_full_redraw
if players choose 21:9, it would be like:
However, this reset physical size didn't work like above in renpy 7.4.0.
In renpy 7.4.0, if I set gui(1920,1080), it would be always in this physical size. The code is the same, but here is the difference when I launch 16:9 and 21:9
In 16:9, it works just as above.
but in 21:9, it would be like:
Which you can see, the physical size is still 1920x1080(16:9), the only thing adjusted is the position of every object.
(and plus, I don't know why but for some reasons perference.fullscreen also didn't work well: even the code I only set "preferences.fullscreen=True", it works like toggling from False to True, like the first click = False, and second =True.
Is there any way the physical size can be adjust as renpy 7.3.5?
I hope I explain my problem well. If not, I'm happy to share some videos to show the difference of the same code work on renpy 7.3.5 and renpy 7.4.0.
Thank you very much for reading! Hope we can solve this problem together