is it possible to set display width and height value during runtime ?
socheat.khauv | 2016-07-23 19:41
You don’t really need to, these settings are supposed to do that automatically for you. Did you tried the “2d” stretch mode?
The only difference on mobile is that you have a fixed resolution. It’s like having a window that you can’t resize (so in the end you can test it on PC, it works the same).
Other than that, I don’t understand what is the actual problem that leads you to ask this question
Zylann | 2016-07-23 19:46
The problem is that.
now I am testing on Google Nexus 4,
its screen size is 1280x768
which has ratio of 5x3
Scene → project settings → Display
if I set width and height, 800x600 (4x3), and maintenance radio scale by either horizontal or vertical,
it will show a black bar some how horizontally or vertically direction.
and I don’t want to have that black bar and also want to to scale without losing radio
That why I would like set (Scene → project settings → Display width and height during runtime)
I will do calculation to find its width and height. in my example cases
it will be 800x480.
socheat.khauv | 2016-07-23 20:25
Oh… I see, the problem is the black margins then?
If you set stretch_mode to disabled and stretch_aspect to ignore, resizing the window will simply change the resolution of the cameras.
If you need to keep it centered, you can reset the position of the camera to whatever you need it centered on. Just in case, there is a size_changed signal in Viewport that you can listen to.