-
Notifications
You must be signed in to change notification settings - Fork 1
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Smooth camera drag. #16
base: master
Are you sure you want to change the base?
Smooth camera drag. #16
Conversation
- Camera drag separated from swipe: `OnDragEvent` with `Vector3` position difference. - Events in `PlayScreenState` reassigned to new `OnDragEvent`
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thx for feedback. I added the check that should do the work. However problem is that pointer callback is sometimes resolved after input callback. Meaning the current UI detection is not 100% accurate (at least in my environment). Current pointer callbacks: _root.Q("BottomBound").RegisterCallback<PointerEnterEvent>(e => isPointerOverUI = true);
_root.Q("FloatBody").RegisterCallback<PointerEnterEvent>(e => isPointerOverUI = false); Should I couple the checks to handle input function to remove the issue? Since it's used only for draging and swiping in the code currently. Like so: case TouchPhase.Moved:
touchEnd = position;
if (!isSwiping && /* manual check with new function here: */ isPointerOverUI() && Vector2.Distance(touchStart, touchEnd) >= swipeThreshold)
{
ProcessSwipe(touchEnd.x - touchStart.x, touchEnd.y - touchStart.y);
isSwiping = true;
}
break; |
Okay, I tested it. I did the following test. When you switch from trying to swipe from the board screen to the selection screen and vice versa, the first attempt acts the opposite way as expected. It swipes on the Selection and it blocks on the Board, seems a logic issue. repeating attempts in the same space are then correctly handled. Recreate the test.
Hope that helps to fix the issue. |
Camera drag separated from swipe: created
OnDragEvent
withVector3
position difference.Events in
PlayScreenState
reassigned to newOnDragEvent
.Not tested on actual mobile device => drag speed value may need adjustments.
In future drag speed could be based on zoom.
Camera is not clambed to reasonable map radius yet.