1
0
mirror of https://github.com/psychopy/psychojs.git synced 2025-05-10 10:40:54 +00:00
psychojs/docs/module-visual.ShapeStim.html
2019-03-12 09:28:31 +01:00

2048 lines
29 KiB
HTML

<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>JSDoc: Class: ShapeStim</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: ShapeStim</h1>
<section>
<header>
<h2><span class="attribs"><span class="type-signature"></span></span>
<span class="ancestors"><a href="module-visual.html">visual</a>.</span>ShapeStim<span class="signature">(options)</span><span class="type-signature"></span></h2>
<div class="class-description"><p>This class provides the basic functionalities of shape stimuli.</p></div>
</header>
<article>
<div class="container-overview">
<h2>Constructor</h2>
<h4 class="name" id="ShapeStim"><span class="type-signature"></span>new ShapeStim<span class="signature">(options)</span><span class="type-signature"></span></h4>
<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>name</code></td>
<td class="type">
<span class="param-type">String</span>
</td>
<td class="attributes">
</td>
<td class="default">
</td>
<td class="description last">the name used when logging messages from this stimulus</td>
</tr>
<tr>
<td class="name"><code>win</code></td>
<td class="type">
<span class="param-type">Window</span>
</td>
<td class="attributes">
</td>
<td class="default">
</td>
<td class="description last">the associated Window</td>
</tr>
<tr>
<td class="name"><code>lineWidth</code></td>
<td class="type">
<span class="param-type">number</span>
</td>
<td class="attributes">
</td>
<td class="default">
</td>
<td class="description last">the line width</td>
</tr>
<tr>
<td class="name"><code>lineColor</code></td>
<td class="type">
<span class="param-type">Color</span>
</td>
<td class="attributes">
&lt;optional><br>
</td>
<td class="default">
Color('white')
</td>
<td class="description last">the line color</td>
</tr>
<tr>
<td class="name"><code>fillColor</code></td>
<td class="type">
<span class="param-type">Color</span>
</td>
<td class="attributes">
</td>
<td class="default">
</td>
<td class="description last">the fill color</td>
</tr>
<tr>
<td class="name"><code>opacity</code></td>
<td class="type">
<span class="param-type">number</span>
</td>
<td class="attributes">
&lt;optional><br>
</td>
<td class="default">
1.0
</td>
<td class="description last">the opacity</td>
</tr>
<tr>
<td class="name"><code>vertices</code></td>
<td class="type">
<span class="param-type">Array.&lt;Array.&lt;number>></span>
</td>
<td class="attributes">
&lt;optional><br>
</td>
<td class="default">
[[-0.5, 0], [0, 0.5], [0.5, 0]]
</td>
<td class="description last">the shape vertices</td>
</tr>
<tr>
<td class="name"><code>closeShape</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 the shape is closed</td>
</tr>
<tr>
<td class="name"><code>pos</code></td>
<td class="type">
<span class="param-type">Array.&lt;number></span>
</td>
<td class="attributes">
&lt;optional><br>
</td>
<td class="default">
[0, 0]
</td>
<td class="description last">the position of the center of the shape</td>
</tr>
<tr>
<td class="name"><code>size</code></td>
<td class="type">
<span class="param-type">number</span>
</td>
<td class="attributes">
&lt;optional><br>
</td>
<td class="default">
1.0
</td>
<td class="description last">the size</td>
</tr>
<tr>
<td class="name"><code>ori</code></td>
<td class="type">
<span class="param-type">number</span>
</td>
<td class="attributes">
&lt;optional><br>
</td>
<td class="default">
0.0
</td>
<td class="description last">the orientation (in degrees)</td>
</tr>
<tr>
<td class="name"><code>units</code></td>
<td class="type">
<span class="param-type">string</span>
</td>
<td class="attributes">
</td>
<td class="default">
</td>
<td class="description last">the units of the stimulus vertices, size and position</td>
</tr>
<tr>
<td class="name"><code>contrast</code></td>
<td class="type">
<span class="param-type">number</span>
</td>
<td class="attributes">
&lt;optional><br>
</td>
<td class="default">
1.0
</td>
<td class="description last">the contrast</td>
</tr>
<tr>
<td class="name"><code>depth</code></td>
<td class="type">
<span class="param-type">number</span>
</td>
<td class="attributes">
&lt;optional><br>
</td>
<td class="default">
0
</td>
<td class="description last">the depth</td>
</tr>
<tr>
<td class="name"><code>interpolate</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 the shape is interpolated</td>
</tr>
<tr>
<td class="name"><code>autoDraw</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 the stimulus should be automatically drawn on every frame flip</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">
false
</td>
<td class="description last">whether or not to log</td>
</tr>
</tbody>
</table>
</td>
</tr>
</tbody>
</table>
<dl class="details">
<dt class="mixes">Mixes In:</dt>
<dd class="mixes"><ul>
<li>ColorMixin</li>
</ul></dd>
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="visual_ShapeStim.js.html">visual/ShapeStim.js</a>, <a href="visual_ShapeStim.js.html#line43">line 43</a>
</li></ul></dd>
</dl>
</div>
<h3 class="subsection-title">Extends</h3>
<ul>
<li>VisualStim</li>
</ul>
<h3 class="subsection-title">Methods</h3>
<h4 class="name" id="_getPolygon"><span class="type-signature">(private) </span>_getPolygon<span class="signature">()</span><span class="type-signature"> &rarr; {Object}</span></h4>
<div class="description">
Get the PIXI polygon (in pixel units) corresponding to the vertices.
</div>
<dl class="details">
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="visual_ShapeStim.js.html">visual/ShapeStim.js</a>, <a href="visual_ShapeStim.js.html#line205">line 205</a>
</li></ul></dd>
</dl>
<h5>Returns:</h5>
<div class="param-desc">
the PIXI polygon corresponding to this stimulus vertices.
</div>
<dl>
<dt>
Type
</dt>
<dd>
<span class="param-type">Object</span>
</dd>
</dl>
<h4 class="name" id="_updateIfNeeded"><span class="type-signature">(private) </span>_updateIfNeeded<span class="signature">()</span><span class="type-signature"></span></h4>
<div class="description">
Update the stimulus, if necessary.
</div>
<dl class="details">
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="visual_ShapeStim.js.html">visual/ShapeStim.js</a>, <a href="visual_ShapeStim.js.html#line171">line 171</a>
</li></ul></dd>
</dl>
<h4 class="name" id="contains"><span class="type-signature"></span>contains<span class="signature">(object, units)</span><span class="type-signature"> &rarr; {boolean}</span></h4>
<div class="description">
Determine whether this stimulus contains the given object.
</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>object</code></td>
<td class="type">
<span class="param-type">Object</span>
</td>
<td class="description last">the object</td>
</tr>
<tr>
<td class="name"><code>units</code></td>
<td class="type">
<span class="param-type">string</span>
</td>
<td class="description last">the units</td>
</tr>
</tbody>
</table>
<dl class="details">
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="visual_ShapeStim.js.html">visual/ShapeStim.js</a>, <a href="visual_ShapeStim.js.html#line149">line 149</a>
</li></ul></dd>
</dl>
<h5>Returns:</h5>
<div class="param-desc">
whether or not the stimulus contains the object
</div>
<dl>
<dt>
Type
</dt>
<dd>
<span class="param-type">boolean</span>
</dd>
</dl>
<h4 class="name" id="setFillColor"><span class="type-signature"></span>setFillColor<span class="signature">(fillColor, log<span class="signature-attributes">opt</span>)</span><span class="type-signature"></span></h4>
<div class="description">
Setter for the fill color attribute.
</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>fillColor</code></td>
<td class="type">
<span class="param-type">Color</span>
</td>
<td class="attributes">
</td>
<td class="default">
</td>
<td class="description last">the fill color</td>
</tr>
<tr>
<td class="name"><code>log</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 of not to log</td>
</tr>
</tbody>
</table>
<dl class="details">
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="visual_ShapeStim.js.html">visual/ShapeStim.js</a>, <a href="visual_ShapeStim.js.html#line111">line 111</a>
</li></ul></dd>
</dl>
<h4 class="name" id="setLineColor"><span class="type-signature"></span>setLineColor<span class="signature">(lineColor, log<span class="signature-attributes">opt</span>)</span><span class="type-signature"></span></h4>
<div class="description">
Setter for the line color attribute.
</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>lineColor</code></td>
<td class="type">
<span class="param-type">Color</span>
</td>
<td class="attributes">
</td>
<td class="default">
</td>
<td class="description last">the line color</td>
</tr>
<tr>
<td class="name"><code>log</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 of not to log</td>
</tr>
</tbody>
</table>
<dl class="details">
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="visual_ShapeStim.js.html">visual/ShapeStim.js</a>, <a href="visual_ShapeStim.js.html#line97">line 97</a>
</li></ul></dd>
</dl>
<h4 class="name" id="setLineWidth"><span class="type-signature"></span>setLineWidth<span class="signature">(lineWidth, log<span class="signature-attributes">opt</span>)</span><span class="type-signature"></span></h4>
<div class="description">
Setter for the line width attribute.
</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>lineWidth</code></td>
<td class="type">
<span class="param-type">number</span>
</td>
<td class="attributes">
</td>
<td class="default">
</td>
<td class="description last">the line width</td>
</tr>
<tr>
<td class="name"><code>log</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 of not to log</td>
</tr>
</tbody>
</table>
<dl class="details">
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="visual_ShapeStim.js.html">visual/ShapeStim.js</a>, <a href="visual_ShapeStim.js.html#line83">line 83</a>
</li></ul></dd>
</dl>
<h4 class="name" id="setVertices"><span class="type-signature"></span>setVertices<span class="signature">(vertices, log<span class="signature-attributes">opt</span>)</span><span class="type-signature"></span></h4>
<div class="description">
Setter for the vertices attribute.
</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>vertices</code></td>
<td class="type">
<span class="param-type">Array.&lt;Array.&lt;number>></span>
</td>
<td class="attributes">
</td>
<td class="default">
</td>
<td class="description last">the vertices</td>
</tr>
<tr>
<td class="name"><code>log</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 of not to log</td>
</tr>
</tbody>
</table>
<dl class="details">
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="visual_ShapeStim.js.html">visual/ShapeStim.js</a>, <a href="visual_ShapeStim.js.html#line125">line 125</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.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.Logger.html">Logger</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.ImageStim.html">ImageStim</a></li><li><a href="module-visual.MovieStim.html">MovieStim</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.TextStim.html">TextStim</a></li><li><a href="module-visual.VisualStim.html">VisualStim</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><h3>Interfaces</h3><ul><li><a href="module-sound.SoundPlayer.html">SoundPlayer</a></li></ul>
</nav>
<br class="clear">
<footer>
Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.5.5</a> on Tue Mar 12 2019 08:55:12 GMT+0100 (CET)
</footer>
<script> prettyPrint(); </script>
<script src="scripts/linenumber.js"> </script>
</body>
</html>