Wayback Machinekoobas.hobune.stream
May JUN Jul
Previous capture 11 Next capture
2021 2022 2023
1 capture
11 Jun 22 - 11 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 tamoor_ashiq · Aug 14, 2015 at 06:04 AM · android2d game

Android Game screen resolution

In android development we use different image size for different screen resolutions. like hdpi,ldpi,mdpi, and so on ... How to use images for different screen resolution in android 2D game.....

Comment
Add comment · Show 1
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 itsharshdeep · Aug 14, 2015 at 08:00 AM 0
Share

Use Canvas ...

if you are not familiar with this pls visit

https://unity3d.com/learn/tutorials/modules/beginner/live-training-archive/the-new-ui https://www.youtube.com/results?search_query=unity+canvas+tutorial http://docs.unity3d.com/$$anonymous$$anual/UICanvas.html

2 Replies

· Add your reply
  • Sort: 
avatar image
0

Answer by Suraj. · Aug 14, 2015 at 06:34 AM

Did not really understand your question. However I can tell you what I do. I use screen aspect ratio as 16:9 lets say for landscape. And use UI canvas as 1280x720. And for 2D sprites, you can overide settings and limit resolution and so on. Also I would like to know which version of unity are you using?

Comment
Add comment · Show 1 · 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 tamoor_ashiq · Aug 15, 2015 at 09:29 AM 0
Share

i am using unity 5.0.0. i really want to fit my sprites to work for all android screen resolutions. I know about UI canvas but i want my sprites to work for all screen resolutions. ?

avatar image
0

Answer by Rad-Coders · Aug 15, 2015 at 11:13 AM

If you are scripting the UI you can always draw lets say a image on the screen by saying what percentage of the screen it should be taking up so you can say something like this

 void Start()
 {
 private float screenWidth = Screen.width;
 private float screenHeight = Screen.height;
 }
 
 void OnGUI()
 {
   GUI.drawTexture(new Rect(screenWidth*0.1, acreenHeight*0.1, screenWidth*0.5, screenHeight*0.5), yourTexture, scalemode, true);
 }


That snippet would give you a basic idea of what I am trying to say

Comment
Add comment · 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

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

5 People are following this question.

avatar image avatar image avatar image avatar image avatar image

Related Questions

How to choose a size/resolution for the sprites used as game assets in Unity2D ? 2 Answers

Unity 2d game Does NOT work with these devices: Samsung Galaxy Grand - Galaxy j1 - Galaxy Grand prime 0 Answers

low fps on android game?2D 4 Answers

Why experimental 2D Light not working on android? 1 Answer

PLayer not landing afteer jumping,Player jumping by clicking button 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