i Have Unty iPhone Pro 3.0 and when i use Screen.currentResolution always returns 640x480
in any setting Free Aspect , iphone , ipad , iphone 4 always returns 640x480 .
I tried to use Screen.SetResolution (480, 320, true); but always the same .
Does anyone know why?
Thank you
Scinfu
set resolution has no impact on the editor.
to change the screen size, use the dropdown above the game window and switch it to whatever you want it to be
Dreamora:
set resolution has no impact on the editor.
to change the screen size, use the dropdown above the game window and switch it to whatever you want it to be
But if i use Screen.currentResolution always returns 640x480 , Why ?
did you change the screen resolution of the game window?
and where do you get that data, in start or awake? (it seems like the data initially might not be correct at the time, especially in awake according other threads on the board)
in Setting is set landScape left
in editor is set iPhone Wide (480x320)
i Use Screen.currentResolution in function Start()
Thank you
The player settings have no impact on the remote but the rest should actually make it return 480x320 … so the problem is still there I guess.
In this case use this coroutine (or its unityscript counterpart), I think this one works:
int width;
int height;
void Start()
{
StartCoroutine(GetScreenData());
}
IEnumerator GetScreenData()
{
// ensure we are in world simulation
yield return null;
yield return null;
height = Screen.height;
width = Screen.width;
yield break;
}
Thank you Screen.width and Screen.height work fine .
hmm also in the base case? if so please ensure to file a bug if its only currentResolution that bugs it and your code shows that
with this code
function Start()
{
print(Screen.width);
print(Screen.height);
print(Screen.currentResolution.width);
print(Screen.currentResolution.height);
}
i have this result
480
UnityEngine.MonoBehaviour:print(Object)
Screeen:Start() (at Assets/Screeen.js:3)
320
UnityEngine.MonoBehaviour:print(Object)
Screeen:Start() (at Assets/Screeen.js:4)
__640__
UnityEngine.MonoBehaviour:print(Object)
Screeen:Start() (at Assets/Screeen.js:5)
__480__
UnityEngine.MonoBehaviour:print(Object)
Screeen:Start() (at Assets/Screeen.js:6)