Playmaker Forum

PlayMaker Help & Tips => iOS Help => Topic started by: joel.carlson on January 10, 2017, 04:53:43 PM

Title: Drag UI button in Scroll Rect[SOLVED]
Post by: joel.carlson on January 10, 2017, 04:53:43 PM
So I'm implementing a 'More Games' section. It contains a scroll rect with a number of my other games. The user can click each banner and the game will popup.

Unfortunately, as soon as the user touches the image to drag, the link is activated. Is there a way around this? I've tried On Pointer Up and On Pointer Down. Not really sure how do do it.
Title: Re: Drag UI button in Scroll Rect
Post by: jeanfabre on January 11, 2017, 02:25:35 AM
Hi,

 yep :) it's a common problem indeed...

two ways to go about this:

1: don't use the Button UP event, but instead compose the pointerUP and PointerDown event and keep track of a bool "isDown", then if the scroll changes, reset the "idDown" so that on PointerUp you don't do anything.

2: disabled scrolling when you press a button that is within this scroll.

Let me know how it goes.

 Bye,

 Jean
Title: Re: Drag UI button in Scroll Rect
Post by: joel.carlson on January 11, 2017, 11:08:56 AM
Thanks for the quick response! I'll try it out today.
Title: Re: Drag UI button in Scroll Rect
Post by: joel.carlson on January 11, 2017, 05:02:03 PM
Ha! Well, I was just writing out all the steps I'd taken in creating the new FSM, and how it still wasn't working. I was writing out state 2/5 and that's when I noticed my mistake.

Thanks! All working now!

For those curious, here's how I set it up.

*edit- and now I realized the ios/android states should go back to state 1