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
2
Question by nah0y · Apr 18, 2011 at 01:04 PM · androidiphoneguitextureonguihud

HUD on Android/iPhone : GUITexture or OnGUI (drawTexture) ?

Hello !

I'm creating some games for Android/iPhone devices and I want to know which way is the best to do HUD : - Should I use GUITexture so I can create Atlas and reduce the number of draw calls - Or can I go with OnGUI and use drawTexture ? (can I use an atlas with OnGUI ?)

Thanks !

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
2
Best Answer

Answer by Silverfell 1 · Apr 26, 2011 at 03:29 AM

If you're designing for mobile, OnGUI is plain out. Every single OnGUI call is drawn with every frame, which effectively (in a best case scenario) doubles the load on the system.

If you design anything more complex than a couple of buttons, 20 OnGUI elements prove to be slower than 70-80 animated sprites (actual experience figures). Draw everything with GUITextures (or sprites), and track touches. GUITextures even have events to handle touch, so that should make them sexy once you wrap your head around their transforms.

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 nah0y · Apr 26, 2011 at 04:45 PM 0
Share

Thanks for your answer ! :)

avatar image
1
Best Answer

Answer by Seantron 1 · Apr 20, 2011 at 04:29 AM

GUITexture is definitely the way to go on Mobile. OnGUI is not only not as easy to use, but it's way more expensive.

Test Prime31's GUISprite classes. They are all single draw call, and optimized very nicely.

https://github.com/prime31/P31UnityAddOns/tree/master/GUISpriteUI

Comment
Add comment · Show 3 · 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 nah0y · Apr 20, 2011 at 11:59 AM 0
Share

Thx!

I'll take a look at it :)

PS : OnGUI is quite easy to use for me ^^

avatar image Seantron 1 · Apr 20, 2011 at 08:25 PM 1
Share

Yeah, OnGUI is easy to an extent (until you need them to do something they weren't intended to do), but if you want really nice looking GUI GUITextures are really the way to go. OnGUI is great for rapid prototyping, but you know. . . they look like a bad Flex app. Also, OnGUI isn't designed/optimized for mobile. But definitely try out those classes, they are great.

avatar image nah0y · Apr 26, 2011 at 04:40 PM 0
Share

It seems that the author is rewritting the project, plus, I've read that it doesn't support text... I'm looking for other great HUD systems :)

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

No one has followed this question yet.

Related Questions

[Question Duplicated] conversion of script guitexture to cube or other primitive (iphone) 0 Answers

Strange collision problem with block and terrain 1 Answer

Optimizing OnGUI - Too many gui elements? 2 Answers

OnGUI vs GUITexture for Tablets and Phones 2 Answers

conversion of script guitexture to cube or other primitive (iphone) 2 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