Open DleanJeans opened 8 years ago
I think I should just close this. Since updating endPosition
would just unnecessarily decrease the performance, maybe.
Since updating endPosition would just unnecessarily decrease the performance, maybe.
Which part of that do you think would be expensive?
maybe.
Perhaps it's not that expensive. I was just trying to implement something like FlxScrollableArea but with swipe-to-scroll for mobile target (for a friend). And FlxSwipe isn't enough for this and seems like I'm the only one who has talked about this.
I found this problem now. I'm trying to do a level map for a mobile game that can be scrolled using touches and swipes. But I think that swipes are not measured correctly by HaxeFlixel.
If I pressed the mouse button down and move the mouse around for a few seconds the swipe is taking the first point of click and the last as the swipe points. But the last swipe really was different. I think that swipes need to be measuring the starting point every a few second or when it drastically changes direction.
I'm not sure yet where Flixel is handling swipes so I'm not sure how to fix it.
Right now,
FlxSwipes
are only created after mouse or touch is released, which is not how I expected them to work. So I decided to improve it a little: aFlxSwipe
will be created as soon as a mouse button or touch is down and kept inFlxG.swipes
until mouse/touch is released and itsendPosition
is updated every frame. And I'm feeling like this is not enough. I think FlxSwipe also needs a threshold since a click or a tap is also counted as a swipe. What about a swipe going in different directions (like circling, ping pong)? Should we add FlxPoints between start and end position like a path?