CanvasDecoration Interface

A Decoration that is drawn onto the 2d canvas on top of a ScreenViewport. CanvasDecorations may be pickable by implementing CanvasDecoration.pick.

extensions

Implemented by

Methods

Name Description
drawDecoration(ctx: CanvasRenderingContext2D): void Required method to draw this decoration into the supplied CanvasRenderingContext2D.  
onMouseButton(ev: BeButtonEvent): boolean Optional Optional method to be called whenever this decorator is picked and a mouse button is pressed or released inside this decoration.  
onMouseEnter(ev: BeButtonEvent): void Optional Optional method to be called whenever this decorator is picked and the mouse first enters this decoration.  
onMouseLeave(): void Optional Optional method to be called whenever when the mouse leaves this decoration.  
onMouseMove(ev: BeButtonEvent): void Optional Optional method to be called whenever when the mouse moves inside this decoration.  
onWheel(ev: BeWheelEvent): boolean Optional Optional method to be called when the mouse wheel is rolled with the pointer over this decoration.  
pick(pt: Readonly<WritableXAndY>): boolean Optional Optional method to provide feedback when mouse events occur on this decoration.  

Properties

Name Type Description
decorationCursor undefined | string Cursor to use when mouse is inside this decoration.  
position undefined | Readonly<WritableXAndY> Optional view coordinates position of this overlay decoration.  

Defined in

Last Updated: 30 November, 2023