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