- Home /
Unity camera Cropping
hi,lets say i select the iPhone 4 resolution 960*640 and setup everything according to that (buttons,images etc) now when i go for 480*320 or any 3:2 aspect ratio it's working fine.Now when i switch my resolution to 854*480 nothing crops or scape from height but width there are empty spaces that means unity maintain everything same on height but width is an issue ,how can i do the same as unity does with height ?
I tried rect component to resolve this issue any suggestion plz advise
Answer by taxvi · Dec 11, 2014 at 08:53 AM
I bet you're using actual numbers to define position/size of your elements. if you want everything to scale together with the screen resolution you should use the Screen object, like the size of this rect will always have the same ratio with the screen size:
myRect = new Rect(Screen.width / 3, Screen.height / 4, Screen.width / 3, Screen.height / 2);
H Taxvi,when a new camera placed its view-port rect size is (0,0,1,1) if i place myRect the camera rect will be so big it will not see the image
Answer by alok-kr-029 · Dec 11, 2014 at 10:00 AM
Can you specify the camera type you using orthographic or perspective if you using orthographic camera and fimilar with tk2d use camera anchor