alphaTab.rendering.IScoreRenderer
Represents the public interface of the component that can render scores.
interface IScoreRendererProperties​
boundsLookup​
Gets or sets the lookup which allows fast access to beats at a given position.
- JavaScript
- C#
- Kotlin
readonly boundsLookup: BoundsLookup | null;BoundsLookup? BoundsLookup { get; }val boundsLookup: BoundsLookup?error​
This event is fired when an error within alphatab occurred. This event is fired when an error within alphatab occurred. Use this event as global error handler to show errors to end-users. Due to the asynchronous nature of alphaTab, no call to the API will directly throw an error if it fails. Instead a signal to this error handlers will be sent.
- JavaScript
- C#
- Kotlin
readonly error: IEventEmitterOfT<Error>;IEventEmitterOfT<System.Exception> Error { get; }val error: IEventEmitterOfT<kotlin.Throwable>width​
The width of the rendered score. For layouts that grow from top to bottom (like page), it is required to specify a width for the renderer.
The renderer will fit then the bars into this area for rendering. The alphaTab API object uses a link to the
graphical user interface via a IUiFacade to get the available width for rendering. When using the low-level APIs
this width must be specified manually.
For layouts that grow from left to right the width and height are usually calculated automatically based on the contents.
- JavaScript
- C#
- Kotlin
width: number;double Width { get; set; }var width: DoubleMethods​
destroy​
Destroys the renderer and all related components. This method destroys the full renderer and by this closes all potentially opened contexts and shuts down any worker.
If you dynamically create/destroy renderers it is recommended to always call this method to ensure all resources are leaked.
- JavaScript
- C#
- Kotlin
destroy(): voidvoid Destroy()fun destroy(): Unitrender​
Initiates a re-rendering of the current setup.
- JavaScript
- C#
- Kotlin
render(renderHints?: RenderHints): voidvoid Render(RenderHints? renderHints)fun render(renderHints: RenderHints?): Unit| Parameter | Summary |
|---|---|
renderHintsAll | Additional hints to respect during layouting and rendering. |
renderResult​
Requests the rendering of a chunk which was layed out before. This method initiates the rendering of a layed out chunk advertised through partialLayoutFinished
- JavaScript
- C#
- Kotlin
renderResult(resultId: string): voidvoid RenderResult(string resultId)fun renderResult(resultId: String): Unit| Parameter | Summary |
|---|---|
resultIdAll | the result ID as provided by the |
renderScore​
Initiates the rendering of the specified tracks of the given score.
- JavaScript
- C#
- Kotlin
renderScore(score: Score | null, trackIndexes: number[] | null, renderHints?: RenderHints): voidvoid RenderScore(Score? score, IList<double>? trackIndexes, RenderHints? renderHints)fun renderScore(score: Score?, trackIndexes: alphaTab.collections.DoubleList?, renderHints: RenderHints?): Unit| Parameter | Summary |
|---|---|
scoreAll | The score defining the tracks. |
trackIndexesAll | The indexes of the tracks to draw. |
renderHintsAll | Additional hints to respect during layouting and rendering. |
resizeRender​
Initiates a resize-optimized re-rendering of the score using the current settings. This method can be used if only re-fitting of the score into a new width should be done. alphaTab internally keeps all the information about the music notation elements like where they are placed and how they are connected. This is a rather expensive operation but it is only required to be done once.
In case the UI is resized, this method can be used to trigger a rearrangement of the existing elements into the newly available space.
- JavaScript
- C#
- Kotlin
resizeRender(): voidvoid ResizeRender()fun resizeRender(): UnitupdateSettings​
Updates the settings to the given object. This method updates the settings to the given object. On some platforms like JavaScript the settings object will need to be passed on to the corresponding worker to be really updated. It is recommended to make this call after updating any properties of the settings object to ensure it is really passed on to all components.
This method will not trigger automatically any re-rendering.
| Parameter | Summary |
|---|---|
settingsAll | (no description) |
Events​
partialLayoutFinished​
Occurs whenever a part of the whole music sheet is layed out but not yet rendered. AlphaTab does not render the whole music sheet into a single canvas but rather splits it down into smaller chunks. This allows faster display of results to the user and avoids issues related to browser restrictions (like maximum canvas sizes).
This event is fired whenever one chunk of the music sheet was fully layed out.
Occurs whenever a part of the whole music sheet is layed out but not yet rendered. AlphaTab does not render the whole music sheet into a single canvas but rather splits it down into smaller chunks. This allows faster display of results to the user and avoids issues related to browser restrictions (like maximum canvas sizes).
This event is fired whenever one chunk of the music sheet was fully layed out.
- JavaScript
- C#
- Kotlin
readonly partialLayoutFinished: IEventEmitterOfT<RenderFinishedEventArgs>;IEventEmitterOfT<RenderFinishedEventArgs> PartialLayoutFinished { get; }val partialLayoutFinished: IEventEmitterOfT<RenderFinishedEventArgs>partialRenderFinished​
Occurs whenever a part of the whole music sheet is rendered and can be displayed. AlphaTab does not render the whole music sheet into a single canvas but rather splits it down into smaller chunks. This allows faster display of results to the user and avoids issues related to browser restrictions (like maximum canvas sizes).
This event is fired whenever one chunk of the music sheet is fully rendered.
since 1.2.3 the rendering of a chunk needs to be requested via the renderResult method after
a chunk was advertised through the partialLayoutFinished .
Occurs whenever a part of the whole music sheet is rendered and can be displayed. AlphaTab does not render the whole music sheet into a single canvas but rather splits it down into smaller chunks. This allows faster display of results to the user and avoids issues related to browser restrictions (like maximum canvas sizes).
This event is fired whenever one chunk of the music sheet is fully rendered.
since 1.2.3 the rendering of a chunk needs to be requested via the renderResult method after
a chunk was advertised through the partialLayoutFinished .
- JavaScript
- C#
- Kotlin
readonly partialRenderFinished: IEventEmitterOfT<RenderFinishedEventArgs>;IEventEmitterOfT<RenderFinishedEventArgs> PartialRenderFinished { get; }val partialRenderFinished: IEventEmitterOfT<RenderFinishedEventArgs>postRenderFinished​
This event is fired when the rendering of the whole music sheet is finished, and all handlers of renderFinished ran. This event is fired when the rendering of the whole music sheet is finished, and all handlers of renderFinished ran. When this
handlers are called, the whole rendering and display pipeline is completed.
This event is fired when the rendering of the whole music sheet is finished, and all handlers of renderFinished ran. This event is fired when the rendering of the whole music sheet is finished, and all handlers of renderFinished ran. When this
handlers are called, the whole rendering and display pipeline is completed.
- JavaScript
- C#
- Kotlin
readonly postRenderFinished: IEventEmitter;IEventEmitter PostRenderFinished { get; }val postRenderFinished: IEventEmitterpreRender​
Occurs before the rendering of the tracks starts This event is fired when the rendering of the whole music sheet is starting. All preparations are completed and the layout and render sequence is about to start.
The provided boolean indicates the rendering is triggered from a resize
Occurs before the rendering of the tracks starts This event is fired when the rendering of the whole music sheet is starting. All preparations are completed and the layout and render sequence is about to start.
The provided boolean indicates the rendering is triggered from a resize
- JavaScript
- C#
- Kotlin
readonly preRender: IEventEmitterOfT<boolean>;IEventEmitterOfT<bool> PreRender { get; }val preRender: IEventEmitterOfT<Boolean>renderFinished​
This event is fired when the rendering of the whole music sheet is finished. This event is fired when the rendering of the whole music sheet is finished from the render engine side. There might be still tasks open for the display component to visually display the rendered components when this event is notified.
This event is fired when the rendering of the whole music sheet is finished. This event is fired when the rendering of the whole music sheet is finished from the render engine side. There might be still tasks open for the display component to visually display the rendered components when this event is notified.
- JavaScript
- C#
- Kotlin
readonly renderFinished: IEventEmitterOfT<RenderFinishedEventArgs>;IEventEmitterOfT<RenderFinishedEventArgs> RenderFinished { get; }val renderFinished: IEventEmitterOfT<RenderFinishedEventArgs>