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
1
Question by missypooh · Jan 25, 2012 at 03:45 PM · guiscene-view

Display not the same as expected

I would like to ask regarding the display problem.

I try running my games on the Unity web player, but some of the display are not shown as what it is expected. For example the guiText, it is different from the editor and the webplayer. Another issue is the onGUI, how come it will display differently. I do not know whether i did explain clearly what i want to ask. But overall, i want to know what can i do to make sure that everything display according to what i expected it to be. Like the guiText, OnGUI, guiTexture etc.

Thank you and sorry for the poor explanation

Comment
Add comment · Show 3
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 syclamoth · Jan 25, 2012 at 03:58 PM 1
Share

If you can't explain it, try posting screenshots.

avatar image by0log1c · Jan 25, 2012 at 04:32 PM 0
Share

Are we talking about resolution issue?

avatar image missypooh · Jan 25, 2012 at 04:51 PM 0
Share

hello. Yes. I think is the resolution problem. For example, this guiText is supposedly to be display in the center, but when it run on webplayer, it is at the top left corner.

1 Reply

· Add your reply
  • Sort: 
avatar image
0

Answer by Chris 26 · Jan 25, 2012 at 05:17 PM

I guess your problem is that you just take numbers like

x = 100, y = 50

for the positioning, instead you should use "Screen.width" and "Screen.height", to make sure a change of screen resolution does not destroy your layout.

For example

GUI.Box (new Rect (Screen.width/2,Screen.height/2,100,50));

you can also multiply the width and height of the box or an offset with Screen.width and height if you want that it scales with the resolution.

Comment
Add comment · Show 2 · 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 missypooh · Jan 27, 2012 at 03:23 AM 0
Share

yes. i did it that way. GUI.Window(0, Rect((Screen.width/2)-10, (Screen.height/2)-150, 330, 240), showDetails, "How To Play Click && $$anonymous$$atch!!!");

But my guiText i edit the position through the inspector. How am i going to solve it??

avatar image Chris 26 · Jan 27, 2012 at 01:43 PM 0
Share

Not sure if I got what you want but if you mean you want to edit the position of the guiText in the inspector you just need to declare yourself variables like

float offsetX; float offsetY;

then you write

GUI.Window(0, Rect((Screen.width/2)+offsetX, (Screen.height/2)+offsetY, 330, 240), showDetails, "How To Play Click && $$anonymous$$atch!!!");

and then you need to set the variables in the inspector, you can do the same for the width and the height of the button. Hope that was what you wanted to know.

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

7 People are following this question.

avatar image avatar image avatar image avatar image avatar image avatar image avatar image

Related Questions

How to make buttons in scene view? 1 Answer

Make a Button out of a Textured Plane 2 Answers

GUI Textures problem 1 Answer

blood splatter 3 Answers

Integrating CefSharp into Unity 0 Answers


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