core.includeNoteBounds
core.includeNoteBoundsJavaScript
includeNoteBoundsJavaScript
core.includeNoteBoundsJSON
includeNoteBoundsJSON
Core.IncludeNoteBounds.net
core.includeNoteBoundsAndroid
Description​
Whether in the BoundsLookup
also the position and area of each individual note is provided. AlphaTab collects the position of the rendered music notation elements during the rendering process. This way some level of interactivity can be provided like the feature that seeks to the corresponding position when clicking on a beat.
By default the position of the individual notes is not collected due to performance reasons. If access to note position information is needed, this setting can enable it.
- JavaScript
- C#
- Kotlin
includeNoteBounds: boolean = false;
bool IncludeNoteBounds { get; set; } = false
var includeNoteBounds: Boolean = false
Example - JavaScript​
const settings = new alphaTab.model.Settings();
settings.core.includeNoteBounds = true;
const api = new alphaTab.AlphaTabApi(document.querySelector('#alphaTab'), settings);
api.renderFinished.on(() => {
const lookup = api.renderer.boundsLookup;
const x = 100;
const y = 100;
const beat = lookup.getBeatAtPos(x, y);
const note = lookup.getNoteAtPos(beat, x, y);
});