|
How do I modify Camera's read only fields pixelWidth and pixelHeight? I intend to configure my camera to contain 1024 pixels in width and 768 pixels in height. Thanks! :D
(comments are locked)
|
|
Use the screen api: http://unity3d.com/support/documentation/ScriptReference/Screen You can use this to get the available resolutions and then call: http://unity3d.com/support/documentation/ScriptReference/Screen.SetResolution.html There is also this which you can use to set the pixel rect for the camera http://unity3d.com/support/documentation/ScriptReference/Camera-pixelRect.html
May 18 '12 at 11:17 AM
RoflHarris
I'm sorry, but that doesn't answer my question. You refer to changing the resolution of the screen, not the camera. I want to change these values: http://unity3d.com/support/documentation/ScriptReference/Camera-pixelWidth.html http://unity3d.com/support/documentation/ScriptReference/Camera-pixelHeight.html Thank you. :D
Jun 07 '12 at 07:08 AM
brain56
I dont think that it will get modified. These values are read only.
Jun 07 '12 at 07:19 AM
hirenkacha
Is that so? Can you recommend a workaround to my problem? I want to use ScreenToViewportPoint() and get an accurate translation given an arbitrary position, but since the values of pixelWidth and pixelHeight are fixed, I can't do it.
Jun 08 '12 at 05:02 AM
brain56
(comments are locked)
|
|
If you're still looking for the answer, this worked for me: That positions it at 512px left of the right edge and 256px below the top, 384px wide and 96px tall. You can of course adjust all the numbers to whatever you want.
(comments are locked)
|
