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 wijesijp · Apr 04, 2013 at 12:04 PM · resolutionpositioning

How to position game objects in different screen resolutions?

I have designed my game on 1280 x 800 screen. I have positioned objects on the screen using screen width and height as a reference, say 30% from left etc.

when i run the game on lower resolutions the objects are not in correct places. I thought that in small resolutions it will work automatically.

What is the standard methods used to display properly on all screen sizes?

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 flamy · Apr 04, 2013 at 01:04 PM 0
Share

are u resizing according to resolution as well?

avatar image moghes · Apr 04, 2013 at 01:15 PM 1
Share

can you post us some code of how you did it?

avatar image wijesijp · Apr 05, 2013 at 03:33 AM 0
Share

I have a Orthographic camera setup. for 1280 x 800 screen size i have the size at 400

I didn’t do anything special, I used following code to place object right side of the screen

 gameObject.transform.position = new Vector3(Screen.width,gameObject.transform.position.y,gameObject.transform.position.z); 

and following for the camera, to center it

 float usingHeight             = Screen.height;
 float usingWidth            = Screen.width;
         
         
 //camera.orthographicSize     = usingHeight/2;
 camera.transform.position     = new Vector3(usingWidth/2,usingHeight/2,0.0f);


in 1280 x 800 the object get placed nicely at the right edge, lower resolution they do not. But the objects size seems to be correct for say 480x320.

if I set the orthographicSize it might work, I don’t know how to calculate it properly

0 Replies

· Add your reply
  • Sort: 

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

12 People are following this question.

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

Related Questions

UI is positiont different when game is build. 1 Answer

Objects' position change depending on the resolution 1 Answer

How can I make my app high res for iPhone 4's retina display? 2 Answers

how I can change the screen resolution in real time? 1 Answer

Resize GUI for older iPhone versions 2 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