Wayback Machinekoobas.hobune.stream
May JUN Jul
Previous capture 12 Next capture
2021 2022 2023
1 capture
12 Jun 22 - 12 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 datHindLeg · Jun 28, 2019 at 04:45 AM · tilemapaspect ratio

How do I adjust my tilemap for different aspect ratios?

I'm having a difficult time scaling my game to fit different phone device aspect ratios. I have gotten a hang of how to scale UI elements via layout groups and canvas scalars, but I don't know how to scale tilemaps/grids.

My game is based around a grid/tilemap and I'm trying to maintain a 6x7 size grid. I develop using a 1920 by 1080 ratio (portrait), and my grid/tilemap seems stuck in this aspect ratio. When trying out 2960x1440 (portrait) my grid tiles don't fit into the screen (the x axis gets cut off). I tried fiddling with the Camera and I can make the 6x7 fit here by adjusting the localScaleSize, but this makes the grid very small which I don't want. What I want to do is adjust all the cell sizes so that the cells fit the screen in 6x7, whatever the cell size becomes.

How should I approach this?

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

2 Replies

· Add your reply
  • Sort: 
avatar image
1

Answer by datHindLeg · Jul 01, 2019 at 06:49 AM

Found the answer for this: via reddit: https://www.reddit.com/r/Unity2D/comments/c7ju7s/how_do_i_adjust_my_tilemap_for_different_aspect/

Their are three things you can do to fit a different aspect ration, you can decide which works best for you.

Zoom the camera to fit all of the vertical space but scroll to see all the horizontal.

(It sounds like this is what you did) Zoom out to fit all the map but with a lot of empty space on the top and bottom.

Stretch the tiles vertically so the map will fit in the screen but the tiles will be rectangles now. This usually is not what you want but maybe it is.

There isn't really a way you can make a 16:9 map fit a non 16:9 aspect ratio without one of these options. Personally I'd just make it so the player can zoom in or out as they see fit and they can choose if they prefer option 1 or 2 or an even more zoomed in version and they can also change between these at will.

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

Answer by webjaros · Feb 17, 2021 at 12:26 PM

You can also letterbox the view. Take a look at this tool for example: https://github.com/rabidgremlin/LetterBoxer

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

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

Related Questions

tilemap.SetTile not working for animated tiles 1 Answer

How can I find the name of the tile that I collided with in 2d? 1 Answer

How to assign individual data to a tiles? (Unity3D Tilemap) 0 Answers

How do I replace a tile in TileBase : GetTileData 0 Answers

Grid doesnt match with the tilemap PLEASE HELP 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