new Window(options)
Window displays the various stimuli of the experiment.
It sets up a PIXI renderer, which we use to render the experiment stimuli.
Parameters:
Name | Type | Description | |||||||||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
options |
Object |
Properties
|
- Source:
Extends
- PsychObject
Methods
(private) _onResize(win)
Treat a window resize event.
We adjust the size of the renderer and the position of the root container.
Note: since this method will be called by the DOM window (i.e. 'this' is the DOM window), we need to pass it a Window.
Parameters:
Name | Type | Description |
---|---|---|
win |
Window | The PsychoJS window |
- Source:
(private) _refresh()
Recompute the window's _drawList and _container children for the next animation frame.
- Source:
(private) _setupPixi()
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.
- Source:
(private) _updateIfNeeded()
Update this window, if need be.
- Source:
(private) _writeLogOnFlip()
Send all logged messages to the Logger.
- Source:
adjustScreenSize()
Take the browser full screen if possible.
- Source:
callOnFlip(flipCallback, …flipCallbackArgs)
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. |
- Source:
close()
Close the window.
Note: this actually only removes the canvas used to render the experiment stimuli.
- Source:
experimentEnded()
Setter for experimentEnded.
- Source:
experimentEnded()
Getter for experimentEnded.
- Source:
experimentHandler()
Setter for experimentHandler.
- Source:
experimentHandler()
Getter for experimentHandler.
- Source:
getActualFrameRate() → {number}
Estimate the frame rate.
- Source:
- To Do:
-
- estimate the actual frame rate.
Returns:
always returns 60.0 at the moment
- Type
- number
logOnFlip(options, level, objopt)
Log a message.
Note: the message will be time-stamped at the next call to requestAnimationFrame.
Parameters:
Name | Type | Attributes | Description | ||||||
---|---|---|---|---|---|---|---|---|---|
options |
Object |
Properties
|
|||||||
level |
integer | the log level | |||||||
obj |
Object |
<optional> |
the object associated with the message |
- Source:
monitorFramePeriod()
Getter for monitorFramePeriod.
- Source:
render()
Render the stimuli onto the canvas.
- Source:
Type Definitions
OnFlipCallback(argsopt)
Callback function for callOnFlip.
Parameters:
Name | Type | Attributes | Description |
---|---|---|---|
args |
* |
<optional> |
optional arguments |
- Source: