littlejsengine 1.18.28 → 1.19.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/FAQ.md +5 -0
- package/README.md +207 -199
- package/dist/littlejs.d.ts +2099 -48
- package/dist/littlejs.esm.js +16251 -10315
- package/dist/littlejs.esm.min.js +13 -1
- package/dist/littlejs.js +15747 -9888
- package/dist/littlejs.min.js +13 -1
- package/dist/littlejs.release.js +15719 -9867
- package/package.json +1 -1
- package/plugins/audioEffects.js +371 -0
- package/plugins/lightSystem.js +5 -3
- package/plugins/math3d.js +870 -0
- package/plugins/medalSystem.js +280 -280
- package/plugins/pluginExport.js +181 -115
- package/plugins/postProcess.js +241 -166
- package/plugins/render3d.js +4006 -0
- package/plugins/textureSheet.js +458 -458
- package/plugins/threejs.js +6 -1
- package/plugins/tweenSystem.js +528 -526
- package/plugins/zzfxm.js +159 -166
- package/src/engine.js +172 -137
- package/src/engineAudio.js +918 -775
- package/src/engineBuild.mjs +3 -0
- package/src/engineDebug.js +15 -8
- package/src/engineDraw.js +1672 -1510
- package/src/engineExport.js +407 -396
- package/src/engineInput.js +1 -1
- package/src/engineLogo.js +4 -3
- package/src/engineMath.js +69 -0
- package/src/engineObject.js +560 -551
- package/src/engineSettings.js +759 -725
- package/src/engineTileLayer.js +3 -3
- package/src/engineUtilities.js +13 -0
- package/src/engineWebGL.js +1005 -941
package/src/engineBuild.mjs
CHANGED
|
@@ -43,12 +43,15 @@ const enginePluginFiles =
|
|
|
43
43
|
`${PLUGIN_FOLDER}/postProcess.js`,
|
|
44
44
|
`${PLUGIN_FOLDER}/lightSystem.js`,
|
|
45
45
|
`${PLUGIN_FOLDER}/zzfxm.js`,
|
|
46
|
+
`${PLUGIN_FOLDER}/audioEffects.js`,
|
|
46
47
|
`${PLUGIN_FOLDER}/uiSystem.js`,
|
|
47
48
|
`${PLUGIN_FOLDER}/box2d.js`,
|
|
48
49
|
`${PLUGIN_FOLDER}/drawUtilities.js`,
|
|
49
50
|
`${PLUGIN_FOLDER}/textureSheet.js`,
|
|
50
51
|
`${PLUGIN_FOLDER}/tweenSystem.js`,
|
|
51
52
|
`${PLUGIN_FOLDER}/pathFinder.js`,
|
|
53
|
+
`${PLUGIN_FOLDER}/math3d.js`,
|
|
54
|
+
`${PLUGIN_FOLDER}/render3d.js`,
|
|
52
55
|
`${PLUGIN_FOLDER}/threejs.js`,
|
|
53
56
|
];
|
|
54
57
|
const engineExtraFiles =
|
package/src/engineDebug.js
CHANGED
|
@@ -574,9 +574,9 @@ function debugRender()
|
|
|
574
574
|
+ savedDrawCount + ' / ' + savedPrimitiveCount + ' / '
|
|
575
575
|
+ engineObjects.length + ' / ' + averageFPS.toFixed(1)
|
|
576
576
|
+ (glEnable ? ' GL' : ' 2D') ;
|
|
577
|
-
mainContext.fillText(text,
|
|
577
|
+
mainContext.fillText(text, mainCanvasSize.x-3, 3);
|
|
578
578
|
mainContext.fillStyle = '#fff';
|
|
579
|
-
mainContext.fillText(text,
|
|
579
|
+
mainContext.fillText(text, mainCanvasSize.x-2, 2);
|
|
580
580
|
}
|
|
581
581
|
}
|
|
582
582
|
|
|
@@ -637,7 +637,7 @@ function debugVideoCaptureStart()
|
|
|
637
637
|
saveDataURL(url, 'capture.webm', 1e3);
|
|
638
638
|
};
|
|
639
639
|
|
|
640
|
-
let audioStreamDestination, silentAudioSource;
|
|
640
|
+
let audioStreamDestination, silentAudioSource, audioTapNode;
|
|
641
641
|
if (soundEnable)
|
|
642
642
|
{
|
|
643
643
|
// create silent audio source
|
|
@@ -646,9 +646,11 @@ function debugVideoCaptureStart()
|
|
|
646
646
|
silentAudioSource.connect(audioMasterGain);
|
|
647
647
|
silentAudioSource.start();
|
|
648
648
|
|
|
649
|
-
//
|
|
649
|
+
// tap the end of the master chain so a master effect is in the recording
|
|
650
|
+
// (a master effect swapped mid-capture drops the tap, the rest records silent)
|
|
650
651
|
audioStreamDestination = audioContext.createMediaStreamDestination();
|
|
651
|
-
audioMasterGain
|
|
652
|
+
audioTapNode = audioMasterEffectOutput || audioMasterGain;
|
|
653
|
+
audioTapNode.connect(audioStreamDestination);
|
|
652
654
|
for (const track of audioStreamDestination.stream.getAudioTracks())
|
|
653
655
|
stream.addTrack(track); // add audio tracks to capture stream
|
|
654
656
|
}
|
|
@@ -659,7 +661,7 @@ function debugVideoCaptureStart()
|
|
|
659
661
|
{
|
|
660
662
|
LOG('Video capture not supported in this browser!');
|
|
661
663
|
silentAudioSource?.stop();
|
|
662
|
-
audioStreamDestination &&
|
|
664
|
+
audioStreamDestination && audioTapNode.disconnect(audioStreamDestination);
|
|
663
665
|
return;
|
|
664
666
|
}
|
|
665
667
|
|
|
@@ -672,7 +674,8 @@ function debugVideoCaptureStart()
|
|
|
672
674
|
captureTimer,
|
|
673
675
|
videoTrack,
|
|
674
676
|
silentAudioSource,
|
|
675
|
-
audioStreamDestination
|
|
677
|
+
audioStreamDestination,
|
|
678
|
+
audioTapNode
|
|
676
679
|
};
|
|
677
680
|
}
|
|
678
681
|
|
|
@@ -689,7 +692,11 @@ function debugVideoCaptureStop()
|
|
|
689
692
|
debugVideoCapture.mediaRecorder?.stop();
|
|
690
693
|
debugVideoCapture.videoTrack?.stop();
|
|
691
694
|
if (debugVideoCapture.audioStreamDestination)
|
|
692
|
-
|
|
695
|
+
{
|
|
696
|
+
// the tap is already gone if the master effect changed during the capture
|
|
697
|
+
try { debugVideoCapture.audioTapNode.disconnect(debugVideoCapture.audioStreamDestination); }
|
|
698
|
+
catch { }
|
|
699
|
+
}
|
|
693
700
|
debugVideoCapture = undefined;
|
|
694
701
|
}
|
|
695
702
|
|