• 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
Question by vspin · Oct 27, 2016 at 06:43 AM · 2dsizeviewportworldpixels

How to maintain world and game object pixel size no matter the screen size?

(Unity 5.5.0b8)

I can't seem to find the right terms to find the answer to my question, and I would imagine it's been asked many times, so I apologies in advance..

I'm trying to create a 2D isometric game world. My game will have a scrollable game world (entire map) and viewport (the client's viewable area). The client will only view part of the world depending on their screen size (viewport). My world and the game objects within should maintain their actual pixel size no matter the device used to play the game.

How can I accomplish this (roughly)? Everything I do seems to scale my world and game objects depending on the screen size.

Comment
Glurth

People who like this

1 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 NoseKills · Oct 27, 2016 at 02:54 PM 0
Share

Can you elaborate on what you mean by "actual pixel size"? Do you mean you want an 8x8 image to use 8x8 pixels on the screen no matter the device resolution?

avatar image vspin NoseKills · Oct 27, 2016 at 02:59 PM 0
Share

Yes. If I have an 8x8 pixel image in the game world, I want it to display as an 8x8 pixel image, no matter the screen resolution. Thanks :)

avatar image suicune2001 · Oct 28, 2016 at 12:43 AM 0
Share

If I understand your question correctl, you need to work with the Anchors. It's those little triangles you see either clustered in the center of the Canvas or around your image. They are very useful when making 2D menus to keep them in place no matter what screen resolution you have. Just click and drag the arrows to be the exact spot you want that picture / text / button to always be.

1 Reply

  • Sort: 
avatar image
Best Answer

Answer by Glurth · Oct 27, 2016 at 03:34 PM

http://answers.unity3d.com/questions/588432/why-2d-camera-is-not-pixel-perfect.html perhaps this will help? I've never tried tonic's answer- looks like it should work though.

Comment
vspin

People who like this

1 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 vspin · Oct 27, 2016 at 07:46 PM 0
Share

Thank you. :) It works.

avatar image Glurth · Oct 28, 2016 at 07:06 AM 0
Share

great! and thx to whoever converted my comment to an answer :) May I suggest, lets all upvote the linked-to question, and tonics answer?

Unity Answers is in Read-Only mode

Unity Answers content will be migrated to a new Community platform and we are aiming to launch a public beta by June 9. Please note, Unity Answers is now in read-only so we can prepare for the final data migration.

For more information and updates, please read our full announcement thread in the Unity Forum.

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

Unity 2D: Size of a sprite proportional to the size of the viewport? 0 Answers

Fix a GUI's position relative to a 3D object 1 Answer

Get cursor size in units, not in pixels. (Unity 2D) 0 Answers

changing nested prefab's size 2d,changing a prefab's size 0 Answers

Get width and height of Image in Unity 4.6 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