Show Posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.


Messages - rptts

Pages: [1]
1
NGUI 3 Documentation / Re: UIPopupList
« on: March 05, 2014, 06:02:30 AM »
I was having the same problem as Messu and I solved the situation by making some changes in the UIPopupList.cs

Line 683:
  1. x = Mathf.Max(x, lbl.printedSize.x * dynScale);

Line 700:
  1. x = Mathf.Max(x, bounds.size.x - (bgPadding.x + padding.x) * 2f);

I only tested with bitmap font, and I didn't made an exhaustive examination to the UIPopupList.cs, so I'm not sure that it is 100% bulletproof, but so far, so good.

2
NGUI 3 Documentation / Re: Localization system
« on: March 04, 2014, 07:33:06 AM »
I've made the pretty noob mistake of saving my settings prefab while I was playing the app and saved the UIPopupList with the onChange Event to notify the LanguageSelection delegade and OnChange methods. That was causing the problem, after removing them it's now working properly.

Anyway, sometimes simplifying things makes us realize easier where our problems are, tnx  :D

3
NGUI 3 Documentation / Re: Localization system
« on: March 03, 2014, 02:16:49 PM »
Hello,

I'm having some trouble making my localization system to work properly. Maybe I'm doing something wrong, but here's what I'm doing:

(I'm using unity 3.5)
In the Awake of my app i do:

  1. TextAsset languages = Resources.Load("myLanguages", typeof(TextAsset)) as TextAsset;
  2.                        
  3. Localization.LoadCSV(languages);
  4.  
  5. Localization.language = Localization.knownLanguages[0];
  6.  

but every time I instantiate a new UIPopupList (when i load a new scene, for example), it seems that the Localization forgets the dictionary because it no longer recognizes the keys. I get the warning from Localization.cs, line 408 (Debug.LogWarning("Localization key not found: '" + key + "'");)
Am I doing something wrong here?

Another thing that I would like to clarify is how can I change a localized string ("my string number {0}") when I change the Language dynamically (for example using UIPopupList). Before this last update I was updating it on the OnLocalize function, using the
  1. label.text = string.Format(label.text, 1);
method, but now it seems it "localizes" the label after the OnLocalize function, because although when I output the label to the console, the string is correct, but in the game interface it shows the original string.

Pages: [1]