Hi,
I’m trying to make a fullscreen start image (just an image with some instructions) that you can click away to start the game.
So I’ve decided to add a GUI.Button with:
if (GUI.Button(new Rect(0,0,Screen.width*horizRatio,Screen.height*vertRatio), _splash[_sstate], GUIStyle.none)) {
_sstate=1;
}
_splash is a GUITexture Array with an image and a blank slot (_sstate 1).
But the button only looks good in 800x480. It won’t be scaled bigger when I switch to a different size. And if I use a bigger image and scale it down I have problems to position it in the middle.
Do I have to use a seperate image for all aspect ratios and sizes?
Ok, thanks. I’ve added a guitexture. That looks better. But how can I put the guitexture in front of the my other game gui.buttons (inside OnGui())? If I change the z-order it doesn’t do anything.
I don’t think you can draw on top of OnGUI elements. You might need to just add logic to your OnGUI to skip drawing if the instruction screen is visible.
ok i’ve change all GUI stuff to GUITextures and it works fine now inside Unity. Switching resolutions works as expected, menubar is always at the bottom. BUT when I export it to my Nexus S I have a strange problem:
Screen.width / height is 800x480.
landscape left
fullscreen splash is set to scale 1,1,1
menubar is set to y 1
inside unity it looks fine but on the device everything is stretched about 35px in y! Any idea why?