- Home /
GUIs problem in iphone 3G and 4G
Hi everyone,
I've used GUI texture and GUI Text to make my layout, it works fine in iphone 3G.
But unfortunately, the position and scale of the images and content are totally wrong in iphone 4G.
Right now I just use 3D text to replace the GUI Text to solve that problem. But how about the GUI texture? Are there anythings can replace GUI Texture for putting images?
Or are there any java script can make the GUI Texture keep in the same place and same size, won't move around either iphone 3G or 4G?
Or I must make a 3D plane, and assign different material and put my images on it, is it the only way because I have so many images. Is it mean I have to make thousand 3d planes and thousand materials for putting thousand images?
Could anyone give me a big help? I 've already looked around many different places, but still don't understand the answers, sometimes is language problem , sometimes is programming problem.
Thank you so much~
Regards
Answer by Eric5h5 · Dec 01, 2010 at 05:08 PM
If you use GUITextures and GUIText (as opposed to OnGUI functions), then you don't need any programming. Remove any pixel inset values from GUITexture and use the scale only, and uncheck "pixel correct" on GUIText and also use the scale instead. GUIText/Texture use viewport space, so (.5, .5) for example is always the middle of the screen at either resolution.
Thanks Eric~ I found the "pixel inset"in GUI Texture's Inspector, and I tune the "X, Y, Width and Height" to 0.
But the ratio of the images are not correct, is it normal? Then I keeping fine tune the scale X and Y.
But I can't find the "pixel inset" and "pixel perfect" in GUIText, then I uncheck "pixel correct" and the text deform again, is it correct what I've done. Then I tune the scale X and Y by my eyes to get it right.
And where to put (.5,.5) ? Is it the scale X and Y? If so,can I put something like (.5, .3) because the text and texture deform.
Really thanks for your kindly help.
$$anonymous$$oreover, Ins$$anonymous$$d of using GUITexture and 3D plane, are there any other way to put 2d images in Unityiphone?
THAN$$anonymous$$ YOU SO $$anonymous$$UCH
Yes, you're supposed to tune the X/Y scale to get the ratio correct. Sorry, by "pixel perfect" I meant "pixel correct", and no, there is no pixel inset in GUIText, that was supposed to be GUITexture. Use whatever values for the x/y transform position and scale you need to get it to look right. GUITextures/3D planes are the only way of using 2D images, actually everything 2D in Unity is technically 3D planes, even GUITexture.
Really Thank you so much, Eric, everything is very clear right now~ Thanks!!!! I've posted my app already, and I will update the new one which fix all that GUI problems. And it's for free right now. If you interest in $$anonymous$$ung Fu, you can go to download it. $$anonymous$$y app is called "Cockroachman's kung fu 101" Again, THank you so much~~
Your answer
Follow this Question
Related Questions
Unity iPhone 4 Gyroscope functions?? 1 Answer
unity iphone project size issue. 2 Answers
Use same code for iOS, Android and Web Player 1 Answer
getting started with unity. 1 Answer
Prime31 integration. 1 Answer