Skip to main content

Inspectable

interface Inspectable 

Scenes can implement this interface to make their components inspectable through the UI.

Methods

drawOverlay

public drawOverlayelement: unknownmatrix: DOMMatrixcontext: CanvasRenderingContext2D: void

Draw an overlay for the inspected element.

This method can be used to overlay additional information about an element on top of the animation.

Parameters


inspectAttributes

public inspectAttributeselement: unknown: nullInspectedAttributes

Return the attributes of the inspected element.

This information will be displayed in the "Properties" panel.

Parameters

  • element: unknown

    The element to inspect.


inspectPosition

public inspectPositionx: numbery: number: unknown

Get a possible element to inspect at a given position.

Parameters

  • x: number

    The x coordinate.

  • y: number

    The y coordinate.


transformMousePosition

public transformMousePositionx: numbery: number: nullVector2

Transform the absolute mouse coordinates into the scene's coordinate system.

Parameters

  • x: number

    The x coordinate.

  • y: number

    The y coordinate.


validateInspection

public validateInspectionelement: unknown: unknown

Check if the inspected element is still valid.

If a scene destroys and recreates its components upon every reset, the reference may no longer be valid. Even though the component is still present. This method should check that and return a new reference.

Parameters

  • element: unknown

    The element to validate.