Hello Guest

Show Posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.


Messages - zblack

Pages: 1 [2]
16
4.6.3f1. All I did was add a OnClickUIItem listener script, a tk2dUIItem script, and a box collider to the Portrait object of the ItemTemplate. If you click and then release while swiping, it will register a click and also swipe the scroll area. Also, I don't feel that stopping the scroll area should register a click on an item. The iOS user interface does not behave this way. Are you first capturing events in the children and then passing up to the parent?

17
Happening just in the editor (Mac), but also on Android / iOS.

18
... It also happens when the area is scrolling (drifting) and you tap to stop it. The scroll area stops but it also registers a click with any uiItems in the container.

19
This is happening randomly (but frequently) in the "5 - ScrollableArea" test demo scene. If I swipe very quickly I get the scroll area moving but also get a click event on my uiItems.

20
So I realized a problem with my "fix": If you *intend* to release the scroll area without moving it (points are equal), it still moves! Yergh. So really the only way to properly fix this is an average of the last several deltas, so if you hold in place for a second and then release they will all be zero.

21
The problem is the line "swipeCurrVelocity = ... " in UpdateSwipeScrollDestintationPosition() of tk2dUIScrollableArea.cs. What happens is that the value can be set to 0 if the user happens to release their finger on the frame that a swipe delta had just begun to calculate (i.e., the start point and end point are equal). The "quick fix" is to merely check if the two value are equal, and if so, don't re-calculate swipeCurrVelocity. It will be left with it's previous delta value and you'll get good velocity on all releases. I tried a couple of other techniques, including weighting and averaging the two values together, but inevitably you get "sticky" swipes at 1/2 speeds and such. Ideally, the algorithm should be keeping a running weighted average of the last several swipe deltas over time, and use that averaged value to set swipeCurrVelocity on release.

22
Heading says it all: When trying to swipe/flick to scroll, the content will just dead-stop the instant you release your finger. Happens anywhere between 10-20% of the time depending on the device. Has anyone else encountered this and found a fix?

(Previously, when I coded my own scrolling area for iOS in Xcode using C++, I ran into this problem as right away, and had to do some trickery to prevent it from happening. I was surprised to see that it had not been addressed in tk2d.)

Pages: 1 [2]