littlejsengine 1.0.14 → 1.1.8

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (99) hide show
  1. package/build.bat +5 -1
  2. package/docs/Audio.html +2268 -0
  3. package/docs/Color.html +2989 -0
  4. package/docs/Debug.html +2933 -0
  5. package/docs/Draw.html +4092 -0
  6. package/docs/EngineObject.html +4458 -0
  7. package/docs/Input.html +2482 -0
  8. package/docs/Medal.html +1007 -0
  9. package/docs/Medals.html +628 -0
  10. package/docs/Music.html +584 -0
  11. package/docs/Newgrounds.html +1399 -0
  12. package/docs/Particle.html +4535 -0
  13. package/docs/ParticleEmitter.html +7770 -0
  14. package/docs/Random.html +1774 -0
  15. package/docs/Settings.html +2679 -0
  16. package/docs/Sound.html +1249 -0
  17. package/docs/TileCollision.html +1409 -0
  18. package/docs/TileLayer.html +6948 -0
  19. package/docs/TileLayerData.html +1052 -0
  20. package/docs/Timer.html +1183 -0
  21. package/docs/Utilities.html +3281 -0
  22. package/docs/Vector2.html +4207 -0
  23. package/docs/WebGL.html +2327 -0
  24. package/docs/engine.js.html +429 -0
  25. package/docs/engineAudio.js.html +609 -0
  26. package/docs/engineDebug.js.html +725 -0
  27. package/docs/engineDraw.js.html +419 -0
  28. package/docs/engineInput.js.html +401 -0
  29. package/docs/engineMedals.js.html +461 -0
  30. package/docs/engineObject.js.html +518 -0
  31. package/docs/engineParticles.js.html +441 -0
  32. package/docs/engineSettings.js.html +349 -0
  33. package/docs/engineTileLayer.js.html +513 -0
  34. package/docs/engineUtilities.js.html +647 -0
  35. package/docs/engineWebGL.js.html +522 -0
  36. package/docs/fonts/MavenPro-Regular.ttf +0 -0
  37. package/docs/fonts/Montserrat-Regular.ttf +0 -0
  38. package/docs/fonts/Muli-Black.ttf +0 -0
  39. package/docs/fonts/OFL-hind.txt +93 -0
  40. package/docs/fonts/OFL-montserrat.txt +93 -0
  41. package/docs/global.html +1691 -0
  42. package/docs/index.css +6 -0
  43. package/docs/index.html +247 -0
  44. package/docs/scripts/fix-code-block.js +53 -0
  45. package/docs/scripts/fix-navbar.js +25 -0
  46. package/docs/scripts/linenumber.js +25 -0
  47. package/docs/scripts/misc.js +217 -0
  48. package/docs/scripts/resize.js +85 -0
  49. package/docs/scripts/search.js +83 -0
  50. package/docs/scripts/third-party/Apache-License-2.0.txt +202 -0
  51. package/docs/scripts/third-party/fuse.js +9 -0
  52. package/docs/scripts/third-party/lang-css.js +2 -0
  53. package/docs/scripts/third-party/prettify.js +28 -0
  54. package/docs/static/favicon.png +0 -0
  55. package/docs/static/index.css +4 -0
  56. package/docs/styles/clean-jsdoc-theme-base.css +393 -0
  57. package/docs/styles/clean-jsdoc-theme-dark.css +324 -0
  58. package/docs/styles/clean-jsdoc-theme-light.css +319 -0
  59. package/docs/styles/reset.css +346 -0
  60. package/docs/styles/third-party/ionicons.min.css +11 -0
  61. package/docs/styles/third-party/prettify-jsdoc.css +111 -0
  62. package/docs/styles/third-party/prettify-tomorrow.css +5 -0
  63. package/engine/engine.all.js +1997 -744
  64. package/engine/engine.all.min.js +1 -1
  65. package/engine/engine.all.release.js +1743 -569
  66. package/engine/engine.js +107 -39
  67. package/engine/engineAudio.js +152 -34
  68. package/engine/{build.bat → engineBuild.bat} +10 -10
  69. package/engine/{buildSetup.bat → engineBuildSetup.bat} +0 -0
  70. package/engine/engineDebug.js +105 -32
  71. package/engine/engineDraw.js +137 -32
  72. package/engine/engineInput.js +111 -37
  73. package/engine/{engineMedal.js → engineMedals.js} +129 -56
  74. package/engine/engineObject.js +117 -67
  75. package/engine/engineParticles.js +282 -0
  76. package/engine/engineRelease.js +3 -9
  77. package/engine/engineSettings.js +190 -0
  78. package/engine/engineTileLayer.js +147 -44
  79. package/engine/engineUtilities.js +488 -0
  80. package/engine/engineWebGL.js +113 -74
  81. package/examples/breakout/game.js +1 -1
  82. package/examples/breakout/gameObjects.js +3 -3
  83. package/examples/breakout/index.html +3 -3
  84. package/examples/platformer/game.js +5 -7
  85. package/examples/platformer/gameEffects.js +7 -7
  86. package/examples/platformer/gameLevel.js +2 -2
  87. package/examples/platformer/gameObjects.js +4 -5
  88. package/examples/platformer/gamePlayer.js +3 -3
  89. package/examples/platformer/index.html +6 -6
  90. package/examples/puzzle/game.js +1 -2
  91. package/examples/puzzle/index.html +2 -2
  92. package/examples/stress/index.html +2 -8
  93. package/game.js +5 -11
  94. package/index.html +13 -13
  95. package/package.json +4 -4
  96. package/tiles.png +0 -0
  97. package/engine/engineConfig.js +0 -64
  98. package/engine/engineParticle.js +0 -199
  99. package/engine/engineUtil.js +0 -147
