Stencil.html 5.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357
  1. <!DOCTYPE html>
  2. <html lang="en">
  3. <head>
  4. <meta charset="utf-8">
  5. <title>JSDoc: Class: Stencil</title>
  6. <script src="scripts/prettify/prettify.js"> </script>
  7. <script src="scripts/prettify/lang-css.js"> </script>
  8. <!--[if lt IE 9]>
  9. <script src="//html5shiv.googlecode.com/svn/trunk/html5.js"></script>
  10. <![endif]-->
  11. <link type="text/css" rel="stylesheet" href="styles/prettify-tomorrow.css">
  12. <link type="text/css" rel="stylesheet" href="styles/jsdoc-default.css">
  13. </head>
  14. <body>
  15. <div id="main">
  16. <h1 class="page-title">Class: Stencil</h1>
  17. <section>
  18. <header>
  19. <h2><span class="attribs"><span class="type-signature"></span></span>Stencil<span class="signature">()</span><span class="type-signature"></span></h2>
  20. </header>
  21. <article>
  22. <div class="container-overview">
  23. <h4 class="name" id="Stencil"><span class="type-signature"></span>new Stencil<span class="signature">()</span><span class="type-signature"></span></h4>
  24. <div class="description">
  25. A stencil can be used to set the drawing region. Stencils are treated as objects their shaphe is used to filter other objects shape. Multiple stencil objects can be active simulatenously.
  26. </div>
  27. <dl class="details">
  28. <dt class="tag-source">Source:</dt>
  29. <dd class="tag-source"><ul class="dummy"><li>
  30. <a href="stencil_Stencil.js.html">stencil/Stencil.js</a>, <a href="stencil_Stencil.js.html#line16">line 16</a>
  31. </li></ul></dd>
  32. </dl>
  33. </div>
  34. <h3 class="subsection-title">Methods</h3>
  35. <h4 class="name" id="clip"><span class="type-signature"></span>clip<span class="signature">(context, viewport, canvas)</span><span class="type-signature"></span></h4>
  36. <div class="description">
  37. Clip the canvas context, to ensure that next objects being drawn are cliped to the path stored here.
  38. </div>
  39. <h5>Parameters:</h5>
  40. <table class="params">
  41. <thead>
  42. <tr>
  43. <th>Name</th>
  44. <th>Type</th>
  45. <th class="last">Description</th>
  46. </tr>
  47. </thead>
  48. <tbody>
  49. <tr>
  50. <td class="name"><code>context</code></td>
  51. <td class="type">
  52. <span class="param-type">CanvasContext</span>
  53. </td>
  54. <td class="description last">Canvas 2d drawing context.</td>
  55. </tr>
  56. <tr>
  57. <td class="name"><code>viewport</code></td>
  58. <td class="type">
  59. <span class="param-type"><a href="Viewport.html">Viewport</a></span>
  60. </td>
  61. <td class="description last">Viewport applied to the canvas.</td>
  62. </tr>
  63. <tr>
  64. <td class="name"><code>canvas</code></td>
  65. <td class="type">
  66. <span class="param-type"><a href="DOM.html">DOM</a></span>
  67. </td>
  68. <td class="description last">DOM canvas element where the content is being drawn.</td>
  69. </tr>
  70. </tbody>
  71. </table>
  72. <dl class="details">
  73. <dt class="tag-source">Source:</dt>
  74. <dd class="tag-source"><ul class="dummy"><li>
  75. <a href="stencil_Stencil.js.html">stencil/Stencil.js</a>, <a href="stencil_Stencil.js.html#line32">line 32</a>
  76. </li></ul></dd>
  77. </dl>
  78. </article>
  79. </section>
  80. </div>
  81. <nav>
  82. <h2><a href="index.html">Home</a></h2><h3>Classes</h3><ul><li><a href="Box.html">Box</a></li><li><a href="Box2.html">Box2</a></li><li><a href="BoxStencil.html">BoxStencil</a></li><li><a href="Circle.html">Circle</a></li><li><a href="DOM.html">DOM</a></li><li><a href="EventManager.html">EventManager</a></li><li><a href="Helpers.html">Helpers</a></li><li><a href="Image.html">Image</a></li><li><a href="Key.html">Key</a></li><li><a href="Line.html">Line</a></li><li><a href="Matrix.html">Matrix</a></li><li><a href="Object2D.html">Object2D</a></li><li><a href="Pattern.html">Pattern</a></li><li><a href="Pointer.html">Pointer</a></li><li><a href="Renderer.html">Renderer</a></li><li><a href="Stencil.html">Stencil</a></li><li><a href="Text.html">Text</a></li><li><a href="UUID.html">UUID</a></li><li><a href="Vector2.html">Vector2</a></li><li><a href="Viewport.html">Viewport</a></li></ul>
  83. </nav>
  84. <br class="clear">
  85. <footer>
  86. Documentation generated by <a href="https://github.com/jsdoc/jsdoc">JSDoc 3.6.2</a> on Thu Jun 06 2019 15:37:27 GMT+0100 (Western European Summer Time)
  87. </footer>
  88. <script> prettyPrint(); </script>
  89. <script src="scripts/linenumber.js"> </script>
  90. </body>
  91. </html>