Skip to main content

customScrollHandler

since 1.8.0
customScrollHandlerJavaScriptCustomScrollHandler.netcustomScrollHandlerAndroid

Description​

A custom scroll handler which will be used to handle scrolling operations during playback.

customScrollHandler?: IScrollHandler;

Examples​

const api = new alphaTab.AlphaTabApi(document.querySelector('#alphaTab'));
api.customScrollHandler = {
forceScrollTo(currentBeatBounds) {
const scroll = api.uiFacade.getScrollElement();
api.uiFacade.scrollToY(scroll, currentBeatBounds.barBounds.masterBarBounds.realBounds.y, 0);
},
onBeatCursorUpdating(startBeat, endBeat, cursorMode, relativePosition, actualBeatCursorStartX, actualBeatCursorEndX, actualBeatCursorTransitionDuration) {
const scroll = api.uiFacade.getScrollElement();
api.uiFacade.scrollToY(scroll, startBeat.barBounds.masterBarBounds.realBounds.y, 0);
}
}