- Home /
Changing web player window size, based on web window size
Hi there,
What im trying to do is allow my game window inside the web window to adjust as the web window changes size. I dont see any options for this under the build settings or player settings so i think this will be accomplished by editing the html file after the build. But i dont quite know what to edit! Has anyone tried this before? I tried adding this little bit of code to my html file right before (has unity) line where it looks like this type of stuff is built and transfered to the html from JS, but no luck.
var winH = 0; var winW = 0;
function Update(){ winH = window.innerHeight; winW = window.innerWidth; }
Then i added the varaibles to the document.write lines instead of the numbers that it was built with.
Am i close? Thanks for taking a look!
Answer by qJake · Apr 02, 2010 at 04:31 AM
You could just set the size of the ActiveX object in the browser to be the clientWidth and clientHeight using JavaScript (in the webpage, not Unity)... so nothing even has to be done in the game (other than making your game resolution-independent, which you should do anyway).
Your answer
Follow this Question
Related Questions
how i can save big text files in web player? 1 Answer
Auto scaling GUI 3 Answers
webplayer file size suddenly too large after update 1 Answer
Split webplayer build into smaller files? 1 Answer
Change size of unity webplayer? 1 Answer