Author Topic: Does ngui support muti-language ui ?  (Read 2353 times)

xushunwang

  • Newbie
  • *
  • Thank You
  • -Given: 0
  • -Receive: 0
  • Posts: 11
    • View Profile
Does ngui support muti-language ui ?
« on: June 16, 2014, 09:57:13 PM »
My game now support two language .

The UILabel in the ui must use different font.And their's fontsize,alignment,position effect are also different.

How can I do to make me easier to adjust different ui usingdifferent language.

ArenMook

  • Administrator
  • Hero Member
  • *****
  • Thank You
  • -Given: 337
  • -Receive: 1171
  • Posts: 22,128
  • Toronto, Canada
    • View Profile
Re: Does ngui support muti-language ui ?
« Reply #1 on: June 17, 2014, 01:59:36 PM »
UILabels have font size specified on them, so if you choose size 20, it will be 20 pixels high, regardless of which font is used. This may mean that some font will be shrunk, and another may be enlarged if they are of different sizes.

To swap fonts easily, consider using a Reference font. Create a game object, put UIFont on it, make it be a Reference type font and point to your actual game font. Save this as a prefab. When making your UI, use this reference font for everything. Then when you want to switch fonts, just replace the font on that prefab you created, and your entire UI will be automatically switched to use the new font.