I want a scalable game window that when resized stays at 16:9 aspect ratio. The goal is for the user to be able grab the window on the right or bottom and resize it. The game should adjust the corresponding side of the view-port to lock the aspect ratio. I've tried forcing certain values in the update line of a script on the camera, but it did not work. the game is 2d and most of the elements are scripted using the gui functions. I'm having a very hard time finding exactly what I'm looking for as it is, most of what I've found is in an attempt to create black bars and keep the game from stretching, but that doesn't help ongui using matrices.
here are the resources I've tried so far
http://goo.gl/8FuyRC - this one is a script someone wrote that I attached to the main scene camera, I then built it, however that didn't work.
http://goo.gl/qZ5DAl - this is something from the unity website regarding camera aspect ratio. I put a line of code in the update function of my camera object
#pragma strict
function Start () {
}
function Update () {
Camera.main.orthographicSize = 3.596306;
}
as well as
#pragma strict
function Start () {
}
function Update () {
Camera.aspect = 1;
}
none of the above worked.
http ://goo.gl/MbTDcz - was the last thing I tried, and it just made some more black bars...
so far nothing has worked. not sure why. to reiterate, the goal I'm trying to accomplish is that, when the user grabs the edge of a windowed player, and drags it, the corresponding x or y axis will follow in suit to keep the aspect ratio the same.