playMaker

Author Topic: NGUI: Instantiating an NGUI label (or sprite, button, etc) help?  (Read 6161 times)

Red

  • Hero Member
  • *****
  • Posts: 563
Hello. I've been getting more and more work done on NGUI integration and one thing that i've noticed seems to be happening (or, more accurately, not happening) is that the create object action seems not to want to instantiate an NGUI item (in this case it's a label.)

right now i've got it reaching into the panel and grabbing the item and then using that to instantiate... I've not tried it with that label being a prefab on it's own but that's the next step.

What i'm working towards is a damage indicator thing (since that is why I eventually bit the bullet and invested in it) and so far i've been able to make the position information and scrolling work... the effect will be much like World of Warcraft's damage system though without the transparency effects... so, damage, health or critical damage changes the colour of the text (i've yet to institute a fancy splash image for critical damage) and it scrolls upwards on the screen after being positioned appropriately with the "world to screen point" action.

Where I'm having this hangup is that I would like to create a sort of pooling system so that I can avoid having to run out of labels (in the case of a mass damage ability/spell) or having too many that aren't used. I'd like to have it so that it will add more labels as the need arises.

Anyone have any experience with this? i've not tried it with that add-on script yet either... i'll be sure to test with that.

lalamax3d

  • Playmaker Newbie
  • *
  • Posts: 12
Re: NGUI: Instantiating an NGUI label (or sprite, button, etc) help?
« Reply #1 on: August 10, 2013, 02:45:27 AM »
not 100 % sure. but i think, you should create a button or (any other element) manually. then save it as prefab(only that element) with all styling etc
then you can instanciate it in different panels dynamically.