Skip to main content

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


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 : unknown

    The element to inspect.


inspectPosition

                            
                              
                                public 
                                inspectPosition
                                
                                  
                                    
                                      x
                                      : 
                                      number
                                    
                                    
                                      y
                                      : 
                                      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 
                                transformMousePosition
                                
                                  
                                    
                                      x
                                      : 
                                      number
                                    
                                    
                                      y
                                      : 
                                      number
                                    
                                  
                                
                                : 
                                
                                  
                                    
                                      null
                                    
                                    
                                      Vector2
                                    
                                  
                                
                              
                              

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

Parameters

  • x : number

    The x coordinate.

  • y : number

    The y coordinate.


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 : unknown

    The element to validate.