Inspectable
interface
Inspectable
Scenes can implement this interface to make their componentsinspectable through the UI.
Methods
drawOverlay
public
drawOverlay
element
:
unknown
matrix
:
DOMMatrix
context
:
CanvasRenderingContext2D
:
void
Draw an overlay for the inspected element.
This method can be used to overlay additional information about anelement on top of the animation.
Parameters
-
element : unknownThe element for which to draw an overlay.
-
matrix : DOMMatrixA local-to-screen matrix.
-
context : CanvasRenderingContext2DThe context to draw with.
inspectAttributes
public
inspectAttributes
element
:
unknown
:
null
InspectedAttributes
Return the attributes of the inspected element.
This information will be displayed in the "Properties" panel.
Parameters
-
element : unknownThe element to inspect.
inspectPosition
Get a possible element to inspect at a given position.
Parameters
transformMousePosition
Transform the absolute mouse coordinates into the scene's coordinate system.
Parameters
validateInspection
public
validateInspection
element
:
unknown
:
unknown
Check if the inspected element is still valid.
If a scene destroys and recreates its components upon every reset, thereference may no longer be valid. Even though the component is stillpresent. This method should check that and return a new reference.
Parameters
-
element : unknownThe element to validate.