Unity Facebook Instant-game Resolution
Hello everyone. I am developing a facebook instant game using unity2017. I also giving option to play on Facebook Messenger so that user can play it on iphone, android and web so now I want to handle resolution so that it can fit each and every resolution. How can i do this? i am trying with this code but unable to get correct result.
<div id="gameContainer" style="width: window.innerWidth; height: device-
height;"></div>
</div>
i found answer: function myGameResulotion() { document.getElementById('gameContainer').style.height = (window.innerHeight*window.devicePixelRatio) + "px";
document.getElementById('gameContainer').style.height = (window.innerHeight) + "px";
}
call this method from javascript
"gameContainer" is your html div id
call this in html body
Your answer
![](https://koobas.hobune.stream/wayback/20220612163838im_/https://answers.unity.com/themes/thub/images/avi.jpg)
Follow this Question
Related Questions
Keytool not found,,,i am new to unity, please help 2 Answers
I am getting this error in WebGL 0 Answers
Didn't loading facebook instant game 0 Answers
WebGL on LG Smart TV 0 Answers