@@ -0,0 +1,725 @@
1
+ <!DOCTYPE html>
2
+ <html lang="en">
3
+
4
+ <head>
5
+ <meta charset="utf-8">
6
+ <meta name="viewport" content="width=device-width, initial-scale=1.0">
7
+
8
+ <!-- Adding favicon -->
9
+
10
+ <link rel="icon" href="./static/favicon.png" />
11
+
12
+
13
+ <!-- Adding meta -->
14
+
15
+
16
+ <!-- Adding external script-->
17
+
18
+
19
+ <!-- Adding external style-->
20
+
21
+
22
+ <!-- Adding scripts-->
23
+
24
+
25
+ <!-- Adding style-->
26
+
27
+
28
+ <!-- Adding overlay script-->
29
+
30
+
31
+ <!-- Adding overlay style-->
32
+
33
+
34
+
35
+ <title>
36
+ engineDebug.js
37
+ </title>
38
+
39
+ <!--[if lt IE 9]>
40
+ <script src="//html5shiv.googlecode.com/svn/trunk/html5.js"></script>
41
+ <![endif]-->
42
+ <link type="text/css" rel="stylesheet" href="styles/third-party/ionicons.min.css">
43
+ <link type="text/css" rel="stylesheet" href="styles/third-party/prettify-tomorrow.css">
44
+ <link type="text/css" rel="stylesheet" href="styles/reset.css">
45
+ <link type="text/css" rel="stylesheet" href="styles/clean-jsdoc-theme-base.css">
46
+ <link type="text/css" rel="stylesheet" href="styles/clean-jsdoc-theme-dark.css">
47
+
48
+ <style>
49
+ .prettyprint code {font-family:monospace}
50
+ </style>
51
+
52
+ <svg aria-hidden="true" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink"
53
+ style="display:none">
54
+ <defs>
55
+ <symbol id="copy-icon" viewbox="0 0 488.3 488.3">
56
+ <g>
57
+ <path
58
+ d="M314.25,85.4h-227c-21.3,0-38.6,17.3-38.6,38.6v325.7c0,21.3,17.3,38.6,38.6,38.6h227c21.3,0,38.6-17.3,38.6-38.6V124 C352.75,102.7,335.45,85.4,314.25,85.4z M325.75,449.6c0,6.4-5.2,11.6-11.6,11.6h-227c-6.4,0-11.6-5.2-11.6-11.6V124 c0-6.4,5.2-11.6,11.6-11.6h227c6.4,0,11.6,5.2,11.6,11.6V449.6z" />
59
+ <path
60
+ d="M401.05,0h-227c-21.3,0-38.6,17.3-38.6,38.6c0,7.5,6,13.5,13.5,13.5s13.5-6,13.5-13.5c0-6.4,5.2-11.6,11.6-11.6h227 c6.4,0,11.6,5.2,11.6,11.6v325.7c0,6.4-5.2,11.6-11.6,11.6c-7.5,0-13.5,6-13.5,13.5s6,13.5,13.5,13.5c21.3,0,38.6-17.3,38.6-38.6 V38.6C439.65,17.3,422.35,0,401.05,0z" />
61
+ </g>
62
+ </symbol>
63
+ <symbol id='search-icon' viewBox="0 0 512 512">
64
+ <g>
65
+ <g>
66
+ <path
67
+ d="M225.474,0C101.151,0,0,101.151,0,225.474c0,124.33,101.151,225.474,225.474,225.474 c124.33,0,225.474-101.144,225.474-225.474C450.948,101.151,349.804,0,225.474,0z M225.474,409.323 c-101.373,0-183.848-82.475-183.848-183.848S124.101,41.626,225.474,41.626s183.848,82.475,183.848,183.848 S326.847,409.323,225.474,409.323z" />
68
+ </g>
69
+ </g>
70
+ <g>
71
+ <g>
72
+ <path
73
+ d="M505.902,476.472L386.574,357.144c-8.131-8.131-21.299-8.131-29.43,0c-8.131,8.124-8.131,21.306,0,29.43l119.328,119.328 c4.065,4.065,9.387,6.098,14.715,6.098c5.321,0,10.649-2.033,14.715-6.098C514.033,497.778,514.033,484.596,505.902,476.472z" />
74
+ </g>
75
+ </g>
76
+ </symbol>
77
+ <symbol id="down-icon" viewBox="0 0 16 16">
78
+ <path
79
+ fill-rule="evenodd"
80
+ clip-rule="evenodd"
81
+ d="M12.7803 6.21967C13.0732 6.51256 13.0732 6.98744 12.7803 7.28033L8.53033 11.5303C8.23744 11.8232 7.76256 11.8232 7.46967 11.5303L3.21967 7.28033C2.92678 6.98744 2.92678 6.51256 3.21967 6.21967C3.51256 5.92678 3.98744 5.92678 4.28033 6.21967L8 9.93934L11.7197 6.21967C12.0126 5.92678 12.4874 5.92678 12.7803 6.21967Z"
82
+ >
83
+ </path>
84
+ </symbol>
85
+ </defs>
86
+ </svg>
87
+ </head>
88
+
89
+ <body>
90
+
91
+ <nav class="navbar" id="navbar">
92
+ <div class="navbar-heading" id="navbar-heading"><a href="index.html"><h2 class="navbar-heading-text">LittleJS - The Tiny JavaScript Game Engine That Can!</h2></a></div><div class="search-box" id="search-box"><div class="search-box-input-container"><input class="search-box-input" type="text" placeholder="Search..." id="search-box-input" /><svg class="search-icon" alt="search-icon"><use xlink:href="#search-icon"></use></svg></div><div class="search-item-container" id="search-item-container"><ul class="search-item-ul" id="search-item-ul"></ul></div></div><div class="sidebar-main-content" id="sidebar-main-content"><div class="accordion collapsed" id="3026681" > <h3 class="accordion-heading">Classes<svg><use xlink:href="#down-icon"></use></svg></h3><ul class="accordion-content"><li class="accordion collapsed child" id=864267><div class="accordion-heading child"><a href="Color.html">Color</a><svg><use xlink:href="#down-icon"></use></svg></div><ul class='methods accordion-content'><li data-type='method'><a href="Color.html#add">add</a></li><li data-type='method'><a href="Color.html#clamp">clamp</a></li><li data-type='method'><a href="Color.html#copy">copy</a></li><li data-type='method'><a href="Color.html#divide">divide</a></li><li data-type='method'><a href="Color.html#lerp">lerp</a></li><li data-type='method'><a href="Color.html#multiply">multiply</a></li><li data-type='method'><a href="Color.html#mutate">mutate</a></li><li data-type='method'><a href="Color.html#rgba">rgba</a></li><li data-type='method'><a href="Color.html#rgbaInt">rgbaInt</a></li><li data-type='method'><a href="Color.html#scale">scale</a></li><li data-type='method'><a href="Color.html#setHSLA">setHSLA</a></li><li data-type='method'><a href="Color.html#subtract">subtract</a></li></ul></li><li class="accordion collapsed child" id=3569399><div class="accordion-heading child"><a href="EngineObject.html">EngineObject</a><svg><use xlink:href="#down-icon"></use></svg></div><ul class='methods accordion-content'><li data-type='method'><a href="EngineObject.html#addChild">addChild</a></li><li data-type='method'><a href="EngineObject.html#applyAcceleration">applyAcceleration</a></li><li data-type='method'><a href="EngineObject.html#applyForce">applyForce</a></li><li data-type='method'><a href="EngineObject.html#collideWithObject">collideWithObject</a></li><li data-type='method'><a href="EngineObject.html#collideWithTile">collideWithTile</a></li><li data-type='method'><a href="EngineObject.html#collideWithTileRaycast">collideWithTileRaycast</a></li><li data-type='method'><a href="EngineObject.html#destroy">destroy</a></li><li data-type='method'><a href="EngineObject.html#getAliveTime">getAliveTime</a></li><li data-type='method'><a href="EngineObject.html#getMirrorSign">getMirrorSign</a></li><li data-type='method'><a href="EngineObject.html#removeChild">removeChild</a></li><li data-type='method'><a href="EngineObject.html#render">render</a></li><li data-type='method'><a href="EngineObject.html#setCollision">setCollision</a></li><li data-type='method'><a href="EngineObject.html#update">update</a></li></ul></li><li class="accordion collapsed child" id=2970668><div class="accordion-heading child"><a href="Medal.html">Medal</a><svg><use xlink:href="#down-icon"></use></svg></div><ul class='methods accordion-content'><li data-type='method'><a href="Medal.html#render">render</a></li><li data-type='method'><a href="Medal.html#renderIcon">renderIcon</a></li><li data-type='method'><a href="Medal.html#unlock">unlock</a></li></ul></li><li class="accordion collapsed child" id=2533015><div class="accordion-heading child"><a href="Music.html">Music</a><svg><use xlink:href="#down-icon"></use></svg></div><ul class='methods accordion-content'><li data-type='method'><a href="Music.html#play">play</a></li></ul></li><li class="accordion collapsed child" id=5490011><div class="accordion-heading child"><a href="Newgrounds.html">Newgrounds</a><svg><use xlink:href="#down-icon"></use></svg></div><ul class='methods accordion-content'><li data-type='method'><a href="Newgrounds.html#call">call</a></li><li data-type='method'><a href="Newgrounds.html#getScores">getScores</a></li><li data-type='method'><a href="Newgrounds.html#logView">logView</a></li><li data-type='method'><a href="Newgrounds.html#postScore">postScore</a></li><li data-type='method'><a href="Newgrounds.html#unlockMedal">unlockMedal</a></li></ul></li><li class="accordion collapsed child" id=5370538><div class="accordion-heading child"><a href="Particle.html">Particle</a><svg><use xlink:href="#down-icon"></use></svg></div><ul class='methods accordion-content'><li data-type='method'><a href="Particle.html#addChild">addChild</a></li><li data-type='method'><a href="Particle.html#applyAcceleration">applyAcceleration</a></li><li data-type='method'><a href="Particle.html#applyForce">applyForce</a></li><li data-type='method'><a href="Particle.html#collideWithObject">collideWithObject</a></li><li data-type='method'><a href="Particle.html#collideWithTile">collideWithTile</a></li><li data-type='method'><a href="Particle.html#collideWithTileRaycast">collideWithTileRaycast</a></li><li data-type='method'><a href="Particle.html#destroy">destroy</a></li><li data-type='method'><a href="Particle.html#getAliveTime">getAliveTime</a></li><li data-type='method'><a href="Particle.html#getMirrorSign">getMirrorSign</a></li><li data-type='method'><a href="Particle.html#removeChild">removeChild</a></li><li data-type='method'><a href="Particle.html#render">render</a></li><li data-type='method'><a href="Particle.html#setCollision">setCollision</a></li><li data-type='method'><a href="Particle.html#update">update</a></li></ul></li><li class="accordion collapsed child" id=4983401><div class="accordion-heading child"><a href="ParticleEmitter.html">ParticleEmitter</a><svg><use xlink:href="#down-icon"></use></svg></div><ul class='methods accordion-content'><li data-type='method'><a href="ParticleEmitter.html#addChild">addChild</a></li><li data-type='method'><a href="ParticleEmitter.html#applyAcceleration">applyAcceleration</a></li><li data-type='method'><a href="ParticleEmitter.html#applyForce">applyForce</a></li><li data-type='method'><a href="ParticleEmitter.html#collideWithObject">collideWithObject</a></li><li data-type='method'><a href="ParticleEmitter.html#collideWithTile">collideWithTile</a></li><li data-type='method'><a href="ParticleEmitter.html#collideWithTileRaycast">collideWithTileRaycast</a></li><li data-type='method'><a href="ParticleEmitter.html#destroy">destroy</a></li><li data-type='method'><a href="ParticleEmitter.html#emitParticle">emitParticle</a></li><li data-type='method'><a href="ParticleEmitter.html#getAliveTime">getAliveTime</a></li><li data-type='method'><a href="ParticleEmitter.html#getMirrorSign">getMirrorSign</a></li><li data-type='method'><a href="ParticleEmitter.html#removeChild">removeChild</a></li><li data-type='method'><a href="ParticleEmitter.html#render">render</a></li><li data-type='method'><a href="ParticleEmitter.html#setCollision">setCollision</a></li><li data-type='method'><a href="ParticleEmitter.html#update">update</a></li></ul></li><li class="accordion collapsed child" id=4102019><div class="accordion-heading child"><a href="Sound.html">Sound</a><svg><use xlink:href="#down-icon"></use></svg></div><ul class='methods accordion-content'><li data-type='method'><a href="Sound.html#play">play</a></li><li data-type='method'><a href="Sound.html#playNote">playNote</a></li></ul></li><li class="accordion collapsed child" id=3455641><div class="accordion-heading child"><a href="TileLayer.html">TileLayer</a><svg><use xlink:href="#down-icon"></use></svg></div><ul class='methods accordion-content'><li data-type='method'><a href="TileLayer.html#addChild">addChild</a></li><li data-type='method'><a href="TileLayer.html#applyAcceleration">applyAcceleration</a></li><li data-type='method'><a href="TileLayer.html#applyForce">applyForce</a></li><li data-type='method'><a href="TileLayer.html#collideWithObject">collideWithObject</a></li><li data-type='method'><a href="TileLayer.html#collideWithTile">collideWithTile</a></li><li data-type='method'><a href="TileLayer.html#collideWithTileRaycast">collideWithTileRaycast</a></li><li data-type='method'><a href="TileLayer.html#destroy">destroy</a></li><li data-type='method'><a href="TileLayer.html#drawAllTileData">drawAllTileData</a></li><li data-type='method'><a href="TileLayer.html#drawCanvas2D">drawCanvas2D</a></li><li data-type='method'><a href="TileLayer.html#drawRect">drawRect</a></li><li data-type='method'><a href="TileLayer.html#drawTile">drawTile</a></li><li data-type='method'><a href="TileLayer.html#drawTileData">drawTileData</a></li><li data-type='method'><a href="TileLayer.html#getAliveTime">getAliveTime</a></li><li data-type='method'><a href="TileLayer.html#getData">getData</a></li><li data-type='method'><a href="TileLayer.html#getMirrorSign">getMirrorSign</a></li><li data-type='method'><a href="TileLayer.html#redraw">redraw</a></li><li data-type='method'><a href="TileLayer.html#redrawEnd">redrawEnd</a></li><li data-type='method'><a href="TileLayer.html#redrawStart">redrawStart</a></li><li data-type='method'><a href="TileLayer.html#removeChild">removeChild</a></li><li data-type='method'><a href="TileLayer.html#render">render</a></li><li data-type='method'><a href="TileLayer.html#setCollision">setCollision</a></li><li data-type='method'><a href="TileLayer.html#setData">setData</a></li><li data-type='method'><a href="TileLayer.html#update">update</a></li></ul></li><li class="accordion collapsed child" id=1570904><div class="accordion-heading child"><a href="TileLayerData.html">TileLayerData</a><svg><use xlink:href="#down-icon"></use></svg></div><ul class='methods accordion-content'><li data-type='method'><a href="TileLayerData.html#clear">clear</a></li></ul></li><li class="accordion collapsed child" id=3515045><div class="accordion-heading child"><a href="Timer.html">Timer</a><svg><use xlink:href="#down-icon"></use></svg></div><ul class='methods accordion-content'><li data-type='method'><a href="Timer.html#active">active</a></li><li data-type='method'><a href="Timer.html#elapsed">elapsed</a></li><li data-type='method'><a href="Timer.html#get">get</a></li><li data-type='method'><a href="Timer.html#getPercent">getPercent</a></li><li data-type='method'><a href="Timer.html#isSet">isSet</a></li><li data-type='method'><a href="Timer.html#set">set</a></li><li data-type='method'><a href="Timer.html#unset">unset</a></li></ul></li><li class="accordion collapsed child" id=7852068><div class="accordion-heading child"><a href="Vector2.html">Vector2</a><svg><use xlink:href="#down-icon"></use></svg></div><ul class='methods accordion-content'><li data-type='method'><a href="Vector2.html#add">add</a></li><li data-type='method'><a href="Vector2.html#angle">angle</a></li><li data-type='method'><a href="Vector2.html#area">area</a></li><li data-type='method'><a href="Vector2.html#arrayCheck">arrayCheck</a></li><li data-type='method'><a href="Vector2.html#clampLength">clampLength</a></li><li data-type='method'><a href="Vector2.html#copy">copy</a></li><li data-type='method'><a href="Vector2.html#cross">cross</a></li><li data-type='method'><a href="Vector2.html#direction">direction</a></li><li data-type='method'><a href="Vector2.html#distance">distance</a></li><li data-type='method'><a href="Vector2.html#distanceSquared">distanceSquared</a></li><li data-type='method'><a href="Vector2.html#divide">divide</a></li><li data-type='method'><a href="Vector2.html#dot">dot</a></li><li data-type='method'><a href="Vector2.html#flip">flip</a></li><li data-type='method'><a href="Vector2.html#floor">floor</a></li><li data-type='method'><a href="Vector2.html#invert">invert</a></li><li data-type='method'><a href="Vector2.html#length">length</a></li><li data-type='method'><a href="Vector2.html#lengthSquared">lengthSquared</a></li><li data-type='method'><a href="Vector2.html#lerp">lerp</a></li><li data-type='method'><a href="Vector2.html#multiply">multiply</a></li><li data-type='method'><a href="Vector2.html#normalize">normalize</a></li><li data-type='method'><a href="Vector2.html#rotate">rotate</a></li><li data-type='method'><a href="Vector2.html#scale">scale</a></li><li data-type='method'><a href="Vector2.html#setAngle">setAngle</a></li><li data-type='method'><a href="Vector2.html#subtract">subtract</a></li></ul></li></ul> </div><div class="accordion collapsed" id="813939" > <h3 class="accordion-heading">Namespaces<svg><use xlink:href="#down-icon"></use></svg></h3><ul class="accordion-content"><li class="accordion collapsed child" id=2717358><div class="accordion-heading child"><a href="Audio.html">Audio</a><svg><use xlink:href="#down-icon"></use></svg></div><ul class='methods accordion-content'><li data-type='method'><a href="Audio.html#.getNoteFrequency">getNoteFrequency</a></li><li data-type='method'><a href="Audio.html#.playAudioFile">playAudioFile</a></li><li data-type='method'><a href="Audio.html#.playSamples">playSamples</a></li><li data-type='method'><a href="Audio.html#.speak">speak</a></li><li data-type='method'><a href="Audio.html#.stopSpeech">stopSpeech</a></li><li data-type='method'><a href="Audio.html#.zzfx">zzfx</a></li><li data-type='method'><a href="Audio.html#.zzfxG">zzfxG</a></li><li data-type='method'><a href="Audio.html#.zzfxM">zzfxM</a></li></ul></li><li class="accordion collapsed child" id=8015982><div class="accordion-heading child"><a href="Debug.html">Debug</a><svg><use xlink:href="#down-icon"></use></svg></div><ul class='methods accordion-content'><li data-type='method'><a href="Debug.html#.debugAABB">debugAABB</a></li><li data-type='method'><a href="Debug.html#.debugCircle">debugCircle</a></li><li data-type='method'><a href="Debug.html#.debugClear">debugClear</a></li><li data-type='method'><a href="Debug.html#.debugLine">debugLine</a></li><li data-type='method'><a href="Debug.html#.debugPoint">debugPoint</a></li><li data-type='method'><a href="Debug.html#.debugRect">debugRect</a></li><li data-type='method'><a href="Debug.html#.debugSaveCanvas">debugSaveCanvas</a></li><li data-type='method'><a href="Debug.html#.debugText">debugText</a></li></ul></li><li class="accordion collapsed child" id=3886530><div class="accordion-heading child"><a href="Draw.html">Draw</a><svg><use xlink:href="#down-icon"></use></svg></div><ul class='methods accordion-content'><li data-type='method'><a href="Draw.html#.drawCanvas2D">drawCanvas2D</a></li><li data-type='method'><a href="Draw.html#.drawLine">drawLine</a></li><li data-type='method'><a href="Draw.html#.drawRect">drawRect</a></li><li data-type='method'><a href="Draw.html#.drawRectScreenSpace">drawRectScreenSpace</a></li><li data-type='method'><a href="Draw.html#.drawText">drawText</a></li><li data-type='method'><a href="Draw.html#.drawTile">drawTile</a></li><li data-type='method'><a href="Draw.html#.drawTileScreenSpace">drawTileScreenSpace</a></li><li data-type='method'><a href="Draw.html#.isFullscreen">isFullscreen</a></li><li data-type='method'><a href="Draw.html#.screenToWorld">screenToWorld</a></li><li data-type='method'><a href="Draw.html#.setBlendMode">setBlendMode</a></li><li data-type='method'><a href="Draw.html#.toggleFullscreen">toggleFullscreen</a></li><li data-type='method'><a href="Draw.html#.worldToScreen">worldToScreen</a></li></ul></li><li class="accordion collapsed child" id=2344392><div class="accordion-heading child"><a href="Input.html">Input</a><svg><use xlink:href="#down-icon"></use></svg></div><ul class='methods accordion-content'><li data-type='method'><a href="Input.html#.clearInput">clearInput</a></li><li data-type='method'><a href="Input.html#.gamepadIsDown">gamepadIsDown</a></li><li data-type='method'><a href="Input.html#.gamepadStick">gamepadStick</a></li><li data-type='method'><a href="Input.html#.gamepadWasPressed">gamepadWasPressed</a></li><li data-type='method'><a href="Input.html#.gamepadWasReleased">gamepadWasReleased</a></li><li data-type='method'><a href="Input.html#.keyIsDown">keyIsDown</a></li><li data-type='method'><a href="Input.html#.keyWasPressed">keyWasPressed</a></li><li data-type='method'><a href="Input.html#.keyWasReleased">keyWasReleased</a></li></ul></li><li class="accordion collapsed child" id=4725200><div class="accordion-heading child"><a href="Medals.html">Medals</a><svg><use xlink:href="#down-icon"></use></svg></div><ul class='methods accordion-content'><li data-type='method'><a href="Medals.html#.medalsInit">medalsInit</a></li></ul></li><li class="accordion collapsed child" id=7676165><div class="accordion-heading child"><a href="Random.html">Random</a><svg><use xlink:href="#down-icon"></use></svg></div><ul class='methods accordion-content'><li data-type='method'><a href="Random.html#.rand">rand</a></li><li data-type='method'><a href="Random.html#.randColor">randColor</a></li><li data-type='method'><a href="Random.html#.randInCircle">randInCircle</a></li><li data-type='method'><a href="Random.html#.randInt">randInt</a></li><li data-type='method'><a href="Random.html#.randSeeded">randSeeded</a></li><li data-type='method'><a href="Random.html#.randSign">randSign</a></li><li data-type='method'><a href="Random.html#.randVector">randVector</a></li></ul></li><li class="accordion-list" id=""><a href="Settings.html">Settings</a></li><li class="accordion collapsed child" id=2840044><div class="accordion-heading child"><a href="TileCollision.html">TileCollision</a><svg><use xlink:href="#down-icon"></use></svg></div><ul class='methods accordion-content'><li data-type='method'><a href="TileCollision.html#.getTileCollisionData">getTileCollisionData</a></li><li data-type='method'><a href="TileCollision.html#.initTileCollision">initTileCollision</a></li><li data-type='method'><a href="TileCollision.html#.setTileCollisionData">setTileCollisionData</a></li><li data-type='method'><a href="TileCollision.html#.tileCollisionRaycast">tileCollisionRaycast</a></li><li data-type='method'><a href="TileCollision.html#.tileCollisionTest">tileCollisionTest</a></li></ul></li><li class="accordion collapsed child" id=6238309><div class="accordion-heading child"><a href="Utilities.html">Utilities</a><svg><use xlink:href="#down-icon"></use></svg></div><ul class='methods accordion-content'><li data-type='method'><a href="Utilities.html#.abs">abs</a></li><li data-type='method'><a href="Utilities.html#.clamp">clamp</a></li><li data-type='method'><a href="Utilities.html#.formatTime">formatTime</a></li><li data-type='method'><a href="Utilities.html#.isOverlapping">isOverlapping</a></li><li data-type='method'><a href="Utilities.html#.lerp">lerp</a></li><li data-type='method'><a href="Utilities.html#.max">max</a></li><li data-type='method'><a href="Utilities.html#.min">min</a></li><li data-type='method'><a href="Utilities.html#.mod">mod</a></li><li data-type='method'><a href="Utilities.html#.nearestPowerOfTwo">nearestPowerOfTwo</a></li><li data-type='method'><a href="Utilities.html#.percent">percent</a></li><li data-type='method'><a href="Utilities.html#.sign">sign</a></li><li data-type='method'><a href="Utilities.html#.smoothStep">smoothStep</a></li><li data-type='method'><a href="Utilities.html#.vec2">vec2</a></li><li data-type='method'><a href="Utilities.html#.wave">wave</a></li></ul></li><li class="accordion collapsed child" id=6305592><div class="accordion-heading child"><a href="WebGL.html">WebGL</a><svg><use xlink:href="#down-icon"></use></svg></div><ul class='methods accordion-content'><li data-type='method'><a href="WebGL.html#.glCompileShader">glCompileShader</a></li><li data-type='method'><a href="WebGL.html#.glCopyToContext">glCopyToContext</a></li><li data-type='method'><a href="WebGL.html#.glCreateBuffer">glCreateBuffer</a></li><li data-type='method'><a href="WebGL.html#.glCreateProgram">glCreateProgram</a></li><li data-type='method'><a href="WebGL.html#.glCreateTexture">glCreateTexture</a></li><li data-type='method'><a href="WebGL.html#.glDraw">glDraw</a></li><li data-type='method'><a href="WebGL.html#.glFlush">glFlush</a></li><li data-type='method'><a href="WebGL.html#.glSetBlendMode">glSetBlendMode</a></li><li data-type='method'><a href="WebGL.html#.glSetTexture">glSetTexture</a></li></ul></li></ul> </div><div class="accordion collapsed" id="9475387" > <h3 class="accordion-heading">Global<svg><use xlink:href="#down-icon"></use></svg></h3><ul class="accordion-content"><li class="accordion-list" id=""><a href="global.html#engineCollideObjects">engineCollideObjects</a></li><li class="accordion-list" id=""><a href="global.html#engineInit">engineInit</a></li><li class="accordion-list" id=""><a href="global.html#engineName">engineName</a></li><li class="accordion-list" id=""><a href="global.html#engineObjects">engineObjects</a></li><li class="accordion-list" id=""><a href="global.html#engineObjectsCallback">engineObjectsCallback</a></li><li class="accordion-list" id=""><a href="global.html#engineObjectsDestroy">engineObjectsDestroy</a></li><li class="accordion-list" id=""><a href="global.html#engineObjectsUpdate">engineObjectsUpdate</a></li><li class="accordion-list" id=""><a href="global.html#engineVersion">engineVersion</a></li><li class="accordion-list" id=""><a href="global.html#FPS">FPS</a></li><li class="accordion-list" id=""><a href="global.html#frame">frame</a></li><li class="accordion-list" id=""><a href="global.html#paused">paused</a></li><li class="accordion-list" id=""><a href="global.html#time">time</a></li><li class="accordion-list" id=""><a href="global.html#timeDelta">timeDelta</a></li><li class="accordion-list" id=""><a href="global.html#timeReal">timeReal</a></li></ul> </div></div>
93
+
94
+
95
+ </nav>
96
+ <div class="navbar-ham" id="navbar-ham">
97
+ <div>
98
+ <div class="first"></div>
99
+ <div class="second"></div>
100
+ <div class="third"></div>
101
+ </div>
102
+ </div>
103
+
104
+ <div id="main" class="main-content">
105
+
106
+ <h1 id='page-title' class="page-title">
107
+ engineDebug.js
108
+ </h1>
109
+
110
+
111
+
112
+
113
+
114
+
115
+
116
+ <section>
117
+ <article>
118
+ <pre class="prettyprint source linenums"><code>/**
119
+ * LittleJS Debug System
120
+ * &lt;br> - Debug overlay with mouse pick
121
+ * &lt;br> - Debug primitive rendering
122
+ * &lt;br> - Save screenshots to disk
123
+ * @namespace Debug
124
+ */
125
+
126
+ 'use strict';
127
+
128
+ /** True if debug is enabled
129
+ * @default
130
+ * @memberof Debug */
131
+ const debug = 1;
132
+
133
+ /** True if asserts are enaled
134
+ * @default
135
+ * @memberof Debug */
136
+ const enableAsserts = 1;
137
+
138
+ /** Size to render debug points by default
139
+ * @default
140
+ * @memberof Debug */
141
+ const debugPointSize = .5;
142
+
143
+ /** True if watermark with FPS should be down
144
+ * @default
145
+ * @memberof Debug */
146
+ let showWatermark = 1;
147
+
148
+ /** True if god mode is enabled, handle this however you want
149
+ * @default
150
+ * @memberof Debug */
151
+ let godMode = 0;
152
+
153
+ // Engine internal variables not exposed to documentation
154
+ let debugPrimitives = [], debugOverlay = 0, debugPhysics = 0, debugRaycast = 0,
155
+ debugParticles = 0, debugGamepads = 0, debugMedals = 0, debugTakeScreenshot, downloadLink;
156
+
157
+ ///////////////////////////////////////////////////////////////////////////////
158
+ // Debug helper functions
159
+
160
+ /** Asserts if the experssion is false, does not do anything in release builds
161
+ * @param {Boolean} assertion
162
+ * @param {Object} output
163
+ * @memberof Debug */
164
+ const ASSERT = enableAsserts ? (...assert)=> console.assert(...assert) : ()=>{};
165
+
166
+ /** Draw a debug rectangle in world space
167
+ * @param {Vector2} pos
168
+ * @param {Vector2} [size=new Vector2()]
169
+ * @param {String} [color='#fff']
170
+ * @param {Number} [time=0]
171
+ * @param {Number} [angle=0]
172
+ * @param {Boolean} [fill=0]
173
+ * @memberof Debug */
174
+ const debugRect = (pos, size=vec2(), color='#fff', time=0, angle=0, fill=0)=>
175
+ {
176
+ ASSERT(typeof color == 'string'); // pass in regular html strings as colors
177
+ debugPrimitives.push({pos, size:vec2(size), color, time:new Timer(time), angle, fill});
178
+ }
179
+
180
+ /** Draw a debug circle in world space
181
+ * @param {Vector2} pos
182
+ * @param {Number} [radius=0]
183
+ * @param {String} [color='#fff']
184
+ * @param {Number} [time=0]
185
+ * @param {Boolean} [fill=0]
186
+ * @memberof Debug */
187
+ const debugCircle = (pos, radius=0, color='#fff', time=0, fill=0)=>
188
+ {
189
+ ASSERT(typeof color == 'string'); // pass in regular html strings as colors
190
+ debugPrimitives.push({pos, size:radius, color, time:new Timer(time), angle:0, fill});
191
+ }
192
+
193
+ /** Draw a debug point in world space
194
+ * @param {Vector2} pos
195
+ * @param {String} [color='#fff']
196
+ * @param {Number} [time=0]
197
+ * @param {Number} [angle=0]
198
+ * @memberof Debug */
199
+ const debugPoint = (pos, color, time, angle)=> debugRect(pos, 0, color, time, angle);
200
+
201
+ /** Draw a debug line in world space
202
+ * @param {Vector2} posA
203
+ * @param {Vector2} posB
204
+ * @param {String} [color='#fff']
205
+ * @param {Number} [thickness=.1]
206
+ * @param {Number} [time=0]
207
+ * @memberof Debug */
208
+ const debugLine = (posA, posB, color, thickness=.1, time)=>
209
+ {
210
+ const halfDelta = vec2((posB.x - posA.x)/2, (posB.y - posA.y)/2);
211
+ const size = vec2(thickness, halfDelta.length()*2);
212
+ debugRect(posA.add(halfDelta), size, color, time, halfDelta.angle(), 1);
213
+ }
214
+
215
+ /** Draw a debug axis aligned bounding box in world space
216
+ * @param {Vector2} posA
217
+ * @param {Vector2} sizeA
218
+ * @param {Vector2} posB
219
+ * @param {Vector2} sizeB
220
+ * @param {String} [color='#fff']
221
+ * @memberof Debug */
222
+ const debugAABB = (pA, sA, pB, sB, color)=>
223
+ {
224
+ const minPos = vec2(min(pA.x - sA.x/2, pB.x - sB.x/2), min(pA.y - sA.y/2, pB.y - sB.y/2));
225
+ const maxPos = vec2(max(pA.x + sA.x/2, pB.x + sB.x/2), max(pA.y + sA.y/2, pB.y + sB.y/2));
226
+ debugRect(minPos.lerp(maxPos,.5), maxPos.subtract(minPos), color);
227
+ }
228
+
229
+ /** Draw a debug axis aligned bounding box in world space
230
+ * @param {String} text
231
+ * @param {Vector2} pos
232
+ * @param {Number} [size=1]
233
+ * @param {String} [color='#fff']
234
+ * @param {Number} [time=0]
235
+ * @param {Number} [angle=0]
236
+ * @param {String} [font='monospace']
237
+ * @memberof Debug */
238
+ const debugText = (text, pos, size=1, color='#fff', time=0, angle=0, font='monospace')=>
239
+ {
240
+ ASSERT(typeof color == 'string'); // pass in regular html strings as colors
241
+ debugPrimitives.push({text, pos, size, color, time:new Timer(time), angle, font});
242
+ }
243
+
244
+ /** Clear all debug primitives in the list
245
+ * @memberof Debug */
246
+ const debugClear = ()=> debugPrimitives = [];
247
+
248
+ /** Save a canvas to disk
249
+ * @param {HTMLCanvasElement} canvas
250
+ * @param {String} [filename]
251
+ * @memberof Debug */
252
+ const debugSaveCanvas = (canvas, filename = engineName + '.png') =>
253
+ {
254
+ downloadLink.download = 'screenshot.png';
255
+ downloadLink.href = canvas.toDataURL('image/png').replace('image/png','image/octet-stream');
256
+ downloadLink.click();
257
+ }
258
+
259
+ ///////////////////////////////////////////////////////////////////////////////
260
+ // Engine debug function (called automatically)
261
+
262
+ const debugInit = ()=>
263
+ {
264
+ // create link for saving screenshots
265
+ document.body.appendChild(downloadLink = document.createElement('a'));
266
+ downloadLink.style.display = 'none';
267
+ }
268
+
269
+ const debugUpdate = ()=>
270
+ {
271
+ if (!debug)
272
+ return;
273
+
274
+ if (keyWasPressed(192)) // ~
275
+ debugOverlay = !debugOverlay;
276
+ if (keyWasPressed(49)) // 1
277
+ debugPhysics = !debugPhysics, debugParticles = 0;
278
+ if (keyWasPressed(50)) // 2
279
+ debugParticles = !debugParticles, debugPhysics = 0;
280
+ if (keyWasPressed(51)) // 3
281
+ godMode = !godMode;
282
+ if (keyWasPressed(53)) // 5
283
+ debugTakeScreenshot = 1;
284
+ //if (keyWasPressed(54)) // 6
285
+ // debugToggleParticleEditor();
286
+ if (keyWasPressed(55)) // 7
287
+ debugGamepads = !debugGamepads;
288
+ //if (keyWasPressed(56)) // 8
289
+ //if (keyWasPressed(57)) // 9
290
+ if (keyWasPressed(48)) // 0
291
+ showWatermark = !showWatermark;
292
+ }
293
+
294
+ const debugRender = ()=>
295
+ {
296
+ glCopyToContext(mainContext);
297
+
298
+ if (debugTakeScreenshot)
299
+ {
300
+ // composite canvas
301
+ glCopyToContext(mainContext, 1);
302
+ mainContext.drawImage(overlayCanvas, 0, 0);
303
+ overlayCanvas.width |= 0;
304
+
305
+ debugSaveCanvas(mainCanvas);
306
+ debugTakeScreenshot = 0;
307
+ }
308
+
309
+ if (debugGamepads &amp;&amp; gamepadsEnable &amp;&amp; navigator.getGamepads)
310
+ {
311
+ // poll gamepads
312
+ const gamepads = navigator.getGamepads();
313
+ for (let i = gamepads.length; i--;)
314
+ {
315
+ const gamepad = gamepads[i];
316
+ if (gamepad)
317
+ {
318
+ // gamepad debug display
319
+ const stickScale = 1;
320
+ const buttonScale = .2;
321
+ const centerPos = cameraPos;
322
+ const sticks = stickData[i];
323
+ for (let j = sticks.length; j--;)
324
+ {
325
+ const drawPos = centerPos.add(vec2(j*stickScale*2,i*stickScale*3));
326
+ const stickPos = drawPos.add(sticks[j].scale(stickScale));
327
+ debugCircle(drawPos, stickScale, '#fff7',0,1);
328
+ debugLine(drawPos, stickPos, '#f00');
329
+ debugPoint(stickPos, '#f00');
330
+ }
331
+ for (let j = gamepad.buttons.length; j--;)
332
+ {
333
+ const drawPos = centerPos.add(vec2(j*buttonScale*2, i*stickScale*3-stickScale-buttonScale));
334
+ const pressed = gamepad.buttons[j].pressed;
335
+ debugCircle(drawPos, buttonScale, pressed ? '#f00' : '#fff7', 0, 1);
336
+ debugText(j, drawPos, .2);
337
+ }
338
+ }
339
+ }
340
+ }
341
+
342
+ if (debugOverlay)
343
+ {
344
+ for (const o of engineObjects)
345
+ {
346
+ if (o.canvas)
347
+ continue; // skip tile layers
348
+
349
+ const size = o.size.copy();
350
+ size.x = max(size.x, .2);
351
+ size.y = max(size.y, .2);
352
+
353
+ const color = new Color(
354
+ o.collideTiles?1:0,
355
+ o.collideSolidObjects?1:0,
356
+ o.isSolid?1:0,
357
+ o.parent ? .2 : .5);
358
+
359
+ // show object info
360
+ drawRect(o.pos, size, color);
361
+ drawRect(o.pos, size.scale(.8), o.parent ? new Color(1,1,1,.5) : new Color(0,0,0,.8));
362
+ o.parent &amp;&amp; drawLine(o.pos, o.parent.pos, .1, new Color(0,0,1,.5));
363
+ }
364
+
365
+ // mouse pick
366
+ let bestDistance = Infinity, bestObject;
367
+ for (const o of engineObjects)
368
+ {
369
+ const distance = mousePos.distanceSquared(o.pos);
370
+ if (distance &lt; bestDistance)
371
+ {
372
+ bestDistance = distance;
373
+ bestObject = o
374
+ }
375
+ }
376
+
377
+ if (bestObject)
378
+ {
379
+ const saveContext = mainContext;
380
+ mainContext = overlayContext
381
+ const raycastHitPos = tileCollisionRaycast(bestObject.pos, mousePos);
382
+ raycastHitPos &amp;&amp; drawRect(raycastHitPos.floor().add(vec2(.5)), vec2(1), new Color(0,1,1,.3));
383
+ drawRect(mousePos.floor().add(vec2(.5)), vec2(1), new Color(0,0,1,.5));
384
+ drawLine(mousePos, bestObject.pos, .1, !raycastHitPos ? new Color(0,1,0,.5) : new Color(1,0,0,.5));
385
+
386
+ let pos = mousePos.copy(), height = vec2(0,.5);
387
+ const printVec2 = (v)=> '(' + (v.x>0?' ':'') + (v.x).toFixed(2) + ',' + (v.y>0?' ':'') + (v.y).toFixed(2) + ')';
388
+ const args = [.5, new Color, .05, undefined, undefined, 'monospace'];
389
+
390
+ drawText('pos = ' + printVec2(bestObject.pos)
391
+ + (bestObject.angle>0?' ':' ') + (bestObject.angle*180/PI).toFixed(1) + '°',
392
+ pos = pos.add(height), ...args);
393
+ drawText('vel = ' + printVec2(bestObject.velocity), pos = pos.add(height), ...args);
394
+ drawText('size = ' + printVec2(bestObject.size), pos = pos.add(height), ...args);
395
+ drawText('collision = ' + getTileCollisionData(mousePos), pos = mousePos.subtract(height), ...args);
396
+ mainContext = saveContext;
397
+ }
398
+
399
+ glCopyToContext(mainContext);
400
+ }
401
+
402
+ {
403
+ // render debug rects
404
+ overlayContext.lineWidth = 1;
405
+ const pointSize = debugPointSize * cameraScale;
406
+ debugPrimitives.forEach(p=>
407
+ {
408
+ // create canvas transform from world space to screen space
409
+ const pos = worldToScreen(p.pos);
410
+
411
+ overlayContext.save();
412
+ overlayContext.lineWidth = 2;
413
+ overlayContext.translate(pos.x|0, pos.y|0);
414
+ overlayContext.rotate(p.angle);
415
+ overlayContext.fillStyle = overlayContext.strokeStyle = p.color;
416
+
417
+ if (p.text != undefined)
418
+ {
419
+ overlayContext.font = p.size*cameraScale + 'px '+ p.font;
420
+ overlayContext.textAlign = 'center';
421
+ overlayContext.textBaseline = 'middle';
422
+ overlayContext.fillText(p.text, 0, 0);
423
+ }
424
+ else if (p.size == 0 || p.size.x === 0 &amp;&amp; p.size.y === 0 )
425
+ {
426
+ // point
427
+ overlayContext.fillRect(-pointSize/2, -1, pointSize, 3);
428
+ overlayContext.fillRect(-1, -pointSize/2, 3, pointSize);
429
+ }
430
+ else if (p.size.x != undefined)
431
+ {
432
+ // rect
433
+ const w = p.size.x*cameraScale|0, h = p.size.y*cameraScale|0;
434
+ p.fill &amp;&amp; overlayContext.fillRect(-w/2|0, -h/2|0, w, h);
435
+ overlayContext.strokeRect(-w/2|0, -h/2|0, w, h);
436
+ }
437
+ else
438
+ {
439
+ // circle
440
+ overlayContext.beginPath();
441
+ overlayContext.arc(0, 0, p.size*cameraScale, 0, 9);
442
+ p.fill &amp;&amp; overlayContext.fill();
443
+ overlayContext.stroke();
444
+ }
445
+
446
+ overlayContext.restore();
447
+ });
448
+
449
+ overlayContext.fillStyle = overlayContext.strokeStyle = '#fff';
450
+ }
451
+
452
+ {
453
+ let x = 9, y = -20, h = 30;
454
+ overlayContext.fillStyle = '#fff';
455
+ overlayContext.textAlign = 'left';
456
+ overlayContext.textBaseline = 'top';
457
+ overlayContext.font = '28px monospace';
458
+ overlayContext.shadowColor = '#000';
459
+ overlayContext.shadowBlur = 9;
460
+
461
+ if (debugOverlay)
462
+ {
463
+ overlayContext.fillText(engineName, x, y += h);
464
+ overlayContext.fillText('Objects: ' + engineObjects.length, x, y += h);
465
+ overlayContext.fillText('Time: ' + formatTime(time), x, y += h);
466
+ overlayContext.fillText('---------', x, y += h);
467
+ overlayContext.fillStyle = '#f00';
468
+ overlayContext.fillText('~: Debug Overlay', x, y += h);
469
+ overlayContext.fillStyle = debugPhysics ? '#f00' : '#fff';
470
+ overlayContext.fillText('1: Debug Physics', x, y += h);
471
+ overlayContext.fillStyle = debugParticles ? '#f00' : '#fff';
472
+ overlayContext.fillText('2: Debug Particles', x, y += h);
473
+ overlayContext.fillStyle = godMode ? '#f00' : '#fff';
474
+ overlayContext.fillText('3: God Mode', x, y += h);
475
+ overlayContext.fillStyle = '#fff';
476
+ overlayContext.fillText('5: Save Screenshot', x, y += h);
477
+ //overlayContext.fillStyle = debugParticleEditor ? '#f00' : '#fff';
478
+ //overlayContext.fillText('6: Particle Editor', x, y += h);
479
+ overlayContext.fillStyle = debugGamepads ? '#f00' : '#fff';
480
+ overlayContext.fillText('7: Debug Gamepads', x, y += h);
481
+ }
482
+ else
483
+ {
484
+ overlayContext.fillText(debugPhysics ? 'Debug Physics' : '', x, y += h);
485
+ overlayContext.fillText(debugParticles ? 'Debug Particles' : '', x, y += h);
486
+ overlayContext.fillText(godMode ? 'God Mode' : '', x, y += h);
487
+ overlayContext.fillText(debugGamepads ? 'Debug Gamepads' : '', x, y += h);
488
+ }
489
+
490
+ overlayContext.shadowBlur = 0;
491
+ }
492
+
493
+ debugPrimitives = debugPrimitives.filter(r=>r.time.get()&lt;0);
494
+ }
495
+
496
+ ///////////////////////////////////////////////////////////////////////////////
497
+ // particle system editor (work in progress)
498
+ let debugParticleEditor = 0, debugParticleSystem, debugParticleSystemDiv, particleSystemCode;
499
+
500
+ const debugToggleParticleEditor = ()=>
501
+ {
502
+ debugParticleEditor = !debugParticleEditor;
503
+
504
+ if (debugParticleEditor)
505
+ {
506
+ if (!debugParticleSystem || debugParticleSystem.destroyed)
507
+ debugParticleSystem = new ParticleEmitter(cameraPos);
508
+ }
509
+ else if (debugParticleSystem &amp;&amp; !debugParticleSystem.destroyed)
510
+ debugParticleSystem.destroy();
511
+
512
+
513
+ const colorToHex = (color)=>
514
+ {
515
+ const componentToHex = (c)=>
516
+ {
517
+ const hex = (c*255|0).toString(16);
518
+ return hex.length == 1 ? '0' + hex : hex;
519
+ }
520
+
521
+ return '#' + componentToHex(color.r) + componentToHex(color.g) + componentToHex(color.b);
522
+ }
523
+ const hexToColor = (hex)=>
524
+ {
525
+ return new Color(
526
+ parseInt(hex.substr(1,2), 16)/255,
527
+ parseInt(hex.substr(3,2), 16)/255,
528
+ parseInt(hex.substr(5,2), 16)/255)
529
+ }
530
+
531
+ if (!debugParticleSystemDiv)
532
+ {
533
+ const div = debugParticleSystemDiv = document.createElement('div');
534
+ div.innerHTML = '&lt;big>&lt;b>Particle Editor';
535
+ div.style = 'position:absolute;top:10;left:10;color:#fff';
536
+ document.body.appendChild(div);
537
+
538
+ for ( const setting of debugParticleSettings)
539
+ {
540
+ const input = setting[2] = document.createElement('input');
541
+ const name = setting[0];
542
+ const type = setting[1];
543
+ if (type)
544
+ {
545
+ if (type == 'color')
546
+ {
547
+ input.type = type;
548
+ const color = debugParticleSystem[name];
549
+ input.value = colorToHex(color);
550
+ }
551
+ else if (type == 'alpha' &amp;&amp; name == 'colorStartAlpha')
552
+ input.value = debugParticleSystem.colorStartA.a;
553
+ else if (type == 'alpha' &amp;&amp; name == 'colorEndAlpha')
554
+ input.value = debugParticleSystem.colorEndA.a;
555
+ else if (name == 'tileSizeX')
556
+ input.value = debugParticleSystem.tileSize.x;
557
+ else if (name == 'tileSizeY')
558
+ input.value = debugParticleSystem.tileSize.y;
559
+ }
560
+ else
561
+ input.value = debugParticleSystem[name] || '0';
562
+
563
+ input.oninput = (e)=>
564
+ {
565
+ const inputFloat = parseFloat(input.value) || 0;
566
+ if (type)
567
+ {
568
+ if (type == 'color')
569
+ {
570
+ const color = hexToColor(input.value);
571
+ debugParticleSystem[name].r = color.r;
572
+ debugParticleSystem[name].g = color.g;
573
+ debugParticleSystem[name].b = color.b;
574
+ }
575
+ else if (type == 'alpha' &amp;&amp; name == 'colorStartAlpha')
576
+ {
577
+ debugParticleSystem.colorStartA.a = clamp(inputFloat);
578
+ debugParticleSystem.colorStartB.a = clamp(inputFloat);
579
+ }
580
+ else if (type == 'alpha' &amp;&amp; name == 'colorEndAlpha')
581
+ {
582
+ debugParticleSystem.colorEndA.a = clamp(inputFloat);
583
+ debugParticleSystem.colorEndB.a = clamp(inputFloat);
584
+ }
585
+ else if (name == 'tileSizeX')
586
+ {
587
+ debugParticleSystem.tileSize = vec2(parseInt(input.value), debugParticleSystem.tileSize.y);
588
+ }
589
+ else if (name == 'tileSizeY')
590
+ {
591
+ debugParticleSystem.tileSize.y = vec2(debugParticleSystem.tileSize.x, parseInt(input.value));
592
+ }
593
+ }
594
+ else
595
+ debugParticleSystem[name] = inputFloat;
596
+
597
+ updateCode();
598
+ }
599
+ div.appendChild(document.createElement('br'));
600
+ div.appendChild(input);
601
+ div.appendChild(document.createTextNode(' ' + name));
602
+ }
603
+
604
+ div.appendChild(document.createElement('br'));
605
+ div.appendChild(document.createElement('br'));
606
+ div.appendChild(particleSystemCode = document.createElement('input'));
607
+ particleSystemCode.disabled = true;
608
+ div.appendChild(document.createTextNode(' code'));
609
+
610
+ div.appendChild(document.createElement('br'));
611
+ const button = document.createElement('button')
612
+ div.appendChild(button);
613
+ button.innerHTML = 'Copy To Clipboard';
614
+
615
+ button.onclick = (e)=> navigator.clipboard.writeText(particleSystemCode.value);
616
+
617
+ const updateCode = ()=>
618
+ {
619
+ let code = '';
620
+ let count = 0;
621
+ for ( const setting of debugParticleSettings)
622
+ {
623
+ const name = setting[0];
624
+ const type = setting[1];
625
+ let value;
626
+ if (name == 'tileSizeX' || type == 'alpha')
627
+ continue;
628
+
629
+ if (count++)
630
+ code += ', ';
631
+
632
+ if (name == 'tileSizeY')
633
+ {
634
+ value = `vec2(${debugParticleSystem.tileSize.x},${debugParticleSystem.tileSize.y})`;
635
+ }
636
+ else if (type == 'color')
637
+ {
638
+ const c = debugParticleSystem[name];
639
+ value = `new Color(${c.r},${c.g},${c.b},${c.a})`;
640
+ }
641
+ else
642
+ value = debugParticleSystem[name];
643
+ code += value;
644
+ }
645
+
646
+ particleSystemCode.value = '...[' + code + ']';
647
+ }
648
+ updateCode();
649
+ }
650
+ debugParticleSystemDiv.style.display = debugParticleEditor ? '' : 'none'
651
+ }
652
+
653
+ const debugParticleSettings =
654
+ [
655
+ ['emitSize'],
656
+ ['emitTime'],
657
+ ['emitRate'],
658
+ ['emitConeAngle'],
659
+ ['tileIndex'],
660
+ ['tileSizeX', 'tileSize'],
661
+ ['tileSizeY', 'tileSize'],
662
+ ['colorStartA', 'color'],
663
+ ['colorStartB', 'color'],
664
+ ['colorStartAlpha', 'alpha'],
665
+ ['colorEndA', 'color'],
666
+ ['colorEndB', 'color'],
667
+ ['colorEndAlpha', 'alpha'],
668
+ ['particleTime'],
669
+ ['sizeStart'],
670
+ ['sizeEnd'],
671
+ ['speed'],
672
+ ['angleSpeed'],
673
+ ['damping'],
674
+ ['angleDamping'],
675
+ ['gravityScale'],
676
+ ['particleConeAngle'],
677
+ ['fadeRate'],
678
+ ['randomness'],
679
+ ['collideTiles'],
680
+ ['additive'],
681
+ ['randomColorComponents'],
682
+ ['renderOrder'],
683
+ ];</code></pre>
684
+ </article>
685
+ </section>
686
+
687
+
688
+
689
+
690
+ </div>
691
+
692
+ <footer class="footer" id="footer">
693
+ <a href=https://github.com/KilledByAPixel/LittleJS>LittleJS - MIT License - Copyright 2021 Frank Force</a>
694
+ </footer>
695
+
696
+ <script src="scripts/third-party/prettify.js"></script>
697
+ <script src="scripts/third-party/lang-css.js"></script>
698
+ <script type="text/javascript" src="scripts/misc.js"></script>
699
+
700
+ <script>prettyPrint();</script>
701
+ <script src="scripts/linenumber.js"></script>
702
+ <script src="scripts/fix-code-block.js"></script>
703
+ <script src="scripts/fix-navbar.js"></script>
704
+
705
+ <script src="scripts/search.js"></script>
706
+ <script src="scripts/third-party/fuse.js"></script>
707
+ <script>
708
+ var list = [{"title":"Color","link":"<a href=\"Color.html\">Color</a>"},{"title":"Color#add","link":"<a href=\"Color.html#add\">Color &rtrif; add</a>"},{"title":"Color#clamp","link":"<a href=\"Color.html#clamp\">Color &rtrif; clamp</a>"},{"title":"Color#copy","link":"<a href=\"Color.html#copy\">Color &rtrif; copy</a>"},{"title":"Color#divide","link":"<a href=\"Color.html#divide\">Color &rtrif; divide</a>"},{"title":"Color#lerp","link":"<a href=\"Color.html#lerp\">Color &rtrif; lerp</a>"},{"title":"Color#multiply","link":"<a href=\"Color.html#multiply\">Color &rtrif; multiply</a>"},{"title":"Color#mutate","link":"<a href=\"Color.html#mutate\">Color &rtrif; mutate</a>"},{"title":"Color#rgba","link":"<a href=\"Color.html#rgba\">Color &rtrif; rgba</a>"},{"title":"Color#rgbaInt","link":"<a href=\"Color.html#rgbaInt\">Color &rtrif; rgbaInt</a>"},{"title":"Color#scale","link":"<a href=\"Color.html#scale\">Color &rtrif; scale</a>"},{"title":"Color#setHSLA","link":"<a href=\"Color.html#setHSLA\">Color &rtrif; setHSLA</a>"},{"title":"Color#subtract","link":"<a href=\"Color.html#subtract\">Color &rtrif; subtract</a>"},{"title":"EngineObject","link":"<a href=\"EngineObject.html\">EngineObject</a>"},{"title":"EngineObject#addChild","link":"<a href=\"EngineObject.html#addChild\">EngineObject &rtrif; addChild</a>"},{"title":"EngineObject#applyAcceleration","link":"<a href=\"EngineObject.html#applyAcceleration\">EngineObject &rtrif; applyAcceleration</a>"},{"title":"EngineObject#applyForce","link":"<a href=\"EngineObject.html#applyForce\">EngineObject &rtrif; applyForce</a>"},{"title":"EngineObject#collideWithObject","link":"<a href=\"EngineObject.html#collideWithObject\">EngineObject &rtrif; collideWithObject</a>"},{"title":"EngineObject#collideWithTile","link":"<a href=\"EngineObject.html#collideWithTile\">EngineObject &rtrif; collideWithTile</a>"},{"title":"EngineObject#collideWithTileRaycast","link":"<a href=\"EngineObject.html#collideWithTileRaycast\">EngineObject &rtrif; collideWithTileRaycast</a>"},{"title":"EngineObject#destroy","link":"<a href=\"EngineObject.html#destroy\">EngineObject &rtrif; destroy</a>"},{"title":"EngineObject#getAliveTime","link":"<a href=\"EngineObject.html#getAliveTime\">EngineObject &rtrif; getAliveTime</a>"},{"title":"EngineObject#getMirrorSign","link":"<a href=\"EngineObject.html#getMirrorSign\">EngineObject &rtrif; getMirrorSign</a>"},{"title":"EngineObject#removeChild","link":"<a href=\"EngineObject.html#removeChild\">EngineObject &rtrif; removeChild</a>"},{"title":"EngineObject#render","link":"<a href=\"EngineObject.html#render\">EngineObject &rtrif; render</a>"},{"title":"EngineObject#setCollision","link":"<a href=\"EngineObject.html#setCollision\">EngineObject &rtrif; setCollision</a>"},{"title":"EngineObject#update","link":"<a href=\"EngineObject.html#update\">EngineObject &rtrif; update</a>"},{"title":"Medal","link":"<a href=\"Medal.html\">Medal</a>"},{"title":"Medal#render","link":"<a href=\"Medal.html#render\">Medal &rtrif; render</a>"},{"title":"Medal#renderIcon","link":"<a href=\"Medal.html#renderIcon\">Medal &rtrif; renderIcon</a>"},{"title":"Medal#unlock","link":"<a href=\"Medal.html#unlock\">Medal &rtrif; unlock</a>"},{"title":"Music","link":"<a href=\"Music.html\">Music</a>"},{"title":"Music#play","link":"<a href=\"Music.html#play\">Music &rtrif; play</a>"},{"title":"Newgrounds","link":"<a href=\"Newgrounds.html\">Newgrounds</a>"},{"title":"Newgrounds#call","link":"<a href=\"Newgrounds.html#call\">Newgrounds &rtrif; call</a>"},{"title":"Newgrounds#getScores","link":"<a href=\"Newgrounds.html#getScores\">Newgrounds &rtrif; getScores</a>"},{"title":"Newgrounds#logView","link":"<a href=\"Newgrounds.html#logView\">Newgrounds &rtrif; logView</a>"},{"title":"Newgrounds#postScore","link":"<a href=\"Newgrounds.html#postScore\">Newgrounds &rtrif; postScore</a>"},{"title":"Newgrounds#unlockMedal","link":"<a href=\"Newgrounds.html#unlockMedal\">Newgrounds &rtrif; unlockMedal</a>"},{"title":"Particle","link":"<a href=\"Particle.html\">Particle</a>"},{"title":"Particle#addChild","link":"<a href=\"Particle.html#addChild\">Particle &rtrif; addChild</a>"},{"title":"Particle#applyAcceleration","link":"<a href=\"Particle.html#applyAcceleration\">Particle &rtrif; applyAcceleration</a>"},{"title":"Particle#applyForce","link":"<a href=\"Particle.html#applyForce\">Particle &rtrif; applyForce</a>"},{"title":"Particle#collideWithObject","link":"<a href=\"Particle.html#collideWithObject\">Particle &rtrif; collideWithObject</a>"},{"title":"Particle#collideWithTile","link":"<a href=\"Particle.html#collideWithTile\">Particle &rtrif; collideWithTile</a>"},{"title":"Particle#collideWithTileRaycast","link":"<a href=\"Particle.html#collideWithTileRaycast\">Particle &rtrif; collideWithTileRaycast</a>"},{"title":"Particle#destroy","link":"<a href=\"Particle.html#destroy\">Particle &rtrif; destroy</a>"},{"title":"Particle#getAliveTime","link":"<a href=\"Particle.html#getAliveTime\">Particle &rtrif; getAliveTime</a>"},{"title":"Particle#getMirrorSign","link":"<a href=\"Particle.html#getMirrorSign\">Particle &rtrif; getMirrorSign</a>"},{"title":"Particle#removeChild","link":"<a href=\"Particle.html#removeChild\">Particle &rtrif; removeChild</a>"},{"title":"Particle#render","link":"<a href=\"Particle.html#render\">Particle &rtrif; render</a>"},{"title":"Particle#setCollision","link":"<a href=\"Particle.html#setCollision\">Particle &rtrif; setCollision</a>"},{"title":"Particle#update","link":"<a href=\"Particle.html#update\">Particle &rtrif; update</a>"},{"title":"ParticleEmitter","link":"<a href=\"ParticleEmitter.html\">ParticleEmitter</a>"},{"title":"ParticleEmitter#addChild","link":"<a href=\"ParticleEmitter.html#addChild\">ParticleEmitter &rtrif; addChild</a>"},{"title":"ParticleEmitter#applyAcceleration","link":"<a href=\"ParticleEmitter.html#applyAcceleration\">ParticleEmitter &rtrif; applyAcceleration</a>"},{"title":"ParticleEmitter#applyForce","link":"<a href=\"ParticleEmitter.html#applyForce\">ParticleEmitter &rtrif; applyForce</a>"},{"title":"ParticleEmitter#collideWithObject","link":"<a href=\"ParticleEmitter.html#collideWithObject\">ParticleEmitter &rtrif; collideWithObject</a>"},{"title":"ParticleEmitter#collideWithTile","link":"<a href=\"ParticleEmitter.html#collideWithTile\">ParticleEmitter &rtrif; collideWithTile</a>"},{"title":"ParticleEmitter#collideWithTileRaycast","link":"<a href=\"ParticleEmitter.html#collideWithTileRaycast\">ParticleEmitter &rtrif; collideWithTileRaycast</a>"},{"title":"ParticleEmitter#destroy","link":"<a href=\"ParticleEmitter.html#destroy\">ParticleEmitter &rtrif; destroy</a>"},{"title":"ParticleEmitter#emitParticle","link":"<a href=\"ParticleEmitter.html#emitParticle\">ParticleEmitter &rtrif; emitParticle</a>"},{"title":"ParticleEmitter#getAliveTime","link":"<a href=\"ParticleEmitter.html#getAliveTime\">ParticleEmitter &rtrif; getAliveTime</a>"},{"title":"ParticleEmitter#getMirrorSign","link":"<a href=\"ParticleEmitter.html#getMirrorSign\">ParticleEmitter &rtrif; getMirrorSign</a>"},{"title":"ParticleEmitter#removeChild","link":"<a href=\"ParticleEmitter.html#removeChild\">ParticleEmitter &rtrif; removeChild</a>"},{"title":"ParticleEmitter#render","link":"<a href=\"ParticleEmitter.html#render\">ParticleEmitter &rtrif; render</a>"},{"title":"ParticleEmitter#setCollision","link":"<a href=\"ParticleEmitter.html#setCollision\">ParticleEmitter &rtrif; setCollision</a>"},{"title":"ParticleEmitter#update","link":"<a href=\"ParticleEmitter.html#update\">ParticleEmitter &rtrif; update</a>"},{"title":"Sound","link":"<a href=\"Sound.html\">Sound</a>"},{"title":"Sound#play","link":"<a href=\"Sound.html#play\">Sound &rtrif; play</a>"},{"title":"Sound#playNote","link":"<a href=\"Sound.html#playNote\">Sound &rtrif; playNote</a>"},{"title":"TileLayer","link":"<a href=\"TileLayer.html\">TileLayer</a>"},{"title":"TileLayer#addChild","link":"<a href=\"TileLayer.html#addChild\">TileLayer &rtrif; addChild</a>"},{"title":"TileLayer#applyAcceleration","link":"<a href=\"TileLayer.html#applyAcceleration\">TileLayer &rtrif; applyAcceleration</a>"},{"title":"TileLayer#applyForce","link":"<a href=\"TileLayer.html#applyForce\">TileLayer &rtrif; applyForce</a>"},{"title":"TileLayer#collideWithObject","link":"<a href=\"TileLayer.html#collideWithObject\">TileLayer &rtrif; collideWithObject</a>"},{"title":"TileLayer#collideWithTile","link":"<a href=\"TileLayer.html#collideWithTile\">TileLayer &rtrif; collideWithTile</a>"},{"title":"TileLayer#collideWithTileRaycast","link":"<a href=\"TileLayer.html#collideWithTileRaycast\">TileLayer &rtrif; collideWithTileRaycast</a>"},{"title":"TileLayer#destroy","link":"<a href=\"TileLayer.html#destroy\">TileLayer &rtrif; destroy</a>"},{"title":"TileLayer#drawAllTileData","link":"<a href=\"TileLayer.html#drawAllTileData\">TileLayer &rtrif; drawAllTileData</a>"},{"title":"TileLayer#drawCanvas2D","link":"<a href=\"TileLayer.html#drawCanvas2D\">TileLayer &rtrif; drawCanvas2D</a>"},{"title":"TileLayer#drawRect","link":"<a href=\"TileLayer.html#drawRect\">TileLayer &rtrif; drawRect</a>"},{"title":"TileLayer#drawTile","link":"<a href=\"TileLayer.html#drawTile\">TileLayer &rtrif; drawTile</a>"},{"title":"TileLayer#drawTileData","link":"<a href=\"TileLayer.html#drawTileData\">TileLayer &rtrif; drawTileData</a>"},{"title":"TileLayer#getAliveTime","link":"<a href=\"TileLayer.html#getAliveTime\">TileLayer &rtrif; getAliveTime</a>"},{"title":"TileLayer#getData","link":"<a href=\"TileLayer.html#getData\">TileLayer &rtrif; getData</a>"},{"title":"TileLayer#getMirrorSign","link":"<a href=\"TileLayer.html#getMirrorSign\">TileLayer &rtrif; getMirrorSign</a>"},{"title":"TileLayer#redraw","link":"<a href=\"TileLayer.html#redraw\">TileLayer &rtrif; redraw</a>"},{"title":"TileLayer#redrawEnd","link":"<a href=\"TileLayer.html#redrawEnd\">TileLayer &rtrif; redrawEnd</a>"},{"title":"TileLayer#redrawStart","link":"<a href=\"TileLayer.html#redrawStart\">TileLayer &rtrif; redrawStart</a>"},{"title":"TileLayer#removeChild","link":"<a href=\"TileLayer.html#removeChild\">TileLayer &rtrif; removeChild</a>"},{"title":"TileLayer#render","link":"<a href=\"TileLayer.html#render\">TileLayer &rtrif; render</a>"},{"title":"TileLayer#setCollision","link":"<a href=\"TileLayer.html#setCollision\">TileLayer &rtrif; setCollision</a>"},{"title":"TileLayer#setData","link":"<a href=\"TileLayer.html#setData\">TileLayer &rtrif; setData</a>"},{"title":"TileLayer#update","link":"<a href=\"TileLayer.html#update\">TileLayer &rtrif; update</a>"},{"title":"TileLayerData","link":"<a href=\"TileLayerData.html\">TileLayerData</a>"},{"title":"TileLayerData#clear","link":"<a href=\"TileLayerData.html#clear\">TileLayerData &rtrif; clear</a>"},{"title":"Timer","link":"<a href=\"Timer.html\">Timer</a>"},{"title":"Timer#active","link":"<a href=\"Timer.html#active\">Timer &rtrif; active</a>"},{"title":"Timer#elapsed","link":"<a href=\"Timer.html#elapsed\">Timer &rtrif; elapsed</a>"},{"title":"Timer#get","link":"<a href=\"Timer.html#get\">Timer &rtrif; get</a>"},{"title":"Timer#getPercent","link":"<a href=\"Timer.html#getPercent\">Timer &rtrif; getPercent</a>"},{"title":"Timer#isSet","link":"<a href=\"Timer.html#isSet\">Timer &rtrif; isSet</a>"},{"title":"Timer#set","link":"<a href=\"Timer.html#set\">Timer &rtrif; set</a>"},{"title":"Timer#unset","link":"<a href=\"Timer.html#unset\">Timer &rtrif; unset</a>"},{"title":"Vector2","link":"<a href=\"Vector2.html\">Vector2</a>"},{"title":"Vector2#add","link":"<a href=\"Vector2.html#add\">Vector2 &rtrif; add</a>"},{"title":"Vector2#angle","link":"<a href=\"Vector2.html#angle\">Vector2 &rtrif; angle</a>"},{"title":"Vector2#area","link":"<a href=\"Vector2.html#area\">Vector2 &rtrif; area</a>"},{"title":"Vector2#arrayCheck","link":"<a href=\"Vector2.html#arrayCheck\">Vector2 &rtrif; arrayCheck</a>"},{"title":"Vector2#clampLength","link":"<a href=\"Vector2.html#clampLength\">Vector2 &rtrif; clampLength</a>"},{"title":"Vector2#copy","link":"<a href=\"Vector2.html#copy\">Vector2 &rtrif; copy</a>"},{"title":"Vector2#cross","link":"<a href=\"Vector2.html#cross\">Vector2 &rtrif; cross</a>"},{"title":"Vector2#direction","link":"<a href=\"Vector2.html#direction\">Vector2 &rtrif; direction</a>"},{"title":"Vector2#distance","link":"<a href=\"Vector2.html#distance\">Vector2 &rtrif; distance</a>"},{"title":"Vector2#distanceSquared","link":"<a href=\"Vector2.html#distanceSquared\">Vector2 &rtrif; distanceSquared</a>"},{"title":"Vector2#divide","link":"<a href=\"Vector2.html#divide\">Vector2 &rtrif; divide</a>"},{"title":"Vector2#dot","link":"<a href=\"Vector2.html#dot\">Vector2 &rtrif; dot</a>"},{"title":"Vector2#flip","link":"<a href=\"Vector2.html#flip\">Vector2 &rtrif; flip</a>"},{"title":"Vector2#floor","link":"<a href=\"Vector2.html#floor\">Vector2 &rtrif; floor</a>"},{"title":"Vector2#invert","link":"<a href=\"Vector2.html#invert\">Vector2 &rtrif; invert</a>"},{"title":"Vector2#length","link":"<a href=\"Vector2.html#length\">Vector2 &rtrif; length</a>"},{"title":"Vector2#lengthSquared","link":"<a href=\"Vector2.html#lengthSquared\">Vector2 &rtrif; lengthSquared</a>"},{"title":"Vector2#lerp","link":"<a href=\"Vector2.html#lerp\">Vector2 &rtrif; lerp</a>"},{"title":"Vector2#multiply","link":"<a href=\"Vector2.html#multiply\">Vector2 &rtrif; multiply</a>"},{"title":"Vector2#normalize","link":"<a href=\"Vector2.html#normalize\">Vector2 &rtrif; normalize</a>"},{"title":"Vector2#rotate","link":"<a href=\"Vector2.html#rotate\">Vector2 &rtrif; rotate</a>"},{"title":"Vector2#scale","link":"<a href=\"Vector2.html#scale\">Vector2 &rtrif; scale</a>"},{"title":"Vector2#setAngle","link":"<a href=\"Vector2.html#setAngle\">Vector2 &rtrif; setAngle</a>"},{"title":"Vector2#subtract","link":"<a href=\"Vector2.html#subtract\">Vector2 &rtrif; subtract</a>"},{"title":"Audio","link":"<a href=\"Audio.html\">Audio</a>"},{"title":"Audio.getNoteFrequency","link":"<a href=\"Audio.html#.getNoteFrequency\">Audio.getNoteFrequency &rtrif; undefined</a>"},{"title":"Audio.playAudioFile","link":"<a href=\"Audio.html#.playAudioFile\">Audio.playAudioFile &rtrif; undefined</a>"},{"title":"Audio.playSamples","link":"<a href=\"Audio.html#.playSamples\">Audio.playSamples &rtrif; undefined</a>"},{"title":"Audio.speak","link":"<a href=\"Audio.html#.speak\">Audio.speak &rtrif; undefined</a>"},{"title":"Audio.stopSpeech","link":"<a href=\"Audio.html#.stopSpeech\">Audio.stopSpeech &rtrif; undefined</a>"},{"title":"Audio.zzfx","link":"<a href=\"Audio.html#.zzfx\">Audio.zzfx &rtrif; undefined</a>"},{"title":"Audio.zzfxG","link":"<a href=\"Audio.html#.zzfxG\">Audio.zzfxG &rtrif; undefined</a>"},{"title":"Audio.zzfxM","link":"<a href=\"Audio.html#.zzfxM\">Audio.zzfxM &rtrif; undefined</a>"},{"title":"Debug","link":"<a href=\"Debug.html\">Debug</a>"},{"title":"Debug.debugAABB","link":"<a href=\"Debug.html#.debugAABB\">Debug.debugAABB &rtrif; undefined</a>"},{"title":"Debug.debugCircle","link":"<a href=\"Debug.html#.debugCircle\">Debug.debugCircle &rtrif; undefined</a>"},{"title":"Debug.debugClear","link":"<a href=\"Debug.html#.debugClear\">Debug.debugClear &rtrif; undefined</a>"},{"title":"Debug.debugLine","link":"<a href=\"Debug.html#.debugLine\">Debug.debugLine &rtrif; undefined</a>"},{"title":"Debug.debugPoint","link":"<a href=\"Debug.html#.debugPoint\">Debug.debugPoint &rtrif; undefined</a>"},{"title":"Debug.debugRect","link":"<a href=\"Debug.html#.debugRect\">Debug.debugRect &rtrif; undefined</a>"},{"title":"Debug.debugSaveCanvas","link":"<a href=\"Debug.html#.debugSaveCanvas\">Debug.debugSaveCanvas &rtrif; undefined</a>"},{"title":"Debug.debugText","link":"<a href=\"Debug.html#.debugText\">Debug.debugText &rtrif; undefined</a>"},{"title":"Draw","link":"<a href=\"Draw.html\">Draw</a>"},{"title":"Draw.drawCanvas2D","link":"<a href=\"Draw.html#.drawCanvas2D\">Draw.drawCanvas2D &rtrif; undefined</a>"},{"title":"Draw.drawLine","link":"<a href=\"Draw.html#.drawLine\">Draw.drawLine &rtrif; undefined</a>"},{"title":"Draw.drawRect","link":"<a href=\"Draw.html#.drawRect\">Draw.drawRect &rtrif; undefined</a>"},{"title":"Draw.drawRectScreenSpace","link":"<a href=\"Draw.html#.drawRectScreenSpace\">Draw.drawRectScreenSpace &rtrif; undefined</a>"},{"title":"Draw.drawText","link":"<a href=\"Draw.html#.drawText\">Draw.drawText &rtrif; undefined</a>"},{"title":"Draw.drawTile","link":"<a href=\"Draw.html#.drawTile\">Draw.drawTile &rtrif; undefined</a>"},{"title":"Draw.drawTileScreenSpace","link":"<a href=\"Draw.html#.drawTileScreenSpace\">Draw.drawTileScreenSpace &rtrif; undefined</a>"},{"title":"Draw.isFullscreen","link":"<a href=\"Draw.html#.isFullscreen\">Draw.isFullscreen &rtrif; undefined</a>"},{"title":"Draw.screenToWorld","link":"<a href=\"Draw.html#.screenToWorld\">Draw.screenToWorld &rtrif; undefined</a>"},{"title":"Draw.setBlendMode","link":"<a href=\"Draw.html#.setBlendMode\">Draw.setBlendMode &rtrif; undefined</a>"},{"title":"Draw.toggleFullscreen","link":"<a href=\"Draw.html#.toggleFullscreen\">Draw.toggleFullscreen &rtrif; undefined</a>"},{"title":"Draw.worldToScreen","link":"<a href=\"Draw.html#.worldToScreen\">Draw.worldToScreen &rtrif; undefined</a>"},{"title":"Input","link":"<a href=\"Input.html\">Input</a>"},{"title":"Input.clearInput","link":"<a href=\"Input.html#.clearInput\">Input.clearInput &rtrif; undefined</a>"},{"title":"Input.gamepadIsDown","link":"<a href=\"Input.html#.gamepadIsDown\">Input.gamepadIsDown &rtrif; undefined</a>"},{"title":"Input.gamepadStick","link":"<a href=\"Input.html#.gamepadStick\">Input.gamepadStick &rtrif; undefined</a>"},{"title":"Input.gamepadWasPressed","link":"<a href=\"Input.html#.gamepadWasPressed\">Input.gamepadWasPressed &rtrif; undefined</a>"},{"title":"Input.gamepadWasReleased","link":"<a href=\"Input.html#.gamepadWasReleased\">Input.gamepadWasReleased &rtrif; undefined</a>"},{"title":"Input.keyIsDown","link":"<a href=\"Input.html#.keyIsDown\">Input.keyIsDown &rtrif; undefined</a>"},{"title":"Input.keyWasPressed","link":"<a href=\"Input.html#.keyWasPressed\">Input.keyWasPressed &rtrif; undefined</a>"},{"title":"Input.keyWasReleased","link":"<a href=\"Input.html#.keyWasReleased\">Input.keyWasReleased &rtrif; undefined</a>"},{"title":"Medals","link":"<a href=\"Medals.html\">Medals</a>"},{"title":"Medals.medalsInit","link":"<a href=\"Medals.html#.medalsInit\">Medals.medalsInit &rtrif; undefined</a>"},{"title":"Random","link":"<a href=\"Random.html\">Random</a>"},{"title":"Random.rand","link":"<a href=\"Random.html#.rand\">Random.rand &rtrif; undefined</a>"},{"title":"Random.randColor","link":"<a href=\"Random.html#.randColor\">Random.randColor &rtrif; undefined</a>"},{"title":"Random.randInCircle","link":"<a href=\"Random.html#.randInCircle\">Random.randInCircle &rtrif; undefined</a>"},{"title":"Random.randInt","link":"<a href=\"Random.html#.randInt\">Random.randInt &rtrif; undefined</a>"},{"title":"Random.randSeeded","link":"<a href=\"Random.html#.randSeeded\">Random.randSeeded &rtrif; undefined</a>"},{"title":"Random.randSign","link":"<a href=\"Random.html#.randSign\">Random.randSign &rtrif; undefined</a>"},{"title":"Random.randVector","link":"<a href=\"Random.html#.randVector\">Random.randVector &rtrif; undefined</a>"},{"title":"Settings","link":"<a href=\"Settings.html\">Settings</a>"},{"title":"TileCollision","link":"<a href=\"TileCollision.html\">TileCollision</a>"},{"title":"TileCollision.getTileCollisionData","link":"<a href=\"TileCollision.html#.getTileCollisionData\">TileCollision.getTileCollisionData &rtrif; undefined</a>"},{"title":"TileCollision.initTileCollision","link":"<a href=\"TileCollision.html#.initTileCollision\">TileCollision.initTileCollision &rtrif; undefined</a>"},{"title":"TileCollision.setTileCollisionData","link":"<a href=\"TileCollision.html#.setTileCollisionData\">TileCollision.setTileCollisionData &rtrif; undefined</a>"},{"title":"TileCollision.tileCollisionRaycast","link":"<a href=\"TileCollision.html#.tileCollisionRaycast\">TileCollision.tileCollisionRaycast &rtrif; undefined</a>"},{"title":"TileCollision.tileCollisionTest","link":"<a href=\"TileCollision.html#.tileCollisionTest\">TileCollision.tileCollisionTest &rtrif; undefined</a>"},{"title":"Utilities","link":"<a href=\"Utilities.html\">Utilities</a>"},{"title":"Utilities.abs","link":"<a href=\"Utilities.html#.abs\">Utilities.abs &rtrif; undefined</a>"},{"title":"Utilities.clamp","link":"<a href=\"Utilities.html#.clamp\">Utilities.clamp &rtrif; undefined</a>"},{"title":"Utilities.formatTime","link":"<a href=\"Utilities.html#.formatTime\">Utilities.formatTime &rtrif; undefined</a>"},{"title":"Utilities.isOverlapping","link":"<a href=\"Utilities.html#.isOverlapping\">Utilities.isOverlapping &rtrif; undefined</a>"},{"title":"Utilities.lerp","link":"<a href=\"Utilities.html#.lerp\">Utilities.lerp &rtrif; undefined</a>"},{"title":"Utilities.max","link":"<a href=\"Utilities.html#.max\">Utilities.max &rtrif; undefined</a>"},{"title":"Utilities.min","link":"<a href=\"Utilities.html#.min\">Utilities.min &rtrif; undefined</a>"},{"title":"Utilities.mod","link":"<a href=\"Utilities.html#.mod\">Utilities.mod &rtrif; undefined</a>"},{"title":"Utilities.nearestPowerOfTwo","link":"<a href=\"Utilities.html#.nearestPowerOfTwo\">Utilities.nearestPowerOfTwo &rtrif; undefined</a>"},{"title":"Utilities.percent","link":"<a href=\"Utilities.html#.percent\">Utilities.percent &rtrif; undefined</a>"},{"title":"Utilities.sign","link":"<a href=\"Utilities.html#.sign\">Utilities.sign &rtrif; undefined</a>"},{"title":"Utilities.smoothStep","link":"<a href=\"Utilities.html#.smoothStep\">Utilities.smoothStep &rtrif; undefined</a>"},{"title":"Utilities.vec2","link":"<a href=\"Utilities.html#.vec2\">Utilities.vec2 &rtrif; undefined</a>"},{"title":"Utilities.wave","link":"<a href=\"Utilities.html#.wave\">Utilities.wave &rtrif; undefined</a>"},{"title":"WebGL","link":"<a href=\"WebGL.html\">WebGL</a>"},{"title":"WebGL.glCompileShader","link":"<a href=\"WebGL.html#.glCompileShader\">WebGL.glCompileShader &rtrif; undefined</a>"},{"title":"WebGL.glCopyToContext","link":"<a href=\"WebGL.html#.glCopyToContext\">WebGL.glCopyToContext &rtrif; undefined</a>"},{"title":"WebGL.glCreateBuffer","link":"<a href=\"WebGL.html#.glCreateBuffer\">WebGL.glCreateBuffer &rtrif; undefined</a>"},{"title":"WebGL.glCreateProgram","link":"<a href=\"WebGL.html#.glCreateProgram\">WebGL.glCreateProgram &rtrif; undefined</a>"},{"title":"WebGL.glCreateTexture","link":"<a href=\"WebGL.html#.glCreateTexture\">WebGL.glCreateTexture &rtrif; undefined</a>"},{"title":"WebGL.glDraw","link":"<a href=\"WebGL.html#.glDraw\">WebGL.glDraw &rtrif; undefined</a>"},{"title":"WebGL.glFlush","link":"<a href=\"WebGL.html#.glFlush\">WebGL.glFlush &rtrif; undefined</a>"},{"title":"WebGL.glSetBlendMode","link":"<a href=\"WebGL.html#.glSetBlendMode\">WebGL.glSetBlendMode &rtrif; undefined</a>"},{"title":"WebGL.glSetTexture","link":"<a href=\"WebGL.html#.glSetTexture\">WebGL.glSetTexture &rtrif; undefined</a>"},{"title":"engineCollideObjects","link":"<a href=\"global.html#engineCollideObjects\">engineCollideObjects</a>"},{"title":"engineInit","link":"<a href=\"global.html#engineInit\">engineInit</a>"},{"title":"engineName","link":"<a href=\"global.html#engineName\">engineName</a>"},{"title":"engineObjects","link":"<a href=\"global.html#engineObjects\">engineObjects</a>"},{"title":"engineObjectsCallback","link":"<a href=\"global.html#engineObjectsCallback\">engineObjectsCallback</a>"},{"title":"engineObjectsDestroy","link":"<a href=\"global.html#engineObjectsDestroy\">engineObjectsDestroy</a>"},{"title":"engineObjectsUpdate","link":"<a href=\"global.html#engineObjectsUpdate\">engineObjectsUpdate</a>"},{"title":"engineVersion","link":"<a href=\"global.html#engineVersion\">engineVersion</a>"},{"title":"FPS","link":"<a href=\"global.html#FPS\">FPS</a>"},{"title":"frame","link":"<a href=\"global.html#frame\">frame</a>"},{"title":"paused","link":"<a href=\"global.html#paused\">paused</a>"},{"title":"time","link":"<a href=\"global.html#time\">time</a>"},{"title":"timeDelta","link":"<a href=\"global.html#timeDelta\">timeDelta</a>"},{"title":"timeReal","link":"<a href=\"global.html#timeReal\">timeReal</a>"}];
709
+ var options =
710
+ setupSearch(list, options)
711
+ </script>
712
+
713
+
714
+
715
+
716
+
717
+
718
+
719
+
720
+
721
+
722
+
723
+ </body>
724
+
725
+ </html>