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
0
Question by Longman1981 · Nov 08, 2018 at 07:11 AM · 2dcanvasgameobjectsarchitecture

Should UI Canvas be used for games similar to 2048?

Hi guys. I'm trying to create a game that looks similar to 2048, however every tutorial I see about 2048, or even match 3/candy crash etc all seem to use UI canvas. I thought that would be wrong, I mean it doesn't seem natural for me. Besides I'm just learning unity and I'd like to avoid learning wrong way. Are there good reasons why everyone uses UI canvas? Should I just follow same instructions and use canvas since it's much harder to do other way? if not could you point me to any good tutorial/template that could be used in game like 2048.


If I had started this game by my current knowledge I would do it this way: draw how full grid should look like e.g in illustrator, than take parts from it: just background and tiles separately. Than I would place background as gameobject, and place tiles on it as separate gameobjects. Does this sound OK? Or am I swimming against the tide?

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 Bonfire-Boy · Nov 08, 2018 at 09:49 AM 0
Share

I can't think of any good reason not to make something like that using Unity's UI system. Why doesn't it seem natural to you?

1 Reply

· Add your reply
  • Sort: 
avatar image
1
Best Answer

Answer by UnityCoach · Nov 08, 2018 at 09:46 AM

You could use UI Canvases, as well as you can use Sprites.

The main difference will be in handling different aspect ratios and resolutions. With a Canvas, you can set it up to be "responsive", while with Sprites, you'll have to query the Screen width and height and adjust the Camera ortho size so that it properly frames your grid.

Performance wise, it's questionnable. The UI allows you to do very well optimised stuff, but the sorting lies with the parenting, which may make it harder to do.

If you decouple the mechanics from the display, you may start with Sprites and decide to switch to UI later.

Hope this helps.

Comment
Add comment · 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 Longman1981 · Nov 08, 2018 at 10:07 AM 0
Share

Thanks for a clear response. So to make sure, this idea I have looks decent right?

If I had started this game by my current knowledge I would do it this way: draw how full grid should look like e.g in illustrator, than take parts from it: just background and tiles separately. Than I would place background as gameobject, and place tiles on it as separate gameobjects.

From here it seems like there's no advantage in using sprites solution generally, however for me it seems better solution since future projects wouldn't be possible to be created with canvas, so I'd better learn all aspects with sprites, and how to set up responsiveness with different aspect ratios/resolutions.

avatar image UnityCoach Longman1981 · Nov 08, 2018 at 10:38 AM 1
Share

You can only learn by doing, and do by learning, right? So, you can only plan with what you already know. It's a bit empirical, and sure, if you knew everything you'll know by the end of the project, you would certainly do it differently, but you have to start with what you know. What you'll learn about Sprites will help you with UI later, as UI uses sprites anyway.

That said, the event catching system will be totally different if you do it with Sprites or UI. With UI everything is already there, but you'll have to learn about it all. With Sprites, there's almost nothing, you'll have to build it, but not so much to learn.

Unless you want to become a UI expert, I'd start with Sprites to learn, and eventually switch to UI for possible enhancements.

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

196 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 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

UI Elements Not Rendering Properly on Android 1 Answer

2D UI in 3D space 3 Answers

Maximum number of TextComponents/GameObjects 0 Answers

Choosing between canvas and normal 2D gameobjects 0 Answers

Use Unity canvas for a whole game? 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