Skip to main content

Custom Renderer

Feel free to create your own renderer. Renderer has to implement common interface


export interface IRenderer {

containerWidth: number
isInitialized: boolean

settings: Settings
eventManager: EventManager

init(): void

preRender(height: number, fontSize: number): void

postRender(): void

clear(): void

destroy(): void

setColor(color: string): void

drawRect(x: number, y: number, width: number, height: number): void

drawGlyph(glyph: string | number, x: number, y: number): void

renderInGroup(object: object, renderCallback: () => void): void
}

Example:

class CustomRenderer {
// implementation according to Renderer interface
}

const scoreStorm = new ScoreStorm()

scoreStorm.setRenderer(new CustomRenderer(/** args **/))
scoreStorm.render()