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/plugins/threejs.js
CHANGED
|
@@ -81,9 +81,14 @@ class ThreeJSPlugin
|
|
|
81
81
|
if (!this.renderer) return; // headless mode
|
|
82
82
|
|
|
83
83
|
// keep renderer size and css in sync with the LittleJS canvas
|
|
84
|
+
// mainCanvasSize is css pixels, three scales it by the pixel ratio
|
|
84
85
|
const threeCanvas = this.renderer.domElement;
|
|
85
|
-
|
|
86
|
+
const dpr = getCanvasPixelRatio();
|
|
87
|
+
const bufferSizeX = mainCanvasSize.x * dpr | 0;
|
|
88
|
+
const bufferSizeY = mainCanvasSize.y * dpr | 0;
|
|
89
|
+
if (threeCanvas.width != bufferSizeX || threeCanvas.height != bufferSizeY)
|
|
86
90
|
{
|
|
91
|
+
this.renderer.setPixelRatio(dpr);
|
|
87
92
|
this.renderer.setSize(mainCanvasSize.x, mainCanvasSize.y, false);
|
|
88
93
|
this.camera.aspect = mainCanvasSize.x / mainCanvasSize.y;
|
|
89
94
|
this.camera.updateProjectionMatrix();
|