Constructor
new Window(options)
- Source:
 
Parameters:
| Name | Type | Description | ||||||||||||||||||||||||||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
options | 
            
            Object | 
                Properties
  | 
        
Extends
- PsychObject
 
Methods
(protected, static) _resizePixiRenderer(pjsWindow, event)
- Source:
 
Adjust the size of the renderer and the position of the root container in response to a change in the browser's size.
Parameters:
| Name | Type | Description | 
|---|---|---|
pjsWindow | 
            
            module:core.Window | the PsychoJS Window  | 
        
event | 
            
            
(protected) _fullRefresh()
- Source:
 
Force an update of all stimuli in this window's drawlist.
(protected) _refresh()
- Source:
 
Recompute this window's draw list and _container children for the next animation frame.
(protected) _setupPixi()
- Source:
 
Setup PIXI.
A new renderer is created and a container is added to it. The renderer's touch and mouse events
are handled by the EventManager.
(protected) _updateIfNeeded()
- Source:
 
Update this window, if need be.
(protected) _writeLogOnFlip()
- Source:
 
Send all logged messages to the Logger.
addPixiObject()
- Source:
 
Add PIXI.DisplayObject to the container displayed on the scene (window)
adjustScreenSize()
- Source:
 
Take the browser full screen if possible.
callOnFlip(flipCallback, …flipCallbackArgs)
- Source:
 
Add a callback function that will run after the next screen flip, i.e. immediately after the next rendering of the Window.
This is typically used to reset a timer or clock.
Parameters:
| Name | Type | Attributes | Description | 
|---|---|---|---|
flipCallback | 
            
            module:core.Window~OnFlipCallback | callback function.  | 
        |
flipCallbackArgs | 
            
            * | 
                
                
                
                    <repeatable> | 
            
            
            arguments for the callback function.  | 
        
close()
- Source:
 
Close the window.
Note: this actually only removes the canvas used to render the experiment stimuli.
closeFullScreen()
- Source:
 
Take the browser back from full screen if needed.
getActualFrameRate() → {number}
- Source:
 
Estimate the frame rate.
Returns:
rAF based delta time based approximation, 60.0 by default
- Type
 - number
 
logOnFlip(options, levelopt, objopt)
- Source:
 
Log a message.
Note: the message will be time-stamped at the next call to requestAnimationFrame.
Parameters:
| Name | Type | Attributes | Default | Description | ||||||
|---|---|---|---|---|---|---|---|---|---|---|
options | 
            
            Object | 
                Properties
  | 
        ||||||||
level | 
            
            module:util.Logger.ServerLevel | 
                
                    <optional> | 
            
            
                
                
                    module:util.Logger.ServerLevel.EXP
                
                 | 
            
            the log level  | 
        ||||||
obj | 
            
            Object | 
                
                    <optional> | 
            
            
                the object associated with the message  | 
        
removePixiObject()
- Source:
 
Remove PIXI.DisplayObject from the container displayed on the scene (window)
render()
- Source:
 
Render the stimuli onto the canvas.