Wayback Machinekoobas.hobune.stream
May JUN Jul
Previous capture 13 Next capture
2021 2022 2023
1 capture
13 Jun 22 - 13 Jun 22
sparklines
Close Help
  • Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
  • Asset Store
  • Get Unity

UNITY ACCOUNT

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account
  • Blog
  • Forums
  • Answers
  • Evangelists
  • User Groups
  • Beta Program
  • Advisory Panel

Navigation

  • Home
  • Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
    • Blog
    • Forums
    • Answers
    • Evangelists
    • User Groups
    • Beta Program
    • Advisory Panel

Unity account

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account

Language

  • Chinese
  • Spanish
  • Japanese
  • Korean
  • Portuguese
  • Ask a question
  • Spaces
    • Default
    • Help Room
    • META
    • Moderators
    • Topics
    • Questions
    • Users
    • Badges
  • Home /
avatar image
0
Question by kelvin Ng · Dec 01, 2010 at 04:57 PM · unityiphone

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

Comment
Add comment
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users

1 Reply

· Add your reply
  • Sort: 
avatar image
0
Best Answer

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.

Comment
Add comment · Show 4 · Share
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image kelvin Ng · Dec 02, 2010 at 02:09 AM 0
Share

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.

avatar image kelvin Ng · Dec 02, 2010 at 02:20 AM 0
Share

$$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

avatar image Eric5h5 · Dec 02, 2010 at 04:02 AM 0
Share

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.

avatar image kelvin Ng · Dec 03, 2010 at 01:23 AM 0
Share

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

Hint: You can notify a user about this post by typing @username

Up to 2 attachments (including images) can be used with a maximum of 524.3 kB each and 1.0 MB total.

Follow this Question

Answers Answers and Comments

No one has followed this question yet.

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


Enterprise
Social Q&A

Social
Subscribe on YouTube social-youtube Follow on LinkedIn social-linkedin Follow on Twitter social-twitter Follow on Facebook social-facebook Follow on Instagram social-instagram

Footer

  • Purchase
    • Products
    • Subscription
    • Asset Store
    • Unity Gear
    • Resellers
  • Education
    • Students
    • Educators
    • Certification
    • Learn
    • Center of Excellence
  • Download
    • Unity
    • Beta Program
  • Unity Labs
    • Labs
    • Publications
  • Resources
    • Learn platform
    • Community
    • Documentation
    • Unity QA
    • FAQ
    • Services Status
    • Connect
  • About Unity
    • About Us
    • Blog
    • Events
    • Careers
    • Contact
    • Press
    • Partners
    • Affiliates
    • Security
Copyright © 2020 Unity Technologies
  • Legal
  • Privacy Policy
  • Cookies
  • Do Not Sell My Personal Information
  • Cookies Settings
"Unity", Unity logos, and other Unity trademarks are trademarks or registered trademarks of Unity Technologies or its affiliates in the U.S. and elsewhere (more info here). Other names or brands are trademarks of their respective owners.
  • Anonymous
  • Sign in
  • Create
  • Ask a question
  • Spaces
  • Default
  • Help Room
  • META
  • Moderators
  • Explore
  • Topics
  • Questions
  • Users
  • Badges