because of several reasons (performance among other reasons) I want a screen resolution of 480x320.
I set following properties in the AndroidManifest.xml like described in this thread.
With this settings I have a border on the right of my screen as expected (nexus one). In Unity 3.2 the main frame is rendered twice in vertical alignment within this border… that was not expected.
What I want is a black border left and right. I can achieve that when I add this line to my main activity:
getWindow().setLayout(480, 320);
Now it looks exactly like I want it. Unfortunately I get the titlebar as soon as I add that line and android:theme=“@android:style/Theme.NoTitleBar” takes no effect anymore.
I tried to hide the titlebar programmatically with no success.
Has anybody a solution for this issue or any ideas how it could be solved?
I figured out that if I add android:theme="@android:style/Theme.NoTitleBar.Fullscreen" to the androidmanifest.xml file the titlebar is hidden the first time and I have a window dimension of 480x320. That’s what I wanted to achieve.
Unfortunately it works only the first time I start the app. The titlebar is back again on the second launch (without compiling) - definitely the most stubborn titlebar I’ve ever seen.
I know that it is not a Unity issue but an Android issue. Anyhow I posted the issue because I can imagine that some Unity game developers want to set low res on Android to get some more performance.
I have tried this on a nexus one and if you call Screen.setResolution() in a Start function it will force the back buffer resolution to what you set it to. The application will then display fullscreen in the desired resolution.
On my Galaxy S, everything is stretched even when I set the resolution to 320 x 480. So I set camera’s pixelRect width and height and it works pretty well for me.
do we can force the set the resolution for any phone resolution to our resolution? i have coded the menu gui controls for 320*480, if we set like yours,does it menu stretched automatically on higher resolution like xperia arc?