Author Topic: Generate a table and control its alpha  (Read 2888 times)

neunundneunzig

  • Newbie
  • *
  • Thank You
  • -Given: 0
  • -Receive: 0
  • Posts: 8
    • View Profile
Generate a table and control its alpha
« on: December 18, 2013, 08:36:36 AM »
I had it in old version 3.0.0, but in 3.0.7 it is broken.

Here is what did I do: I made a prefab of item that I want to generate, then attached script of generating by useing NGUITools.AddChild, set parent as Table GO with UITable script, set prefabs as my customize prefab.

Then, I set the alpha of table's parent panel as 0, gave it a tween alpha, told it to tween from 0 to 1. After that, a button to play this tween is installed.

Now though the UITable is functional, but when I press the button, all the table content are just pop out. Those items attached under the Table GO was normally changing alpha from 0 to 1.

So what is the problem here?
Is the draw call sequence changed or what?

Thanks.




BTW, if I want to expand the table content once at a time, what should I do?
By using UIEventlisterner, or just make my own script?
How could I told table content to reverse the tween scale?

ArenMook

  • Administrator
  • Hero Member
  • *****
  • Thank You
  • -Given: 337
  • -Receive: 1171
  • Posts: 22,128
  • Toronto, Canada
    • View Profile
Re: Generate a table and control its alpha
« Reply #1 on: December 18, 2013, 12:07:49 PM »
Related to http://www.tasharen.com/forum/index.php?topic=7210.0?

I've made changes regarding this in the pro version.

TweenScale, like all tweens, have PlayForward() and PlayReverse() functions.

neunundneunzig

  • Newbie
  • *
  • Thank You
  • -Given: 0
  • -Receive: 0
  • Posts: 8
    • View Profile
Re: Generate a table and control its alpha
« Reply #2 on: December 19, 2013, 09:32:45 PM »
Thanks a lot.

Though I know how to get current clicked button (by UIButton.current), but looks like table item's is triggered by UIPlay Tween component.

So is there a same function that I can get current clicked GO with UIPlay Tween on it?


ArenMook

  • Administrator
  • Hero Member
  • *****
  • Thank You
  • -Given: 337
  • -Receive: 1171
  • Posts: 22,128
  • Toronto, Canada
    • View Profile
Re: Generate a table and control its alpha
« Reply #3 on: December 20, 2013, 11:49:39 AM »
UITweener.current