Tasharen Entertainment Forum
Support => NGUI 3 Support => Topic started by: rastinrasini on May 25, 2012, 07:47:00 AM
-
hi all
if have many items and want to add they to an panel in runtime in button mode then in click of anyone it send name of button.
how can do this?
thankful.
-
Use UIButtonMessage, it passes its game object as the parameter.
-
How?
can add an example?
-
Example of what? Attach UIButtonMessage to your button, set its event listener and the function it will call on the event listener, and that's it. When you click it, the function will be called.
-
Hi All
i have many icons in a folder in resources.
i want to add they in a panel in runtime?
for example:
Add 25 button with 25 Icon in Resources/Icons and when each of then is clicked print its order in panel.
how can do this?
Thankful.
-
If they are not in an atlas, use UITexture to draw them.
-
hi all
in unity gui we coding :
for (int i = 9; i < 18; i++) {
if(GUI.Button(new Rect( 50*(i-3),
14,50,50),
new GUIContent(Resources.Load(SpellTexturePath+i.ToString())as Texture2D)))
{
if(_playerCombat._isReady)
_playerCombat.ShootArrow(i);
else
_playerCombat.RangeAttack(i);
}
}
i want similor code in when i want use ngui.
how can i implement code above with ngui?
thankful.
-
All I can suggest is read the written tutorials and watch the tutorial videos in order to learn how NGUI works first. You will have a lot of trouble converting OnGUI code to NGUI. They are completely different systems.