Pointer.html 27 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547154815491550155115521553155415551556155715581559156015611562156315641565156615671568156915701571157215731574157515761577157815791580158115821583158415851586158715881589159015911592159315941595159615971598159916001601160216031604160516061607160816091610161116121613161416151616161716181619162016211622162316241625162616271628162916301631163216331634163516361637163816391640164116421643164416451646164716481649165016511652165316541655165616571658165916601661166216631664166516661667166816691670167116721673167416751676167716781679168016811682168316841685168616871688168916901691169216931694169516961697169816991700170117021703170417051706170717081709171017111712171317141715171617171718171917201721172217231724172517261727172817291730173117321733173417351736173717381739174017411742174317441745174617471748174917501751175217531754175517561757175817591760176117621763176417651766176717681769177017711772177317741775177617771778177917801781178217831784178517861787178817891790179117921793179417951796179717981799180018011802180318041805180618071808180918101811181218131814181518161817181818191820182118221823182418251826182718281829183018311832183318341835183618371838183918401841184218431844184518461847184818491850185118521853185418551856185718581859186018611862186318641865186618671868186918701871187218731874187518761877187818791880188118821883188418851886188718881889189018911892189318941895189618971898189919001901190219031904190519061907190819091910191119121913191419151916191719181919192019211922192319241925192619271928192919301931193219331934193519361937193819391940194119421943194419451946194719481949195019511952195319541955195619571958195919601961196219631964196519661967196819691970197119721973197419751976197719781979198019811982198319841985198619871988198919901991199219931994199519961997199819992000200120022003200420052006200720082009201020112012201320142015201620172018201920202021202220232024202520262027202820292030203120322033203420352036203720382039204020412042204320442045204620472048204920502051205220532054205520562057205820592060206120622063206420652066206720682069207020712072207320742075207620772078207920802081208220832084208520862087208820892090209120922093209420952096209720982099210021012102210321042105210621072108210921102111211221132114211521162117211821192120212121222123212421252126212721282129213021312132213321342135213621372138213921402141214221432144214521462147214821492150215121522153215421552156215721582159216021612162216321642165216621672168216921702171217221732174217521762177217821792180218121822183218421852186218721882189219021912192219321942195219621972198219922002201220222032204220522062207220822092210221122122213221422152216221722182219222022212222222322242225222622272228222922302231223222332234223522362237223822392240224122422243224422452246224722482249225022512252225322542255225622572258225922602261226222632264226522662267226822692270227122722273227422752276227722782279228022812282228322842285228622872288228922902291229222932294229522962297229822992300230123022303230423052306230723082309231023112312231323142315231623172318231923202321232223232324232523262327232823292330233123322333233423352336233723382339234023412342234323442345234623472348234923502351235223532354235523562357235823592360236123622363236423652366236723682369237023712372237323742375237623772378237923802381238223832384238523862387238823892390239123922393239423952396239723982399240024012402240324042405240624072408240924102411241224132414241524162417241824192420242124222423242424252426242724282429243024312432243324342435243624372438243924402441244224432444244524462447244824492450245124522453245424552456245724582459246024612462246324642465246624672468246924702471247224732474247524762477247824792480248124822483248424852486248724882489249024912492249324942495249624972498249925002501250225032504250525062507250825092510251125122513251425152516251725182519252025212522252325242525252625272528252925302531253225332534253525362537253825392540254125422543254425452546254725482549255025512552255325542555255625572558255925602561256225632564256525662567256825692570257125722573257425752576257725782579
  1. <!DOCTYPE html>
  2. <html lang="en">
  3. <head>
  4. <meta charset="utf-8">
  5. <title>JSDoc: Class: Pointer</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: Pointer</h1>
  17. <section>
  18. <header>
  19. <h2><span class="attribs"><span class="type-signature"></span></span>Pointer<span class="signature">(domElement, canvas)</span><span class="type-signature"></span></h2>
  20. </header>
  21. <article>
  22. <div class="container-overview">
  23. <h4 class="name" id="Pointer"><span class="type-signature"></span>new Pointer<span class="signature">(domElement, canvas)</span><span class="type-signature"></span></h4>
  24. <div class="description">
  25. Pointer object is used to called input from the user, works for booth mouse or touch screens.
  26. It is responsible for synchronizing user input with the render of the graphics.
  27. </div>
  28. <h5>Parameters:</h5>
  29. <table class="params">
  30. <thead>
  31. <tr>
  32. <th>Name</th>
  33. <th>Type</th>
  34. <th class="last">Description</th>
  35. </tr>
  36. </thead>
  37. <tbody>
  38. <tr>
  39. <td class="name"><code>domElement</code></td>
  40. <td class="type">
  41. <span class="param-type">Element</span>
  42. </td>
  43. <td class="description last">DOM element to create the pointer events.</td>
  44. </tr>
  45. <tr>
  46. <td class="name"><code>canvas</code></td>
  47. <td class="type">
  48. <span class="param-type">Element</span>
  49. </td>
  50. <td class="description last">Canvas DOM element where the content is being drawn.</td>
  51. </tr>
  52. </tbody>
  53. </table>
  54. <dl class="details">
  55. <dt class="tag-source">Source:</dt>
  56. <dd class="tag-source"><ul class="dummy"><li>
  57. <a href="input_Pointer.js.html">input/Pointer.js</a>, <a href="input_Pointer.js.html#line14">line 14</a>
  58. </li></ul></dd>
  59. </dl>
  60. </div>
  61. <h3 class="subsection-title">Members</h3>
  62. <h4 class="name" id=".BACK"><span class="type-signature">(static) </span>BACK<span class="type-signature"></span></h4>
  63. <div class="description">
  64. Back pointer navigation button.
  65. </div>
  66. <dl class="details">
  67. <dt class="tag-source">Source:</dt>
  68. <dd class="tag-source"><ul class="dummy"><li>
  69. <a href="input_Pointer.js.html">input/Pointer.js</a>, <a href="input_Pointer.js.html#line205">line 205</a>
  70. </li></ul></dd>
  71. </dl>
  72. <h4 class="name" id=".FORWARD"><span class="type-signature">(static) </span>FORWARD<span class="type-signature"></span></h4>
  73. <div class="description">
  74. Forward pointer navigation button.
  75. </div>
  76. <dl class="details">
  77. <dt class="tag-source">Source:</dt>
  78. <dd class="tag-source"><ul class="dummy"><li>
  79. <a href="input_Pointer.js.html">input/Pointer.js</a>, <a href="input_Pointer.js.html#line210">line 210</a>
  80. </li></ul></dd>
  81. </dl>
  82. <h4 class="name" id=".LEFT"><span class="type-signature">(static) </span>LEFT<span class="type-signature"></span></h4>
  83. <div class="description">
  84. Left pointer button.
  85. </div>
  86. <dl class="details">
  87. <dt class="tag-source">Source:</dt>
  88. <dd class="tag-source"><ul class="dummy"><li>
  89. <a href="input_Pointer.js.html">input/Pointer.js</a>, <a href="input_Pointer.js.html#line190">line 190</a>
  90. </li></ul></dd>
  91. </dl>
  92. <h4 class="name" id=".MIDDLE"><span class="type-signature">(static) </span>MIDDLE<span class="type-signature"></span></h4>
  93. <div class="description">
  94. Middle pointer button.
  95. </div>
  96. <dl class="details">
  97. <dt class="tag-source">Source:</dt>
  98. <dd class="tag-source"><ul class="dummy"><li>
  99. <a href="input_Pointer.js.html">input/Pointer.js</a>, <a href="input_Pointer.js.html#line195">line 195</a>
  100. </li></ul></dd>
  101. </dl>
  102. <h4 class="name" id=".RIGHT"><span class="type-signature">(static) </span>RIGHT<span class="type-signature"></span></h4>
  103. <div class="description">
  104. Right pointer button.
  105. </div>
  106. <dl class="details">
  107. <dt class="tag-source">Source:</dt>
  108. <dd class="tag-source"><ul class="dummy"><li>
  109. <a href="input_Pointer.js.html">input/Pointer.js</a>, <a href="input_Pointer.js.html#line200">line 200</a>
  110. </li></ul></dd>
  111. </dl>
  112. <h4 class="name" id="canvas"><span class="type-signature"></span>canvas<span class="type-signature"></span></h4>
  113. <div class="description">
  114. Canvas attached to this pointer instance used to calculate position and delta in element space coordinates.
  115. </div>
  116. <dl class="details">
  117. <dt class="tag-source">Source:</dt>
  118. <dd class="tag-source"><ul class="dummy"><li>
  119. <a href="input_Pointer.js.html">input/Pointer.js</a>, <a href="input_Pointer.js.html#line58">line 58</a>
  120. </li></ul></dd>
  121. </dl>
  122. <h4 class="name" id="delta"><span class="type-signature"></span>delta<span class="type-signature"></span></h4>
  123. <div class="description">
  124. Pointer movement (coordinates in window space).
  125. </div>
  126. <dl class="details">
  127. <dt class="tag-source">Source:</dt>
  128. <dd class="tag-source"><ul class="dummy"><li>
  129. <a href="input_Pointer.js.html">input/Pointer.js</a>, <a href="input_Pointer.js.html#line38">line 38</a>
  130. </li></ul></dd>
  131. </dl>
  132. <h4 class="name" id="domElement"><span class="type-signature"></span>domElement<span class="type-signature"></span></h4>
  133. <div class="description">
  134. DOM element where to attach the pointer events.
  135. </div>
  136. <dl class="details">
  137. <dt class="tag-source">Source:</dt>
  138. <dd class="tag-source"><ul class="dummy"><li>
  139. <a href="input_Pointer.js.html">input/Pointer.js</a>, <a href="input_Pointer.js.html#line53">line 53</a>
  140. </li></ul></dd>
  141. </dl>
  142. <h4 class="name" id="doubleClicked"><span class="type-signature"></span>doubleClicked<span class="type-signature"></span></h4>
  143. <div class="description">
  144. Indicates a button of the pointer was double clicked.
  145. </div>
  146. <dl class="details">
  147. <dt class="tag-source">Source:</dt>
  148. <dd class="tag-source"><ul class="dummy"><li>
  149. <a href="input_Pointer.js.html">input/Pointer.js</a>, <a href="input_Pointer.js.html#line48">line 48</a>
  150. </li></ul></dd>
  151. </dl>
  152. <h4 class="name" id="events"><span class="type-signature"></span>events<span class="type-signature"></span></h4>
  153. <div class="description">
  154. Event manager responsible for updating the raw data variables.
  155. Diferent events are used depending on the host platform.
  156. When the update method is called the raw data is reset.
  157. </div>
  158. <dl class="details">
  159. <dt class="tag-source">Source:</dt>
  160. <dd class="tag-source"><ul class="dummy"><li>
  161. <a href="input_Pointer.js.html">input/Pointer.js</a>, <a href="input_Pointer.js.html#line71">line 71</a>
  162. </li></ul></dd>
  163. </dl>
  164. <h4 class="name" id="keys"><span class="type-signature"></span>keys<span class="type-signature"></span></h4>
  165. <div class="description">
  166. Array with pointer buttons status.
  167. </div>
  168. <dl class="details">
  169. <dt class="tag-source">Source:</dt>
  170. <dd class="tag-source"><ul class="dummy"><li>
  171. <a href="input_Pointer.js.html">input/Pointer.js</a>, <a href="input_Pointer.js.html#line28">line 28</a>
  172. </li></ul></dd>
  173. </dl>
  174. <h4 class="name" id="position"><span class="type-signature"></span>position<span class="type-signature"></span></h4>
  175. <div class="description">
  176. Pointer position inside of the window (coordinates in window space).
  177. </div>
  178. <dl class="details">
  179. <dt class="tag-source">Source:</dt>
  180. <dd class="tag-source"><ul class="dummy"><li>
  181. <a href="input_Pointer.js.html">input/Pointer.js</a>, <a href="input_Pointer.js.html#line33">line 33</a>
  182. </li></ul></dd>
  183. </dl>
  184. <h4 class="name" id="wheel"><span class="type-signature"></span>wheel<span class="type-signature"></span></h4>
  185. <div class="description">
  186. Pointer scroll wheel movement.
  187. </div>
  188. <dl class="details">
  189. <dt class="tag-source">Source:</dt>
  190. <dd class="tag-source"><ul class="dummy"><li>
  191. <a href="input_Pointer.js.html">input/Pointer.js</a>, <a href="input_Pointer.js.html#line43">line 43</a>
  192. </li></ul></dd>
  193. </dl>
  194. <h3 class="subsection-title">Methods</h3>
  195. <h4 class="name" id=".buttonDoubleClicked"><span class="type-signature">(static) </span>buttonDoubleClicked<span class="signature">(button)</span><span class="type-signature"> &rarr; {boolean}</span></h4>
  196. <div class="description">
  197. Check if pointer button was double clicked.
  198. </div>
  199. <h5>Parameters:</h5>
  200. <table class="params">
  201. <thead>
  202. <tr>
  203. <th>Name</th>
  204. <th>Type</th>
  205. <th class="last">Description</th>
  206. </tr>
  207. </thead>
  208. <tbody>
  209. <tr>
  210. <td class="name"><code>button</code></td>
  211. <td class="type">
  212. <span class="param-type">Number</span>
  213. </td>
  214. <td class="description last">Button to check status of</td>
  215. </tr>
  216. </tbody>
  217. </table>
  218. <dl class="details">
  219. <dt class="tag-source">Source:</dt>
  220. <dd class="tag-source"><ul class="dummy"><li>
  221. <a href="input_Pointer.js.html">input/Pointer.js</a>, <a href="input_Pointer.js.html#line261">line 261</a>
  222. </li></ul></dd>
  223. </dl>
  224. <h5>Returns:</h5>
  225. <div class="param-desc">
  226. True if some pointer button was just double clicked
  227. </div>
  228. <dl>
  229. <dt>
  230. Type
  231. </dt>
  232. <dd>
  233. <span class="param-type">boolean</span>
  234. </dd>
  235. </dl>
  236. <h4 class="name" id=".buttonJustPressed"><span class="type-signature">(static) </span>buttonJustPressed<span class="signature">(button)</span><span class="type-signature"> &rarr; {boolean}</span></h4>
  237. <div class="description">
  238. Check if a pointer button was just pressed.
  239. </div>
  240. <h5>Parameters:</h5>
  241. <table class="params">
  242. <thead>
  243. <tr>
  244. <th>Name</th>
  245. <th>Type</th>
  246. <th class="last">Description</th>
  247. </tr>
  248. </thead>
  249. <tbody>
  250. <tr>
  251. <td class="name"><code>button</code></td>
  252. <td class="type">
  253. <span class="param-type">Number</span>
  254. </td>
  255. <td class="description last">Button to check status of</td>
  256. </tr>
  257. </tbody>
  258. </table>
  259. <dl class="details">
  260. <dt class="tag-source">Source:</dt>
  261. <dd class="tag-source"><ul class="dummy"><li>
  262. <a href="input_Pointer.js.html">input/Pointer.js</a>, <a href="input_Pointer.js.html#line272">line 272</a>
  263. </li></ul></dd>
  264. </dl>
  265. <h5>Returns:</h5>
  266. <div class="param-desc">
  267. True if button was just pressed
  268. </div>
  269. <dl>
  270. <dt>
  271. Type
  272. </dt>
  273. <dd>
  274. <span class="param-type">boolean</span>
  275. </dd>
  276. </dl>
  277. <h4 class="name" id=".buttonJustReleased"><span class="type-signature">(static) </span>buttonJustReleased<span class="signature">(button)</span><span class="type-signature"> &rarr; {boolean}</span></h4>
  278. <div class="description">
  279. Check if a pointer button was just released.
  280. </div>
  281. <h5>Parameters:</h5>
  282. <table class="params">
  283. <thead>
  284. <tr>
  285. <th>Name</th>
  286. <th>Type</th>
  287. <th class="last">Description</th>
  288. </tr>
  289. </thead>
  290. <tbody>
  291. <tr>
  292. <td class="name"><code>button</code></td>
  293. <td class="type">
  294. <span class="param-type">Number</span>
  295. </td>
  296. <td class="description last">Button to check status of</td>
  297. </tr>
  298. </tbody>
  299. </table>
  300. <dl class="details">
  301. <dt class="tag-source">Source:</dt>
  302. <dd class="tag-source"><ul class="dummy"><li>
  303. <a href="input_Pointer.js.html">input/Pointer.js</a>, <a href="input_Pointer.js.html#line283">line 283</a>
  304. </li></ul></dd>
  305. </dl>
  306. <h5>Returns:</h5>
  307. <div class="param-desc">
  308. True if button was just released
  309. </div>
  310. <dl>
  311. <dt>
  312. Type
  313. </dt>
  314. <dd>
  315. <span class="param-type">boolean</span>
  316. </dd>
  317. </dl>
  318. <h4 class="name" id=".buttonPressed"><span class="type-signature">(static) </span>buttonPressed<span class="signature">(button)</span><span class="type-signature"> &rarr; {boolean}</span></h4>
  319. <div class="description">
  320. Check if pointer button is currently pressed.
  321. </div>
  322. <h5>Parameters:</h5>
  323. <table class="params">
  324. <thead>
  325. <tr>
  326. <th>Name</th>
  327. <th>Type</th>
  328. <th class="last">Description</th>
  329. </tr>
  330. </thead>
  331. <tbody>
  332. <tr>
  333. <td class="name"><code>button</code></td>
  334. <td class="type">
  335. <span class="param-type">Number</span>
  336. </td>
  337. <td class="description last">Button to check status of</td>
  338. </tr>
  339. </tbody>
  340. </table>
  341. <dl class="details">
  342. <dt class="tag-source">Source:</dt>
  343. <dd class="tag-source"><ul class="dummy"><li>
  344. <a href="input_Pointer.js.html">input/Pointer.js</a>, <a href="input_Pointer.js.html#line250">line 250</a>
  345. </li></ul></dd>
  346. </dl>
  347. <h5>Returns:</h5>
  348. <div class="param-desc">
  349. True if button is currently pressed
  350. </div>
  351. <dl>
  352. <dt>
  353. Type
  354. </dt>
  355. <dd>
  356. <span class="param-type">boolean</span>
  357. </dd>
  358. </dl>
  359. <h4 class="name" id=".create"><span class="type-signature">(static) </span>create<span class="signature">()</span><span class="type-signature"></span></h4>
  360. <div class="description">
  361. Create pointer events.
  362. </div>
  363. <dl class="details">
  364. <dt class="tag-source">Source:</dt>
  365. <dd class="tag-source"><ul class="dummy"><li>
  366. <a href="input_Pointer.js.html">input/Pointer.js</a>, <a href="input_Pointer.js.html#line390">line 390</a>
  367. </li></ul></dd>
  368. </dl>
  369. <h4 class="name" id=".dispose"><span class="type-signature">(static) </span>dispose<span class="signature">()</span><span class="type-signature"></span></h4>
  370. <div class="description">
  371. Dispose pointer events.
  372. </div>
  373. <dl class="details">
  374. <dt class="tag-source">Source:</dt>
  375. <dd class="tag-source"><ul class="dummy"><li>
  376. <a href="input_Pointer.js.html">input/Pointer.js</a>, <a href="input_Pointer.js.html#line398">line 398</a>
  377. </li></ul></dd>
  378. </dl>
  379. <h4 class="name" id=".insideCanvas"><span class="type-signature">(static) </span>insideCanvas<span class="signature">()</span><span class="type-signature"> &rarr; {boolean}</span></h4>
  380. <div class="description">
  381. Check if pointer is inside attached canvas (updated async).
  382. </div>
  383. <dl class="details">
  384. <dt class="tag-source">Source:</dt>
  385. <dd class="tag-source"><ul class="dummy"><li>
  386. <a href="input_Pointer.js.html">input/Pointer.js</a>, <a href="input_Pointer.js.html#line239">line 239</a>
  387. </li></ul></dd>
  388. </dl>
  389. <h5>Returns:</h5>
  390. <div class="param-desc">
  391. True if pointer is currently inside the canvas
  392. </div>
  393. <dl>
  394. <dt>
  395. Type
  396. </dt>
  397. <dd>
  398. <span class="param-type">boolean</span>
  399. </dd>
  400. </dl>
  401. <h4 class="name" id=".setCanvas"><span class="type-signature">(static) </span>setCanvas<span class="signature">(canvas)</span><span class="type-signature"></span></h4>
  402. <div class="description">
  403. Element to be used for coordinates calculation relative to that canvas.
  404. </div>
  405. <h5>Parameters:</h5>
  406. <table class="params">
  407. <thead>
  408. <tr>
  409. <th>Name</th>
  410. <th>Type</th>
  411. <th class="last">Description</th>
  412. </tr>
  413. </thead>
  414. <tbody>
  415. <tr>
  416. <td class="name"><code>canvas</code></td>
  417. <td class="type">
  418. <span class="param-type"><a href="DOM.html">DOM</a></span>
  419. </td>
  420. <td class="description last">Canvas to be attached to the Pointer instance</td>
  421. </tr>
  422. </tbody>
  423. </table>
  424. <dl class="details">
  425. <dt class="tag-source">Source:</dt>
  426. <dd class="tag-source"><ul class="dummy"><li>
  427. <a href="input_Pointer.js.html">input/Pointer.js</a>, <a href="input_Pointer.js.html#line217">line 217</a>
  428. </li></ul></dd>
  429. </dl>
  430. <h4 class="name" id=".update"><span class="type-signature">(static) </span>update<span class="signature">()</span><span class="type-signature"></span></h4>
  431. <div class="description">
  432. Update pointer buttons state, position, wheel and delta synchronously.
  433. </div>
  434. <dl class="details">
  435. <dt class="tag-source">Source:</dt>
  436. <dd class="tag-source"><ul class="dummy"><li>
  437. <a href="input_Pointer.js.html">input/Pointer.js</a>, <a href="input_Pointer.js.html#line332">line 332</a>
  438. </li></ul></dd>
  439. </dl>
  440. <h4 class="name" id=".updateKey"><span class="type-signature">(static) </span>updateKey<span class="signature">(button, action)</span><span class="type-signature"></span></h4>
  441. <div class="description">
  442. Update a pointer button.
  443. Automatically called by the runtime.
  444. </div>
  445. <h5>Parameters:</h5>
  446. <table class="params">
  447. <thead>
  448. <tr>
  449. <th>Name</th>
  450. <th>Type</th>
  451. <th class="last">Description</th>
  452. </tr>
  453. </thead>
  454. <tbody>
  455. <tr>
  456. <td class="name"><code>button</code></td>
  457. <td class="type">
  458. <span class="param-type">Number</span>
  459. </td>
  460. <td class="description last"></td>
  461. </tr>
  462. <tr>
  463. <td class="name"><code>action</code></td>
  464. <td class="type">
  465. <span class="param-type">Number</span>
  466. </td>
  467. <td class="description last"></td>
  468. </tr>
  469. </tbody>
  470. </table>
  471. <dl class="details">
  472. <dt class="tag-source">Source:</dt>
  473. <dd class="tag-source"><ul class="dummy"><li>
  474. <a href="input_Pointer.js.html">input/Pointer.js</a>, <a href="input_Pointer.js.html#line321">line 321</a>
  475. </li></ul></dd>
  476. </dl>
  477. <h4 class="name" id=".updatePosition"><span class="type-signature">(static) </span>updatePosition<span class="signature">(x, y, xDiff, yDiff)</span><span class="type-signature"></span></h4>
  478. <div class="description">
  479. Update pointer position.
  480. Automatically called by the runtime.
  481. </div>
  482. <h5>Parameters:</h5>
  483. <table class="params">
  484. <thead>
  485. <tr>
  486. <th>Name</th>
  487. <th>Type</th>
  488. <th class="last">Description</th>
  489. </tr>
  490. </thead>
  491. <tbody>
  492. <tr>
  493. <td class="name"><code>x</code></td>
  494. <td class="type">
  495. <span class="param-type">Number</span>
  496. </td>
  497. <td class="description last"></td>
  498. </tr>
  499. <tr>
  500. <td class="name"><code>y</code></td>
  501. <td class="type">
  502. <span class="param-type">Number</span>
  503. </td>
  504. <td class="description last"></td>
  505. </tr>
  506. <tr>
  507. <td class="name"><code>xDiff</code></td>
  508. <td class="type">
  509. <span class="param-type">Number</span>
  510. </td>
  511. <td class="description last"></td>
  512. </tr>
  513. <tr>
  514. <td class="name"><code>yDiff</code></td>
  515. <td class="type">
  516. <span class="param-type">Number</span>
  517. </td>
  518. <td class="description last"></td>
  519. </tr>
  520. </tbody>
  521. </table>
  522. <dl class="details">
  523. <dt class="tag-source">Source:</dt>
  524. <dd class="tag-source"><ul class="dummy"><li>
  525. <a href="input_Pointer.js.html">input/Pointer.js</a>, <a href="input_Pointer.js.html#line298">line 298</a>
  526. </li></ul></dd>
  527. </dl>
  528. </article>
  529. </section>
  530. </div>
  531. <nav>
  532. <h2><a href="index.html">Home</a></h2><h3>Classes</h3><ul><li><a href="BezierCurve.html">BezierCurve</a></li><li><a href="Box.html">Box</a></li><li><a href="Box2.html">Box2</a></li><li><a href="BoxMask.html">BoxMask</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="Graph.html">Graph</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="Mask.html">Mask</a></li><li><a href="Matrix.html">Matrix</a></li><li><a href="MultiLineText.html">MultiLineText</a></li><li><a href="Node.html">Node</a></li><li><a href="NodeConnector.html">NodeConnector</a></li><li><a href="NodeGraph.html">NodeGraph</a></li><li><a href="NodeSocket.html">NodeSocket</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="QuadraticCurve.html">QuadraticCurve</a></li><li><a href="Renderer.html">Renderer</a></li><li><a href="RoundedBox.html">RoundedBox</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><li><a href="ViewportControls.html">ViewportControls</a></li></ul><h3>Global</h3><ul><li><a href="global.html#connector">connector</a></li><li><a href="global.html#direction">direction</a></li><li><a href="global.html#inputs">inputs</a></li><li><a href="global.html#inputSocket">inputSocket</a></li><li><a href="global.html#name">name</a></li><li><a href="global.html#node">node</a></li><li><a href="global.html#outputs">outputs</a></li><li><a href="global.html#outputSocket">outputSocket</a></li><li><a href="global.html#text">text</a></li><li><a href="global.html#type">type</a></li></ul>
  533. </nav>
  534. <br class="clear">
  535. <footer>
  536. Documentation generated by <a href="https://github.com/jsdoc/jsdoc">JSDoc 3.6.4</a> on Thu May 14 2020 18:22:31 GMT+0100 (Western European Summer Time)
  537. </footer>
  538. <script> prettyPrint(); </script>
  539. <script src="scripts/linenumber.js"> </script>
  540. </body>
  541. </html>