Cocos Creator 3.4.0 ScrollView Event Know the direction of scrolling

Hi all, I am trying to use scroll view events, and I need to know on what direction my scroll is moving LEFT or RIGHT.
How can I do this? thanks.

I can ask engineering to have a look.

you can use scrollView.on(‘scroll-to-left’, this.onScrollLeftEvent, this) or scrollView.on(‘scroll-to-right’, this.onScrollRightEvent, this)

Look like it fires only when I am scrolling and reached left\right border, not when I am scrolling in the middle.
I just need to know the direction of scrolling.

scrollView.node.on(Node.EventType.TOUCH_MOVE, (event: EventTouch) => { 
const deltaX = event.getDeltaX();

            if(deltaX>0)

            {

                console.log("it's right")

            }

            else if(deltaX<0){

                console.log("it's left")

            }
}, this)

This topic was automatically closed 24 hours after the last reply. New replies are no longer allowed.