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 UnbreakableOne · Jan 06, 2014 at 01:36 AM · androidresolution

What base resolution you aim for when building for Android? (2D games)

Hi,

I'm well aware of Android's fragmentation problem and there is standard resolution for it, but for today's age of Android devices out there, what resolution you consider to be "average" when making your game?

For iOS it's usually iPhone 4's 960x640.

Thanks.

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 ArkaneX · Jan 06, 2014 at 01:43 AM 0
Share

@UnbreakableOne - I suggest to take a moment to read the FAQ and watch the tutorial video, both on the right side of this page. I refer especially to accepting the valid answers. Don' just ask question, read the answer and forget...

avatar image UnbreakableOne · Jan 06, 2014 at 02:25 AM 0
Share

I'm actually aware of the Answers mechanism, the reason I'm yet to mark any of my recent questions as answered is due to my daily routine and when I'm actually can get to apply the responses I get to the project.

After I can try out the replies and am able to solve, I'll mark them as answers accordingly.

It all comes that to having 2.5 jobs, I'm sorry if this caused any inconvenience.

avatar image ArkaneX · Jan 06, 2014 at 10:41 AM 0
Share

No inconvenience at all. The problem is that a lot of people just don't know the rules. In opposite to sites like SO, which are generally visited by people knowing how this kind of sites work, you can find a lot of users here, who simply ask, get answer and vanish.

Thank you very much for explanation, and I hope that you find a lot of solutions here :)

1 Reply

· Add your reply
  • Sort: 
avatar image
0

Answer by Briksins · Jan 06, 2014 at 09:59 AM

I dont think it is good solution to aim only for one resolution, there are really big segmentation in Android market, and you have to satisfy all of them.

Here is a tip for you, may be there are better solutions, but thats the way im handling various types of resolutions:

Unity can tell you at launch time it "Screen.Width" and "Screen.Height" each time on different devices it will be different and it will be nightmare to hard code sizes of GUI elements and other GO. What im doing is defining screen area in bloks or parts in percentage

for example you have simple menu with bottom menu bar where you have buttons and header bar where you have logo alt text

At this point you have no idea what size of the buttons in the bottom bar should be as resolution could be different, and you cant hardcode values for each of them.

what you can do is divide screen on parts, lets say 10 parts:

 int oneTenth = Screen.Height / 10;

alt text

That way it doesn't matter what resolution you are, the proportion of the screen still will be 1 out of 10 on each resolution. So you can set your button height to be equal one tenth of the screen.

The same with width: you know you need to fit 5 buttons at the bottom

so you go:

 int btnWidth = Screen.Width / 5; 

keep in mind that you dont want button to be very close to each other so you need to add some space or offset to each button

 int offset = 5; //5 pix offset for each button

so each your button should have 2 offsets from left and right like this:

offset|BTN1|offset|offset|BTN2|offset... etc.

so far you would have 10 offsets by 5px and 5 buttons, so the formula will be:

 int btnWdth = (Screen.Width - offset * 10) / 5; 

the same stuff related to the height. you got your one tenth of the screen, but you also can apply height offset within this one_tenth like this:

 //offset at the top and bottom of the button
     int btnHeight = oneTenth - offset * 2; 

that way your app will be scaled in correct proportion in any kind of resolution or platform

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

20 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 avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image

Related Questions

Android project debugging.. 1 Answer

resolution is squished horizontal on android 0 Answers

Mobile Game Different Screen Size Issue 2 Answers

Resolution for assets on Android 1 Answer

Resolution Multiplier on Android 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