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 - ENAY

Pages: 1 ... 15 16 [17]
NGUI 3 Support / Searching for UILabels in an object by name?
« on: May 09, 2012, 01:05:32 AM »
Is there anyway to get an object in the Menu list by name? So far I have my default menu that I am spawning from a prefab. I can change the text ok but to get to the objects I am doing something like

window_name = theMenu.GetComponentsInChildren<UILabel>()[0];
main_body = theMenu.GetComponentsInChildren<UILabel>()[1];

Now this works only because of the current order of the menu and is not really that stable, if I add a button or want to change my menu, it will probably find the UILabel from somewhere else instead of what I am expecting. What I am really trying to do is something like this:-

window_name = theMenu.GetComponent("Window Name");
main_body = theMenu.GetComponent("Main Body");

Thanks for reading.

NGUI 3 Support / Re: Changing language
« on: May 08, 2012, 09:04:40 PM »
Yes, it would be easier to just concatenate the string in C# and just call the string in separate tag chunks. Not only is that easier and better, but I already know how to do that.

Sorry about the stupid post there. :)

NGUI 3 Support / Re: Changing language
« on: May 08, 2012, 08:38:41 PM »
Thanks, ok, so 'languages' and 'currentlanguage' was my problem. Thanks for that :)
I had another problem but now I have realised that carriage returns are the end of the label.
I had labels such as

Main =
This is Main !

which simply did nothing. :O

This NGUI is awesome. Ok my next question is, can I do cool things like combine variables inside the text string, for example something like this:-

public string name = "Jeffrey";
public int age = 16;

Label_name = Your name is [var]
Label_name2 = Your age is  [var Myclassname.age]

and then later on in my code after calling moo.txt, my text strings would automatically be "Your name is Jeffrey" and "Your age is 16" ?

Thanks. :)

NGUI 3 Support / Changing language
« on: May 08, 2012, 08:18:11 AM »
Ok, this is probably a really simple question, and it probably is more to do that I am not so sure of Unity rather than NGUI.

My issue, I am using the Localization, and UILocalize. My menu buttons are already in two separate text files for Japanese and English, I am all set up and working, just like in the tutorial. Yet, I can't seem to figure out to do the simplest of things, which is to change the language once the program has started in code.

What I am looking for I guess is:-

"Localization.instance.languages = 0; // Japanese"
"Localization.instance.languages = 1; // English"

The above gives me an error though, I guess what I am trying to do is probably really simple.

NGUI 3 Support / Re: Code Tutorials?
« on: May 07, 2012, 11:17:33 PM »
Awesome! Thanks for the link :)

NGUI 3 Support / Code Tutorials?
« on: May 07, 2012, 08:49:45 PM »
After spending yesterday playing with NGUI and also watching several youtube tutorials I feel like using NGUI is going to be an awesome asset.

What I can't seem to find though is some sort of basic tutorials on how to do things in code. All the stuff I have seen so far use drag and drop and have all the menus automatically in the scene before you click play. Perhaps I just haven't looked hard enough and found a link. What I would like to look at are some basic tutorials (preferably in C#) of just doing simple things like creating a menu and deleting it in code. Attaching a NGUI script in code to an object instead of using the Unity GUI etc. There are so many little bits of juicy source code that it is a bit daunting to know where to start.  ;D

NGUI 3 Support / Re: Fonts
« on: May 07, 2012, 02:40:56 AM »
Hi there,

I am interested in being able to use Japanese fonts. Unity supports Japanese text in the IDE so I am just wondering if it is as easy as to simply copy a text string and it automatically work as long as you have the atlas with all the text already generated.

For example

thewords.text = "JAPANESE TEXT HERE";

Thanks for reading.

Pages: 1 ... 15 16 [17]