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
1
Question by SuperNoctiz · Sep 12, 2014 at 01:13 PM · menu4.6title

Change All (new) UI Text Font?

Hello, I'm using the new UI in unity 4.6 and I made a bunch of elements (menus, options screens, etc) which involves a lot of UI text in the buttons and titles, and the thing is that I would like to change all the fonts to a specific one, is there a way to make it in one action or do I simple have to do it one by one?

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

4 Replies

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

Answer by HarshadK · Sep 12, 2014 at 01:24 PM

You can write a script to do it for you which works as below.

  • Get all the child game objects of your Canvas game object. If multiple canvases are there then get child game objects of all those canvases.

  • Then traverse through all the child game objects to check to see if the game object has a Text component attached to it.

  • If there is a Text component attached you can access the font variable and set its value to the font you want.

Make sure you set this script to ExecuteInEditMode.

Comment
Add comment · Show 4 · 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 SuperNoctiz · Sep 12, 2014 at 01:39 PM 0
Share

I would prefer a "non-scripted way", but I guess I have no other choice.

Anyway, impressive detailed and quick reply! Thank you a lot.

avatar image HarshadK · Sep 12, 2014 at 01:45 PM 0
Share

Happy to help! :-)

avatar image Rodiaz89 · Feb 27, 2015 at 11:19 AM 1
Share

I made an asset that has this functionality plus other features, it's called Gamestrap UI and you can just select the components you want to change it's font and it will go through every child recursively and set the font if it has a text component. https://www.assetstore.unity3d.com/#!/content/28599

avatar image Weendie-Games · Jan 03, 2018 at 05:25 PM 0
Share

Is this a 'expensive' of doing it? I'm trying to find a better way...

avatar image
11

Answer by rakkarage · Sep 15, 2014 at 02:08 AM

search for UnityEngine.UI.Text select them all then change and they all change

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
1

Answer by Azzerhoden · Apr 13, 2015 at 01:06 PM

I just opened a scene, searched in the Hierarchy window for Text, selected them all, and changed them. This will only work if you hadn't changed the name of the text object.

As a matter of habit all of my Text components are within a panel or other object, so I never change the name.

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 dg999 · Oct 03, 2015 at 05:23 PM 1
Share

In the Hierarchy window, if you click on the magnifying glass/dropdown, you can change it to search by Type, and then you can put in Text, it'll find all text objects regardless of the name you give it.

avatar image
0

Answer by GrantTheAnt · Mar 02, 2015 at 12:01 PM

I just thought I'd mention that we've created an asset on the asset store to perform this function - Font Changer. Our game has a large UI; some objects in the current scene, and many prefabs in the project. We needed a way to quickly and easily change the font throughout the scene and entire project, so we developed the Font Changer. It can also increase/decrease/change the font size through the project & scene too. Hopefully this makes changing fonts in your projects a whole lot easier!

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

6 People are following this question.

avatar image avatar image avatar image avatar image avatar image avatar image

Related Questions

A node in a childnode? 1 Answer

Detecting a UI element is over another UI element 1 Answer

Menu Movements Quetion! 2 Answers

Necromancer GUI doesn't work? 1 Answer

Best practices for ending a game / dying / restarting 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