customScrollHandler
customScrollHandlerJavaScriptCustomScrollHandler.netcustomScrollHandlerAndroidDescription​
A custom scroll handler which will be used to handle scrolling operations during playback.
- JavaScript
- C#
- Kotlin
customScrollHandler?: IScrollHandler;IScrollHandler CustomScrollHandler { get; set; }var customScrollHandler: IScrollHandlerExamples​
- JavaScript
- C#
- Android
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);
}
}
var api = new AlphaTabApi<MyControl>(...);
api.CustomScrollHandler = new CustomScrollHandler();
val api = AlphaTabApi<MyControl>(...)
api.customScrollHandler = CustomScrollHandler();