Author Topic: Tweening a button stack in order  (Read 1247 times)


  • Newbie
  • *
  • Thank You
  • -Given: 0
  • -Receive: 0
  • Posts: 10
    • View Profile
Tweening a button stack in order
« on: November 20, 2014, 12:33:13 PM »
My UI is a vertical list of long buttons. When the user activates the one of the buttons, the buttons will tween so that there is a space for dialogue between the selected button and the button immediately below it. What I am trying to figure out is how to organize my tweens so that the buttons will slide up and down the stack with respect to which one the user selected.

ie. If the user selects number 4, then all buttons above it scroll up and the dialogue appears below. Then, if the user selects 2, the buttons need to tween so that 3&4 scroll back down but 2 remains where it is.

I've attached a tween and playTween to each of my button objects. I'm looking for a solution that will help decide which direction the buttons should go when one is selected.

I've attached a screen cap demonstrating the button layout


  • Administrator
  • Hero Member
  • *****
  • Thank You
  • -Given: 337
  • -Receive: 1171
  • Posts: 22,128
  • Toronto, Canada
    • View Profile
Re: Tweening a button stack in order
« Reply #1 on: November 20, 2014, 09:11:17 PM »
Have you seen the quest log example that comes with NGUI? It does what you're looking for, doesn't it? Put the toggles in the same group by giving them a group ID to make it so that clicking on one header automatically shrinks the others.