Skip to main content

resize

since 0.9.4

Description​

This event is fired when alphaTab was resized and is about to rerender the music notation. This event is fired when alphaTab was resized and is about to rerender the music notation. Before the re-rendering on resize the settings will be updated in the related components. This means that any changes to the layout options or other display settings are considered. This allows to implement scenarios where maybe the scale or the layout mode dynamically changes along the resizing.

Examples​

const api = new alphaTab.AlphaTabApi(document.querySelector('#alphaTab'));
api.resize.on((args) => {
args.settings.scale = args.newWidth > 1300
? 1.5
: (args.newWidth > 800) ? 1.3 : 1;
});