1
0
mirror of https://github.com/psychopy/psychojs.git synced 2025-05-10 10:40:54 +00:00
psychojs/docs/module-core.Window.html
Alain Pitiot 73cb6f6e40 _
2021-04-27 08:20:15 +02:00

2054 lines
25 KiB
HTML

<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>JSDoc: Class: Window</title>
<script src="scripts/prettify/prettify.js"> </script>
<script src="scripts/prettify/lang-css.js"> </script>
<!--[if lt IE 9]>
<script src="//html5shiv.googlecode.com/svn/trunk/html5.js"></script>
<![endif]-->
<link type="text/css" rel="stylesheet" href="styles/prettify-tomorrow.css">
<link type="text/css" rel="stylesheet" href="styles/jsdoc-default.css">
</head>
<body>
<div id="main">
<h1 class="page-title">Class: Window</h1>
<section>
<header>
<h2><span class="attribs"><span class="type-signature"></span></span>
<span class="ancestors"><a href="module-core.html">core</a>.</span>Window<span class="signature">(options)</span><span class="type-signature"></span></h2>
</header>
<article>
<div class="container-overview">
<h4 class="name" id="Window"><span class="type-signature"></span>new Window<span class="signature">(options)</span><span class="type-signature"></span></h4>
<div class="description">
<p>Window displays the various stimuli of the experiment.</p>
<p>It sets up a <a href="http://www.pixijs.com/">PIXI</a> renderer, which we use to render the experiment stimuli.</p>
</div>
<h5>Parameters:</h5>
<table class="params">
<thead>
<tr>
<th>Name</th>
<th>Type</th>
<th class="last">Description</th>
</tr>
</thead>
<tbody>
<tr>
<td class="name"><code>options</code></td>
<td class="type">
<span class="param-type">Object</span>
</td>
<td class="description last">
<h6>Properties</h6>
<table class="params">
<thead>
<tr>
<th>Name</th>
<th>Type</th>
<th>Attributes</th>
<th>Default</th>
<th class="last">Description</th>
</tr>
</thead>
<tbody>
<tr>
<td class="name"><code>psychoJS</code></td>
<td class="type">
<span class="param-type"><a href="module-core.PsychoJS.html">module:core.PsychoJS</a></span>
</td>
<td class="attributes">
</td>
<td class="default">
</td>
<td class="description last">the PsychoJS instance</td>
</tr>
<tr>
<td class="name"><code>name</code></td>
<td class="type">
<span class="param-type">string</span>
</td>
<td class="attributes">
&lt;optional><br>
</td>
<td class="default">
</td>
<td class="description last">the name of the window</td>
</tr>
<tr>
<td class="name"><code>fullscr</code></td>
<td class="type">
<span class="param-type">boolean</span>
</td>
<td class="attributes">
&lt;optional><br>
</td>
<td class="default">
false
</td>
<td class="description last">whether or not to go fullscreen</td>
</tr>
<tr>
<td class="name"><code>color</code></td>
<td class="type">
<span class="param-type">Color</span>
</td>
<td class="attributes">
&lt;optional><br>
</td>
<td class="default">
Color('black')
</td>
<td class="description last">the background color of the window</td>
</tr>
<tr>
<td class="name"><code>units</code></td>
<td class="type">
<span class="param-type">string</span>
</td>
<td class="attributes">
&lt;optional><br>
</td>
<td class="default">
'pix'
</td>
<td class="description last">the units of the window</td>
</tr>
<tr>
<td class="name"><code>waitBlanking</code></td>
<td class="type">
<span class="param-type">boolean</span>
</td>
<td class="attributes">
&lt;optional><br>
</td>
<td class="default">
false
</td>
<td class="description last">whether or not to wait for all rendering operations to be done
before flipping</td>
</tr>
<tr>
<td class="name"><code>autoLog</code></td>
<td class="type">
<span class="param-type">boolean</span>
</td>
<td class="attributes">
&lt;optional><br>
</td>
<td class="default">
true
</td>
<td class="description last">whether or not to log</td>
</tr>
</tbody>
</table>
</td>
</tr>
</tbody>
</table>
<dl class="details">
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="core_Window.js.html">core/Window.js</a>, <a href="core_Window.js.html#line15">line 15</a>
</li></ul></dd>
</dl>
</div>
<h3 class="subsection-title">Extends</h3>
<ul>
<li>PsychObject</li>
</ul>
<h3 class="subsection-title">Methods</h3>
<h4 class="name" id="adjustScreenSize"><span class="type-signature"></span>adjustScreenSize<span class="signature">()</span><span class="type-signature"></span></h4>
<div class="description">
Take the browser full screen if possible.
</div>
<dl class="details">
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="core_Window.js.html">core/Window.js</a>, <a href="core_Window.js.html#line161">line 161</a>
</li></ul></dd>
</dl>
<h4 class="name" id="callOnFlip"><span class="type-signature"></span>callOnFlip<span class="signature">(flipCallback, &hellip;flipCallbackArgs)</span><span class="type-signature"></span></h4>
<div class="description">
Add a callback function that will run after the next screen flip, i.e. immediately after the next rendering of the
Window.
<p>This is typically used to reset a timer or clock.</p>
</div>
<h5>Parameters:</h5>
<table class="params">
<thead>
<tr>
<th>Name</th>
<th>Type</th>
<th>Attributes</th>
<th class="last">Description</th>
</tr>
</thead>
<tbody>
<tr>
<td class="name"><code>flipCallback</code></td>
<td class="type">
<span class="param-type"><a href="module-core.Window.html#~OnFlipCallback">module:core.Window~OnFlipCallback</a></span>
</td>
<td class="attributes">
</td>
<td class="description last">callback function.</td>
</tr>
<tr>
<td class="name"><code>flipCallbackArgs</code></td>
<td class="type">
<span class="param-type">*</span>
</td>
<td class="attributes">
&lt;repeatable><br>
</td>
<td class="description last">arguments for the callback function.</td>
</tr>
</tbody>
</table>
<dl class="details">
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="core_Window.js.html">core/Window.js</a>, <a href="core_Window.js.html#line279">line 279</a>
</li></ul></dd>
</dl>
<h4 class="name" id="close"><span class="type-signature"></span>close<span class="signature">()</span><span class="type-signature"></span></h4>
<div class="description">
Close the window.
<p> Note: this actually only removes the canvas used to render the experiment stimuli.</p>
</div>
<dl class="details">
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="core_Window.js.html">core/Window.js</a>, <a href="core_Window.js.html#line106">line 106</a>
</li></ul></dd>
</dl>
<h4 class="name" id="closeFullScreen"><span class="type-signature"></span>closeFullScreen<span class="signature">()</span><span class="type-signature"></span></h4>
<div class="description">
Take the browser back from full screen if needed.
</div>
<dl class="details">
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="core_Window.js.html">core/Window.js</a>, <a href="core_Window.js.html#line208">line 208</a>
</li></ul></dd>
</dl>
<h4 class="name" id="experimentEnded"><span class="type-signature"></span>experimentEnded<span class="signature">()</span><span class="type-signature"></span></h4>
<div class="description">
Getter for experimentEnded.
</div>
<dl class="details">
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="data_ExperimentHandler.js.html">data/ExperimentHandler.js</a>, <a href="data_ExperimentHandler.js.html#line32">line 32</a>
</li></ul></dd>
</dl>
<h4 class="name" id="experimentEnded"><span class="type-signature"></span>experimentEnded<span class="signature">()</span><span class="type-signature"></span></h4>
<div class="description">
Setter for experimentEnded.
</div>
<dl class="details">
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="data_ExperimentHandler.js.html">data/ExperimentHandler.js</a>, <a href="data_ExperimentHandler.js.html#line44">line 44</a>
</li></ul></dd>
</dl>
<h4 class="name" id="experimentHandler"><span class="type-signature"></span>experimentHandler<span class="signature">()</span><span class="type-signature"></span></h4>
<div class="description">
Getter for experimentHandler.
</div>
<dl class="details">
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="data_TrialHandler.js.html">data/TrialHandler.js</a>, <a href="data_TrialHandler.js.html#line34">line 34</a>
</li></ul></dd>
</dl>
<h4 class="name" id="experimentHandler"><span class="type-signature"></span>experimentHandler<span class="signature">()</span><span class="type-signature"></span></h4>
<div class="description">
Setter for experimentHandler.
</div>
<dl class="details">
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="data_TrialHandler.js.html">data/TrialHandler.js</a>, <a href="data_TrialHandler.js.html#line46">line 46</a>
</li></ul></dd>
</dl>
<h4 class="name" id="getActualFrameRate"><span class="type-signature"></span>getActualFrameRate<span class="signature">()</span><span class="type-signature"> &rarr; {number}</span></h4>
<div class="description">
Estimate the frame rate.
</div>
<dl class="details">
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="core_Window.js.html">core/Window.js</a>, <a href="core_Window.js.html#line143">line 143</a>
</li></ul></dd>
</dl>
<h5>Returns:</h5>
<div class="param-desc">
rAF based delta time based approximation, 60.0 by default
</div>
<dl>
<dt>
Type
</dt>
<dd>
<span class="param-type">number</span>
</dd>
</dl>
<h4 class="name" id="logOnFlip"><span class="type-signature"></span>logOnFlip<span class="signature">(options, level<span class="signature-attributes">opt</span>, obj<span class="signature-attributes">opt</span>)</span><span class="type-signature"></span></h4>
<div class="description">
Log a message.
<p> Note: the message will be time-stamped at the next call to requestAnimationFrame.</p>
</div>
<h5>Parameters:</h5>
<table class="params">
<thead>
<tr>
<th>Name</th>
<th>Type</th>
<th>Attributes</th>
<th>Default</th>
<th class="last">Description</th>
</tr>
</thead>
<tbody>
<tr>
<td class="name"><code>options</code></td>
<td class="type">
<span class="param-type">Object</span>
</td>
<td class="attributes">
</td>
<td class="default">
</td>
<td class="description last">
<h6>Properties</h6>
<table class="params">
<thead>
<tr>
<th>Name</th>
<th>Type</th>
<th class="last">Description</th>
</tr>
</thead>
<tbody>
<tr>
<td class="name"><code>msg</code></td>
<td class="type">
<span class="param-type">String</span>
</td>
<td class="description last">the message to be logged</td>
</tr>
</tbody>
</table>
</td>
</tr>
<tr>
<td class="name"><code>level</code></td>
<td class="type">
<span class="param-type">module:util.Logger.ServerLevel</span>
</td>
<td class="attributes">
&lt;optional><br>
</td>
<td class="default">
module:util.Logger.ServerLevel.EXP
</td>
<td class="description last">the log level</td>
</tr>
<tr>
<td class="name"><code>obj</code></td>
<td class="type">
<span class="param-type">Object</span>
</td>
<td class="attributes">
&lt;optional><br>
</td>
<td class="default">
</td>
<td class="description last">the object associated with the message</td>
</tr>
</tbody>
</table>
<dl class="details">
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="core_Window.js.html">core/Window.js</a>, <a href="core_Window.js.html#line250">line 250</a>
</li></ul></dd>
</dl>
<h4 class="name" id="monitorFramePeriod"><span class="type-signature"></span>monitorFramePeriod<span class="signature">()</span><span class="type-signature"></span></h4>
<div class="description">
Getter for monitorFramePeriod.
</div>
<dl class="details">
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="core_Window.js.html">core/Window.js</a>, <a href="core_Window.js.html#line35">line 35</a>
</li></ul></dd>
</dl>
<h4 class="name" id="render"><span class="type-signature"></span>render<span class="signature">()</span><span class="type-signature"></span></h4>
<div class="description">
Render the stimuli onto the canvas.
</div>
<dl class="details">
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="core_Window.js.html">core/Window.js</a>, <a href="core_Window.js.html#line297">line 297</a>
</li></ul></dd>
</dl>
<h3 class="subsection-title">Type Definitions</h3>
<h4 class="name" id="~OnFlipCallback"><span class="type-signature"></span>OnFlipCallback<span class="signature">(args<span class="signature-attributes">opt</span>)</span><span class="type-signature"></span></h4>
<div class="description">
Callback function for callOnFlip.
</div>
<h5>Parameters:</h5>
<table class="params">
<thead>
<tr>
<th>Name</th>
<th>Type</th>
<th>Attributes</th>
<th class="last">Description</th>
</tr>
</thead>
<tbody>
<tr>
<td class="name"><code>args</code></td>
<td class="type">
<span class="param-type">*</span>
</td>
<td class="attributes">
&lt;optional><br>
</td>
<td class="description last">optional arguments</td>
</tr>
</tbody>
</table>
<dl class="details">
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="core_Window.js.html">core/Window.js</a>, <a href="core_Window.js.html#line273">line 273</a>
</li></ul></dd>
</dl>
</article>
</section>
</div>
<nav>
<h2><a href="index.html">Home</a></h2><h3>Modules</h3><ul><li><a href="module-core.html">core</a></li><li><a href="module-data.html">data</a></li><li><a href="module-sound.html">sound</a></li><li><a href="module-util.html">util</a></li><li><a href="module-visual.html">visual</a></li></ul><h3>Classes</h3><ul><li><a href="module-core.BuilderKeyResponse.html">BuilderKeyResponse</a></li><li><a href="module-core.EventManager.html">EventManager</a></li><li><a href="module-core.GUI.html">GUI</a></li><li><a href="module-core.Keyboard.html">Keyboard</a></li><li><a href="module-core.KeyPress.html">KeyPress</a></li><li><a href="module-core.Logger.html">Logger</a></li><li><a href="module-core.MinimalStim.html">MinimalStim</a></li><li><a href="module-core.Mouse.html">Mouse</a></li><li><a href="module-core.PsychoJS.html">PsychoJS</a></li><li><a href="module-core.ServerManager.html">ServerManager</a></li><li><a href="module-core.Window.html">Window</a></li><li><a href="module-data.ExperimentHandler.html">ExperimentHandler</a></li><li><a href="module-data.TrialHandler.html">TrialHandler</a></li><li><a href="module-sound.Sound.html">Sound</a></li><li><a href="module-sound.TonePlayer.html">TonePlayer</a></li><li><a href="module-sound.TrackPlayer.html">TrackPlayer</a></li><li><a href="module-util.Clock.html">Clock</a></li><li><a href="module-util.Color.html">Color</a></li><li><a href="module-util.CountdownTimer.html">CountdownTimer</a></li><li><a href="module-util.EventEmitter.html">EventEmitter</a></li><li><a href="module-util.MixinBuilder.html">MixinBuilder</a></li><li><a href="module-util.MonotonicClock.html">MonotonicClock</a></li><li><a href="module-util.PsychObject.html">PsychObject</a></li><li><a href="module-util.Scheduler.html">Scheduler</a></li><li><a href="module-visual.Form.html">Form</a></li><li><a href="module-visual.ImageStim.html">ImageStim</a></li><li><a href="module-visual.MovieStim.html">MovieStim</a></li><li><a href="module-visual.Polygon.html">Polygon</a></li><li><a href="module-visual.Rect.html">Rect</a></li><li><a href="module-visual.ShapeStim.html">ShapeStim</a></li><li><a href="module-visual.Slider.html">Slider</a></li><li><a href="module-visual.TextBox.html">TextBox</a></li><li><a href="module-visual.TextStim.html">TextStim</a></li><li><a href="module-visual.VisualStim.html">VisualStim</a></li><li><a href="TextInput.html">TextInput</a></li></ul><h3>Interfaces</h3><ul><li><a href="module-sound.SoundPlayer.html">SoundPlayer</a></li></ul><h3>Mixins</h3><ul><li><a href="module-core.WindowMixin.html">WindowMixin</a></li><li><a href="module-util.ColorMixin.html">ColorMixin</a></li></ul>
</nav>
<br class="clear">
<footer>
Documentation generated by <a href="https://github.com/jsdoc/jsdoc">JSDoc 3.6.6</a> on Fri Apr 09 2021 14:03:40 GMT+0200 (Central European Summer Time)
</footer>
<script> prettyPrint(); </script>
<script src="scripts/linenumber.js"> </script>
</body>
</html>