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. 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.

resizeJavaScript
alphaTab.resizejQuery
alphaTab.resizeHTML
Resize.net

Types​

function(e)JavaScript
Action<ResizeEventArgs>.net

Parameters​

ParametersTypeSummary
args.netAlphaTab.ResizeEventArgs

The information about the resize event.

argsJavaScriptalphaTab.ResizeEventArgs

The information about the resize event.

ResizeEventArgs Properties​

ParametersTypeSummary
oldWidthJavaScriptint

The size before the resizing happened.

OldWidth.netint

The size before the resizing happened.

newWidthJavaScriptint

The size after the resize was complete.

NewWidth.netint

The size after the resize was complete.

settingsJavaScriptAlphaTab.Settings

The settings currently used for rendering.

Settings.netAlphaTab.Settings

The settings currently used for rendering.

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;
});