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 DryTear · Jun 07, 2013 at 03:13 AM · guifont

Wierd GUI behaviour

I have a simple networked game, and whenever i make a build, the gui font seems to reset to Arial, but my font is comic sans ms, and so after i make a change in any script, even in a script thats not even in use, the font seems to go back to font i want it to be as. im using a guiskin with a font applied, also Guistyles with font applied

Comment
Add comment · Show 5
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 TonyLi · Jun 07, 2013 at 02:32 PM 1
Share

Is this only in a build, or does it happen while playing in the editor, too? If only a build, what platform?

Can you provide the OnGUI() code? If you're relying on a lot of default values for GUI.Label(), GUI.Button(), etc., you'll want to set GUI.skin = at the beginning of OnGUI().

avatar image DryTear · Jun 07, 2013 at 04:18 PM 0
Share

its both in editor and on build ( tried mac, win, linux, web, flash too), and yes, ive set GUI.skin = $$anonymous$$ySkin; the boxes, windows, textfields are all part of my gui skin. and im using also using function GuiWindow() to make the windows, and the windows text seems to be the only problem

avatar image TonyLi · Jun 07, 2013 at 05:41 PM 0
Share

Is just the font reverting to default, or all of the style settings, too (size, color, etc.)?

What are your OnGUI() and window handler functions?

avatar image DryTear · Jun 07, 2013 at 08:26 PM 0
Share

only the font, everything else stays as wanted, but the functions are simple (GUI.Box, GUI.Label, GUI.Window)

just a question, inside gui window functions, do i have to inroduce the GUI.skin = $$anonymous$$ySkin;?

avatar image TonyLi · Jun 08, 2013 at 03:07 AM 1
Share

I just tested this code, and it works fine:

 public class WindowTest : $$anonymous$$onoBehaviour {
     
     public GUISkin mySkin;
 
     private Rect windowRect = new Rect (20, 20, 120, 50);
 
     void OnGUI () {
         if (mySkin != null) GUI.skin = mySkin;
         windowRect = GUI.Window (0, windowRect, WindowFunction, "$$anonymous$$y Window");
     }
 
     void WindowFunction (int windowID) {
         GUI.Label(new Rect(10, 10, 100, 20), "Label");
     }
     
 }

I created a new GUISkin, assigned a different TTF font to the Font field of the GUISkin, and then assigned my new GUISkin to the "mySkin" field of the script you see above. The window title and the label both used the new font.

Have you tried a different font?

What is your OnGUI() code?

0 Replies

· Add your reply
  • Sort: 

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

15 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

Related Questions

Is there a way to measure the pixel with/height of a string with a given font? 2 Answers

Alpha not working in GUITex 0 Answers

Displaying Mathematical Equations 2 Answers

Unity 5.2 Using Emojii and other Unicode Symbols at Runtime UGUI 0 Answers

GUILabel wrong text wrapping when font changed by style 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