Hello Guest

Author Topic: Buttons in tk2dUIScrollableArea Register Click When Trying to Scroll  (Read 4785 times)

daklab

  • Newbie
  • *
  • Posts: 12
    • View Profile
    • Daklab - Experiments, Projects, Designs, Tips, and Tutorials Related to Creative Coding
I searched the forums and found this: http://unikronsoftware.com/2dtoolkit/forum/index.php/topic,1564.msg7658.html#msg7658. But when I went to reply it stated it was over 120 days and to consider starting a new topic so here it is.

I have a tk2dUIScrollableArea which has UI BasicButton instances in it. When I touch over a button and try to swipe the content, it doesn't scroll as expected. Instead the button captures the touch. This is repeatable by simply dragging out a ScrollableArea_Horizontal and offsetting a few UI BasicButton instances in the ScrollableArea's content GameObject. The buttons are considered interacted with when the intention is to swipe (and thus scroll the view).

I've ran the 5 - ScrollableArea demo, looked at the controller script, but can't figure out how it works in the demo. The Add More and Next buttons work as I want, if swiping begins after first interaction it transitions to scroll as expected. I feel like this is a simple fix but I've been banging my head against the wall on this one. How is this achieved?
Braindrop Labs - Games. Apps. Coded Art. www.braindroplabs.com

unikronsoftware

  • Administrator
  • Hero Member
  • *****
  • Posts: 9709
    • View Profile
Re: Buttons in tk2dUIScrollableArea Register Click When Trying to Scroll
« Reply #1 on: October 05, 2013, 10:00:05 pm »
Can you check that you've got "Child of another UIItem" ticked on these buttons? This will ensure they pass the message appropriately.

daklab

  • Newbie
  • *
  • Posts: 12
    • View Profile
    • Daklab - Experiments, Projects, Designs, Tips, and Tutorials Related to Creative Coding
Re: Buttons in tk2dUIScrollableArea Register Click When Trying to Scroll
« Reply #2 on: October 05, 2013, 11:00:08 pm »
That was the trick, thanks! I'm nesting prefabs and my root button prefab had that checked where my higher parent prefab which utilized instances of it did not. Not quite sure how that happened, but I think I just came to understand the "nested prefabs" issue I've heard people pissed about. I'm newish to Unity and am bummed that prefabs don't work as you'd expect. Coming from Flash this is a bummer from a reusable asset and workflow standpoint. Prefab != MovieClip :(
Braindrop Labs - Games. Apps. Coded Art. www.braindroplabs.com