melonjs 15.2.1 → 15.4.0
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 +1 -1
- package/dist/melonjs.mjs/_virtual/_commonjsHelpers.js +1 -1
- package/dist/melonjs.mjs/_virtual/earcut.js +1 -1
- package/dist/melonjs.mjs/_virtual/howler.js +1 -1
- package/dist/melonjs.mjs/_virtual/index.js +1 -1
- package/dist/melonjs.mjs/application/application.js +75 -23
- package/dist/melonjs.mjs/application/header.js +2 -2
- package/dist/melonjs.mjs/application/resize.js +13 -11
- package/dist/melonjs.mjs/application/settings.js +37 -1
- package/dist/melonjs.mjs/audio/audio.js +4 -6
- package/dist/melonjs.mjs/camera/camera2d.js +12 -14
- package/dist/melonjs.mjs/const.js +1 -1
- package/dist/melonjs.mjs/entity/entity.js +3 -4
- package/dist/melonjs.mjs/geometries/ellipse.js +26 -59
- package/dist/melonjs.mjs/geometries/line.js +18 -25
- package/dist/melonjs.mjs/geometries/path2d.js +16 -13
- package/dist/melonjs.mjs/geometries/point.js +8 -16
- package/dist/melonjs.mjs/geometries/poly.js +40 -97
- package/dist/melonjs.mjs/geometries/rectangle.js +37 -91
- package/dist/melonjs.mjs/geometries/roundrect.js +26 -35
- package/dist/melonjs.mjs/index.js +6 -6
- package/dist/melonjs.mjs/input/gamepad.js +1 -1
- package/dist/melonjs.mjs/input/input.js +1 -1
- package/dist/melonjs.mjs/input/keyboard.js +3 -3
- package/dist/melonjs.mjs/input/pointer.js +4 -4
- package/dist/melonjs.mjs/input/pointerevent.js +6 -7
- package/dist/melonjs.mjs/lang/console.js +1 -1
- package/dist/melonjs.mjs/lang/deprecated.js +2 -2
- package/dist/melonjs.mjs/level/level.js +1 -1
- package/dist/melonjs.mjs/level/tiled/TMXGroup.js +1 -1
- package/dist/melonjs.mjs/level/tiled/TMXLayer.js +16 -33
- package/dist/melonjs.mjs/level/tiled/TMXObject.js +3 -4
- package/dist/melonjs.mjs/level/tiled/TMXTile.js +4 -4
- package/dist/melonjs.mjs/level/tiled/TMXTileMap.js +3 -3
- package/dist/melonjs.mjs/level/tiled/TMXTileset.js +4 -7
- package/dist/melonjs.mjs/level/tiled/TMXTilesetGroup.js +2 -2
- package/dist/melonjs.mjs/level/tiled/TMXUtils.js +37 -47
- package/dist/melonjs.mjs/level/tiled/constants.js +1 -1
- package/dist/melonjs.mjs/level/tiled/renderer/TMXHexagonalRenderer.js +3 -3
- package/dist/melonjs.mjs/level/tiled/renderer/TMXIsometricRenderer.js +2 -2
- package/dist/melonjs.mjs/level/tiled/renderer/TMXOrthogonalRenderer.js +2 -2
- package/dist/melonjs.mjs/level/tiled/renderer/TMXRenderer.js +2 -2
- package/dist/melonjs.mjs/level/tiled/renderer/TMXStaggeredRenderer.js +2 -2
- package/dist/melonjs.mjs/level/tiled/renderer/autodetect.js +1 -1
- package/dist/melonjs.mjs/loader/cache.js +1 -1
- package/dist/melonjs.mjs/loader/loader.js +1 -1
- package/dist/melonjs.mjs/loader/loadingscreen.js +1 -1
- package/dist/melonjs.mjs/loader/melonjs_logo.png.js +1 -1
- package/dist/melonjs.mjs/loader/parser.js +4 -5
- package/dist/melonjs.mjs/loader/settings.js +1 -1
- package/dist/melonjs.mjs/math/color.js +5 -5
- package/dist/melonjs.mjs/math/math.js +1 -1
- package/dist/melonjs.mjs/math/matrix2.js +5 -59
- package/dist/melonjs.mjs/math/matrix3.js +82 -141
- package/dist/melonjs.mjs/math/observable_vector2.js +7 -7
- package/dist/melonjs.mjs/math/observable_vector3.js +5 -5
- package/dist/melonjs.mjs/math/vector2.js +7 -91
- package/dist/melonjs.mjs/math/vector3.js +6 -90
- package/dist/melonjs.mjs/node_modules/@teppeis/multimaps/dist/esm/arraymultimap.js +1 -1
- package/dist/melonjs.mjs/node_modules/@teppeis/multimaps/dist/esm/multimap.js +1 -1
- package/dist/melonjs.mjs/node_modules/earcut/src/earcut.js +1 -1
- package/dist/melonjs.mjs/node_modules/eventemitter3/index.js +1 -1
- package/dist/melonjs.mjs/node_modules/eventemitter3/index2.js +1 -1
- package/dist/melonjs.mjs/node_modules/howler/dist/howler.js +1 -1
- package/dist/melonjs.mjs/particles/emitter.js +2 -2
- package/dist/melonjs.mjs/particles/particle.js +2 -2
- package/dist/melonjs.mjs/particles/settings.js +1 -1
- package/dist/melonjs.mjs/physics/body.js +22 -20
- package/dist/melonjs.mjs/physics/bounds.js +27 -33
- package/dist/melonjs.mjs/physics/collision.js +5 -5
- package/dist/melonjs.mjs/physics/detector.js +10 -10
- package/dist/melonjs.mjs/physics/quadtree.js +5 -5
- package/dist/melonjs.mjs/physics/response.js +1 -1
- package/dist/melonjs.mjs/physics/sat.js +3 -4
- package/dist/melonjs.mjs/physics/world.js +6 -9
- package/dist/melonjs.mjs/plugin/plugin.js +3 -3
- package/dist/melonjs.mjs/renderable/collectable.js +2 -2
- package/dist/melonjs.mjs/renderable/colorlayer.js +4 -4
- package/dist/melonjs.mjs/renderable/container.js +25 -25
- package/dist/melonjs.mjs/renderable/draggable.js +1 -1
- package/dist/melonjs.mjs/renderable/dragndrop.js +1 -1
- package/dist/melonjs.mjs/renderable/imagelayer.js +4 -4
- package/dist/melonjs.mjs/renderable/light2d.js +3 -3
- package/dist/melonjs.mjs/renderable/nineslicesprite.js +2 -2
- package/dist/melonjs.mjs/renderable/renderable.js +31 -39
- package/dist/melonjs.mjs/renderable/sprite.js +3 -3
- package/dist/melonjs.mjs/renderable/text/bitmaptext.js +421 -0
- package/dist/melonjs.mjs/renderable/text/bitmaptextdata.js +195 -0
- package/dist/melonjs.mjs/renderable/text/glyph.js +65 -0
- package/dist/melonjs.mjs/renderable/text/text.js +422 -0
- package/dist/melonjs.mjs/renderable/text/textmetrics.js +175 -0
- package/dist/melonjs.mjs/renderable/text/textstyle.js +21 -0
- package/dist/melonjs.mjs/renderable/trigger.js +10 -10
- package/dist/melonjs.mjs/renderable/ui/uibaseelement.js +7 -7
- package/dist/melonjs.mjs/renderable/ui/uispriteelement.js +7 -7
- package/dist/melonjs.mjs/renderable/ui/uitextbutton.js +3 -3
- package/dist/melonjs.mjs/state/stage.js +13 -14
- package/dist/melonjs.mjs/state/state.js +4 -51
- package/dist/melonjs.mjs/system/device.js +51 -10
- package/dist/melonjs.mjs/system/dom.js +1 -1
- package/dist/melonjs.mjs/system/event.js +46 -2
- package/dist/melonjs.mjs/system/platform.js +18 -18
- package/dist/melonjs.mjs/system/pooling.js +10 -10
- package/dist/melonjs.mjs/system/save.js +1 -1
- package/dist/melonjs.mjs/system/timer.js +1 -1
- package/dist/melonjs.mjs/text/bitmaptext.js +1 -1
- package/dist/melonjs.mjs/text/bitmaptextdata.js +3 -6
- package/dist/melonjs.mjs/text/glyph.js +1 -1
- package/dist/melonjs.mjs/text/text.js +1 -1
- package/dist/melonjs.mjs/text/textmetrics.js +1 -1
- package/dist/melonjs.mjs/text/textstyle.js +1 -1
- package/dist/melonjs.mjs/tweens/easing.js +1 -1
- package/dist/melonjs.mjs/tweens/interpolation.js +1 -1
- package/dist/melonjs.mjs/tweens/tween.js +2 -2
- package/dist/melonjs.mjs/utils/agent.js +1 -1
- package/dist/melonjs.mjs/utils/array.js +1 -1
- package/dist/melonjs.mjs/utils/file.js +1 -1
- package/dist/melonjs.mjs/utils/function.js +2 -3
- package/dist/melonjs.mjs/utils/string.js +1 -1
- package/dist/melonjs.mjs/utils/utils.js +1 -1
- package/dist/melonjs.mjs/video/canvas/canvas_renderer.js +5 -18
- package/dist/melonjs.mjs/video/renderer.js +17 -30
- package/dist/melonjs.mjs/video/texture/atlas.js +13 -13
- package/dist/melonjs.mjs/video/texture/cache.js +1 -1
- package/dist/melonjs.mjs/video/texture/canvas_texture.js +15 -15
- package/dist/melonjs.mjs/video/utils/autodetect.js +1 -1
- package/dist/melonjs.mjs/video/video.js +5 -29
- package/dist/melonjs.mjs/video/webgl/buffer/vertex.js +3 -3
- package/dist/melonjs.mjs/video/webgl/compositors/compositor.js +13 -14
- package/dist/melonjs.mjs/video/webgl/compositors/primitive_compositor.js +5 -5
- package/dist/melonjs.mjs/video/webgl/compositors/quad_compositor.js +2 -3
- package/dist/melonjs.mjs/video/webgl/glshader.js +2 -2
- package/dist/melonjs.mjs/video/webgl/shaders/primitive.frag.js +1 -1
- package/dist/melonjs.mjs/video/webgl/shaders/primitive.vert.js +1 -1
- package/dist/melonjs.mjs/video/webgl/shaders/quad.frag.js +1 -1
- package/dist/melonjs.mjs/video/webgl/shaders/quad.vert.js +1 -1
- package/dist/melonjs.mjs/video/webgl/utils/attributes.js +1 -1
- package/dist/melonjs.mjs/video/webgl/utils/precision.js +4 -4
- package/dist/melonjs.mjs/video/webgl/utils/program.js +1 -1
- package/dist/melonjs.mjs/video/webgl/utils/string.js +1 -1
- package/dist/melonjs.mjs/video/webgl/utils/uniforms.js +1 -1
- package/dist/melonjs.mjs/video/webgl/webgl_renderer.js +62 -67
- package/dist/melonjs.module.js +1272 -1713
- package/dist/types/application/application.d.ts +32 -31
- package/dist/types/application/header.d.ts +2 -2
- package/dist/types/application/settings.d.ts +80 -16
- package/dist/types/audio/audio.d.ts +4 -6
- package/dist/types/camera/camera2d.d.ts +13 -16
- package/dist/types/entity/entity.d.ts +0 -1
- package/dist/types/geometries/ellipse.d.ts +18 -50
- package/dist/types/geometries/path2d.d.ts +1 -1
- package/dist/types/geometries/point.d.ts +5 -13
- package/dist/types/geometries/poly.d.ts +26 -75
- package/dist/types/geometries/rectangle.d.ts +12 -58
- package/dist/types/geometries/roundrect.d.ts +2 -11
- package/dist/types/index.d.ts +3 -3
- package/dist/types/input/gamepad.d.ts +31 -31
- package/dist/types/input/keyboard.d.ts +105 -105
- package/dist/types/input/pointer.d.ts +21 -21
- package/dist/types/input/pointerevent.d.ts +6 -6
- package/dist/types/level/tiled/TMXLayer.d.ts +1 -1
- package/dist/types/level/tiled/TMXUtils.d.ts +4 -6
- package/dist/types/math/matrix2.d.ts +9 -63
- package/dist/types/math/matrix3.d.ts +9 -68
- package/dist/types/math/observable_vector2.d.ts +2 -2
- package/dist/types/math/observable_vector3.d.ts +2 -2
- package/dist/types/math/vector2.d.ts +8 -92
- package/dist/types/math/vector3.d.ts +8 -92
- package/dist/types/particles/settings.d.ts +29 -29
- package/dist/types/physics/body.d.ts +10 -8
- package/dist/types/physics/bounds.d.ts +24 -30
- package/dist/types/physics/collision.d.ts +12 -12
- package/dist/types/physics/detector.d.ts +1 -1
- package/dist/types/physics/world.d.ts +4 -7
- package/dist/types/renderable/container.d.ts +19 -19
- package/dist/types/renderable/imagelayer.d.ts +6 -6
- package/dist/types/renderable/light2d.d.ts +7 -7
- package/dist/types/renderable/renderable.d.ts +10 -18
- package/dist/types/renderable/text/bitmaptext.d.ts +151 -0
- package/dist/types/renderable/text/bitmaptextdata.d.ts +35 -0
- package/dist/types/renderable/text/glyph.d.ts +28 -0
- package/dist/types/renderable/text/text.d.ts +159 -0
- package/dist/types/renderable/text/textmetrics.d.ts +47 -0
- package/dist/types/renderable/text/textstyle.d.ts +5 -0
- package/dist/types/renderable/ui/uibaseelement.d.ts +0 -1
- package/dist/types/renderable/ui/uispriteelement.d.ts +0 -1
- package/dist/types/renderable/ui/uitextbutton.d.ts +2 -7
- package/dist/types/state/stage.d.ts +3 -2
- package/dist/types/state/state.d.ts +11 -11
- package/dist/types/system/device.d.ts +16 -9
- package/dist/types/system/event.d.ts +40 -0
- package/dist/types/system/platform.d.ts +17 -17
- package/dist/types/utils/function.d.ts +1 -2
- package/dist/types/video/canvas/canvas_renderer.d.ts +0 -23
- package/dist/types/video/renderer.d.ts +16 -43
- package/dist/types/video/texture/canvas_texture.d.ts +14 -14
- package/dist/types/video/video.d.ts +4 -38
- package/dist/types/video/webgl/buffer/vertex.d.ts +2 -2
- package/dist/types/video/webgl/compositors/compositor.d.ts +24 -13
- package/dist/types/video/webgl/compositors/primitive_compositor.d.ts +0 -1
- package/dist/types/video/webgl/compositors/quad_compositor.d.ts +0 -1
- package/dist/types/video/webgl/utils/precision.d.ts +1 -1
- package/dist/types/video/webgl/webgl_renderer.d.ts +48 -84
- package/package.json +15 -15
- package/src/application/application.js +73 -21
- package/src/application/header.js +1 -1
- package/src/application/resize.js +11 -9
- package/src/application/settings.js +36 -0
- package/src/audio/audio.js +3 -5
- package/src/camera/camera2d.js +11 -13
- package/src/entity/entity.js +2 -3
- package/src/geometries/ellipse.js +25 -58
- package/src/geometries/line.js +17 -24
- package/src/geometries/path2d.js +15 -12
- package/src/geometries/point.js +7 -15
- package/src/geometries/poly.js +39 -96
- package/src/geometries/rectangle.js +36 -90
- package/src/geometries/roundrect.js +25 -34
- package/src/index.js +4 -4
- package/src/input/keyboard.js +2 -2
- package/src/input/pointer.js +3 -3
- package/src/input/pointerevent.js +5 -6
- package/src/lang/deprecated.js +1 -1
- package/src/level/tiled/TMXLayer.js +15 -32
- package/src/level/tiled/TMXObject.js +2 -3
- package/src/level/tiled/TMXTile.js +3 -3
- package/src/level/tiled/TMXTileMap.js +2 -2
- package/src/level/tiled/TMXTileset.js +3 -6
- package/src/level/tiled/TMXTilesetGroup.js +1 -1
- package/src/level/tiled/TMXUtils.js +36 -46
- package/src/level/tiled/renderer/TMXHexagonalRenderer.js +2 -2
- package/src/level/tiled/renderer/TMXIsometricRenderer.js +1 -1
- package/src/level/tiled/renderer/TMXOrthogonalRenderer.js +1 -1
- package/src/level/tiled/renderer/TMXRenderer.js +1 -1
- package/src/level/tiled/renderer/TMXStaggeredRenderer.js +1 -1
- package/src/loader/parser.js +3 -4
- package/src/math/color.js +4 -4
- package/src/math/matrix2.js +4 -58
- package/src/math/matrix3.js +81 -140
- package/src/math/observable_vector2.js +6 -6
- package/src/math/observable_vector3.js +4 -4
- package/src/math/vector2.js +6 -90
- package/src/math/vector3.js +5 -89
- package/src/particles/emitter.js +1 -1
- package/src/particles/particle.js +1 -1
- package/src/physics/body.js +21 -19
- package/src/physics/bounds.js +26 -32
- package/src/physics/collision.js +4 -4
- package/src/physics/detector.js +9 -9
- package/src/physics/quadtree.js +4 -4
- package/src/physics/sat.js +2 -3
- package/src/physics/world.js +5 -8
- package/src/polyfill/roundrect.js +163 -163
- package/src/renderable/collectable.js +1 -1
- package/src/renderable/colorlayer.js +3 -3
- package/src/renderable/container.js +24 -24
- package/src/renderable/imagelayer.js +3 -3
- package/src/renderable/light2d.js +2 -2
- package/src/renderable/nineslicesprite.js +1 -1
- package/src/renderable/renderable.js +30 -38
- package/src/renderable/sprite.js +2 -2
- package/src/{text → renderable/text}/bitmaptext.js +8 -8
- package/src/{text → renderable/text}/bitmaptextdata.js +4 -7
- package/src/{text → renderable/text}/glyph.js +1 -1
- package/src/{text → renderable/text}/text.js +16 -17
- package/src/{text → renderable/text}/textmetrics.js +2 -2
- package/src/renderable/trigger.js +9 -9
- package/src/renderable/ui/uibaseelement.js +6 -6
- package/src/renderable/ui/uispriteelement.js +6 -6
- package/src/renderable/ui/uitextbutton.js +2 -2
- package/src/state/stage.js +12 -13
- package/src/state/state.js +2 -61
- package/src/system/device.js +50 -9
- package/src/system/event.js +44 -0
- package/src/system/platform.js +18 -18
- package/src/system/pooling.js +9 -9
- package/src/tweens/tween.js +1 -1
- package/src/utils/function.js +1 -2
- package/src/video/canvas/canvas_renderer.js +4 -17
- package/src/video/renderer.js +16 -29
- package/src/video/texture/atlas.js +12 -12
- package/src/video/texture/canvas_texture.js +14 -14
- package/src/video/video.js +7 -28
- package/src/video/webgl/buffer/vertex.js +2 -2
- package/src/video/webgl/compositors/compositor.js +12 -13
- package/src/video/webgl/compositors/primitive_compositor.js +4 -4
- package/src/video/webgl/compositors/quad_compositor.js +1 -2
- package/src/video/webgl/glshader.js +1 -1
- package/src/video/webgl/utils/precision.js +3 -3
- package/src/video/webgl/webgl_renderer.js +61 -66
- /package/src/{text → renderable/text}/textstyle.js +0 -0
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/*!
|
|
2
|
-
* melonJS Game Engine - v15.
|
|
2
|
+
* melonJS Game Engine - v15.4.0
|
|
3
3
|
* http://www.melonjs.org
|
|
4
4
|
* melonjs is licensed under the MIT License.
|
|
5
5
|
* http://www.opensource.org/licenses/mit-license
|
|
@@ -30,7 +30,7 @@ import { Interpolation } from './interpolation.js';
|
|
|
30
30
|
* author lechecacharro<br>
|
|
31
31
|
* author Josh Faul / http://jocafa.com/
|
|
32
32
|
*/
|
|
33
|
-
|
|
33
|
+
class Tween {
|
|
34
34
|
|
|
35
35
|
/**
|
|
36
36
|
* @param {object} object - object on which to apply the tween
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/*!
|
|
2
|
-
* melonJS Game Engine - v15.
|
|
2
|
+
* melonJS Game Engine - v15.4.0
|
|
3
3
|
* http://www.melonjs.org
|
|
4
4
|
* melonjs is licensed under the MIT License.
|
|
5
5
|
* http://www.opensource.org/licenses/mit-license
|
|
@@ -30,8 +30,7 @@ function defer(func, thisArg, ...args) {
|
|
|
30
30
|
}
|
|
31
31
|
|
|
32
32
|
/**
|
|
33
|
-
* returns a function that, when invoked will only be triggered at most
|
|
34
|
-
* once during a given window of time
|
|
33
|
+
* returns a function that, when invoked will only be triggered at most once during a given window of time
|
|
35
34
|
* @public
|
|
36
35
|
* @memberof utils.function
|
|
37
36
|
* @name throttle
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/*!
|
|
2
|
-
* melonJS Game Engine - v15.
|
|
2
|
+
* melonJS Game Engine - v15.4.0
|
|
3
3
|
* http://www.melonjs.org
|
|
4
4
|
* melonjs is licensed under the MIT License.
|
|
5
5
|
* http://www.opensource.org/licenses/mit-license
|
|
@@ -19,18 +19,9 @@ import { emit, on, ONCONTEXT_LOST, ONCONTEXT_RESTORED, GAME_RESET } from '../../
|
|
|
19
19
|
* a canvas renderer object
|
|
20
20
|
* @augments Renderer
|
|
21
21
|
*/
|
|
22
|
-
|
|
23
|
-
/**
|
|
24
|
-
* @param {
|
|
25
|
-
* @param {number} options.width - The width of the canvas without scaling
|
|
26
|
-
* @param {number} options.height - The height of the canvas without scaling
|
|
27
|
-
* @param {HTMLCanvasElement} [options.canvas] - The html canvas to draw to on screen
|
|
28
|
-
* @param {boolean} [options.antiAlias=false] - Whether to enable anti-aliasing
|
|
29
|
-
* @param {boolean} [options.transparent=false] - Whether to enable transparency on the canvas (performance hit when enabled)
|
|
30
|
-
* @param {boolean} [options.subPixel=false] - Whether to enable subpixel renderering (performance hit when enabled)
|
|
31
|
-
* @param {boolean} [options.textureSeamFix=true] - enable the texture seam fix when rendering Tile when antiAlias is off for the canvasRenderer
|
|
32
|
-
* @param {number} [options.zoomX=width] - The actual width of the canvas with scaling applied
|
|
33
|
-
* @param {number} [options.zoomY=height] - The actual height of the canvas with scaling applied
|
|
22
|
+
class CanvasRenderer extends Renderer {
|
|
23
|
+
/**
|
|
24
|
+
* @param {Application.Settings} [options] - optional parameters for the renderer
|
|
34
25
|
*/
|
|
35
26
|
constructor(options) {
|
|
36
27
|
// parent constructor
|
|
@@ -543,11 +534,7 @@ import { emit, on, ONCONTEXT_LOST, ONCONTEXT_RESTORED, GAME_RESET } from '../../
|
|
|
543
534
|
setColor(color) {
|
|
544
535
|
let context = this.getContext();
|
|
545
536
|
context.strokeStyle =
|
|
546
|
-
context.fillStyle = (
|
|
547
|
-
color instanceof Color ?
|
|
548
|
-
color.toRGBA() :
|
|
549
|
-
color
|
|
550
|
-
);
|
|
537
|
+
context.fillStyle = (color instanceof Color ? color.toRGBA() : color);
|
|
551
538
|
}
|
|
552
539
|
|
|
553
540
|
/**
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/*!
|
|
2
|
-
* melonJS Game Engine - v15.
|
|
2
|
+
* melonJS Game Engine - v15.4.0
|
|
3
3
|
* http://www.melonjs.org
|
|
4
4
|
* melonjs is licensed under the MIT License.
|
|
5
5
|
* http://www.opensource.org/licenses/mit-license
|
|
@@ -25,22 +25,9 @@ import Point from '../geometries/point.js';
|
|
|
25
25
|
* @classdesc
|
|
26
26
|
* a base renderer object
|
|
27
27
|
*/
|
|
28
|
-
|
|
28
|
+
class Renderer {
|
|
29
29
|
/**
|
|
30
|
-
* @param {
|
|
31
|
-
* @param {number} options.width - The width of the canvas without scaling
|
|
32
|
-
* @param {number} options.height - The height of the canvas without scaling
|
|
33
|
-
* @param {HTMLCanvasElement} [options.canvas] - The html canvas to draw to on screen
|
|
34
|
-
* @param {boolean} [options.antiAlias=false] - Whether to enable anti-aliasing, use false (default) for a pixelated effect.
|
|
35
|
-
* @param {boolean} [options.failIfMajorPerformanceCaveat=true] - If true, the renderer will switch to CANVAS mode if the performances of a WebGL context would be dramatically lower than that of a native application making equivalent OpenGL calls.
|
|
36
|
-
* @param {boolean} [options.transparent=false] - Whether to enable transparency on the canvas
|
|
37
|
-
* @param {boolean} [options.premultipliedAlpha=true] - in WebGL, whether the renderer will assume that colors have premultiplied alpha when canvas transparency is enabled
|
|
38
|
-
* @param {boolean} [options.blendMode="normal"] - the default blend mode to use ("normal", "multiply")
|
|
39
|
-
* @param {boolean} [options.depthBuffer="sorting"] - ~Experimental~ the default method to sort object on the z axis in WebGL ("sorting", "z-buffer")
|
|
40
|
-
* @param {boolean} [options.subPixel=false] - Whether to enable subpixel rendering (performance hit when enabled)
|
|
41
|
-
* @param {boolean} [options.verbose=false] - Enable the verbose mode that provides additional details as to what the renderer is doing
|
|
42
|
-
* @param {number} [options.zoomX=width] - The actual width of the canvas with scaling applied
|
|
43
|
-
* @param {number} [options.zoomY=height] - The actual height of the canvas with scaling applied
|
|
30
|
+
* @param {Application.Settings} [options] - optional parameters for the renderer
|
|
44
31
|
*/
|
|
45
32
|
constructor(options) {
|
|
46
33
|
/**
|
|
@@ -53,7 +40,7 @@ import Point from '../geometries/point.js';
|
|
|
53
40
|
/**
|
|
54
41
|
* the requested video size ratio
|
|
55
42
|
* @public
|
|
56
|
-
* @type {
|
|
43
|
+
* @type {number}
|
|
57
44
|
*/
|
|
58
45
|
this.designRatio = this.settings.width / this.settings.height;
|
|
59
46
|
|
|
@@ -210,7 +197,7 @@ import Point from '../geometries/point.js';
|
|
|
210
197
|
}
|
|
211
198
|
|
|
212
199
|
let _context = canvas.getContext("2d", {
|
|
213
|
-
|
|
200
|
+
"alpha" : transparent
|
|
214
201
|
});
|
|
215
202
|
|
|
216
203
|
if (!_context.canvas) {
|
|
@@ -426,10 +413,10 @@ import Point from '../geometries/point.js';
|
|
|
426
413
|
|
|
427
414
|
/**
|
|
428
415
|
* creates a Blob object representing the last rendered frame
|
|
429
|
-
* @param {
|
|
430
|
-
* @param {
|
|
431
|
-
* @param {
|
|
432
|
-
* @
|
|
416
|
+
* @param {object} [options] - An object with the following properties:
|
|
417
|
+
* @param {string} [options.type="image/png"] - A string indicating the image format
|
|
418
|
+
* @param {number} [options.quality] - A Number between 0 and 1 indicating the image quality to be used when creating images using file formats that support lossy compression (such as image/jpeg or image/webp). A user agent will use its default quality value if this option is not specified, or if the number is outside the allowed range.
|
|
419
|
+
* @returns {Promise} A Promise returning a Blob object representing the last rendered frame
|
|
433
420
|
* @example
|
|
434
421
|
* renderer.convertToBlob().then((blob) => console.log(blob));
|
|
435
422
|
*/
|
|
@@ -446,10 +433,10 @@ import Point from '../geometries/point.js';
|
|
|
446
433
|
/**
|
|
447
434
|
* creates an ImageBitmap object of the last frame rendered
|
|
448
435
|
* (not supported by standard Canvas)
|
|
449
|
-
* @param {
|
|
450
|
-
* @param {
|
|
451
|
-
* @param {
|
|
452
|
-
* @
|
|
436
|
+
* @param {object} [options] - An object with the following properties:
|
|
437
|
+
* @param {string} [options.type="image/png"] - A string indicating the image format
|
|
438
|
+
* @param {number} [options.quality] - A Number between 0 and 1 indicating the image quality to be used when creating images using file formats that support lossy compression (such as image/jpeg or image/webp). A user agent will use its default quality value if this option is not specified, or if the number is outside the allowed range.
|
|
439
|
+
* @returns {Promise} A Promise returning an ImageBitmap.
|
|
453
440
|
* @example
|
|
454
441
|
* renderer.transferToImageBitmap().then((image) => console.log(image));
|
|
455
442
|
*/
|
|
@@ -467,10 +454,10 @@ import Point from '../geometries/point.js';
|
|
|
467
454
|
|
|
468
455
|
/**
|
|
469
456
|
* returns a data URL containing a representation of the last frame rendered
|
|
470
|
-
* @param {
|
|
471
|
-
* @param {
|
|
472
|
-
* @param {
|
|
473
|
-
* @
|
|
457
|
+
* @param {object} [options] - An object with the following properties:
|
|
458
|
+
* @param {string} [options.type="image/png"] - A string indicating the image format
|
|
459
|
+
* @param {number} [options.quality] - A Number between 0 and 1 indicating the image quality to be used when creating images using file formats that support lossy compression (such as image/jpeg or image/webp). A user agent will use its default quality value if this option is not specified, or if the number is outside the allowed range.
|
|
460
|
+
* @returns {Promise} A Promise returning a string containing the requested data URL.
|
|
474
461
|
* @example
|
|
475
462
|
* renderer.toDataURL().then((dataURL) => console.log(dataURL));
|
|
476
463
|
*/
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/*!
|
|
2
|
-
* melonJS Game Engine - v15.
|
|
2
|
+
* melonJS Game Engine - v15.4.0
|
|
3
3
|
* http://www.melonjs.org
|
|
4
4
|
* melonjs is licensed under the MIT License.
|
|
5
5
|
* http://www.opensource.org/licenses/mit-license
|
|
@@ -17,18 +17,18 @@ import { ETA } from '../../math/math.js';
|
|
|
17
17
|
* @ignore
|
|
18
18
|
*/
|
|
19
19
|
function createAtlas(width, height, name = "default", repeat = "no-repeat") {
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
20
|
+
return {
|
|
21
|
+
"meta" : {
|
|
22
|
+
"app" : "melonJS",
|
|
23
|
+
"size" : { "w" : width, "h" : height },
|
|
24
|
+
"repeat" : repeat,
|
|
25
|
+
"image" : "default"
|
|
26
|
+
},
|
|
27
|
+
"frames" : [{
|
|
28
|
+
"filename" : name,
|
|
29
|
+
"frame" : { "x" : 0, "y" : 0, "w" : width, "h" : height }
|
|
30
|
+
}]
|
|
31
|
+
};
|
|
32
32
|
}
|
|
33
33
|
|
|
34
34
|
/**
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/*!
|
|
2
|
-
* melonJS Game Engine - v15.
|
|
2
|
+
* melonJS Game Engine - v15.4.0
|
|
3
3
|
* http://www.melonjs.org
|
|
4
4
|
* melonjs is licensed under the MIT License.
|
|
5
5
|
* http://www.opensource.org/licenses/mit-license
|
|
@@ -69,7 +69,7 @@ class CanvasTexture {
|
|
|
69
69
|
|
|
70
70
|
/**
|
|
71
71
|
* enable/disable image smoothing (scaling interpolation)
|
|
72
|
-
* @param {boolean} [enable=false]
|
|
72
|
+
* @param {boolean} [enable=false] - whether to enable or not image smoothing (scaling interpolation)
|
|
73
73
|
*/
|
|
74
74
|
setAntiAlias(enable = false) {
|
|
75
75
|
let canvas = this.canvas;
|
|
@@ -112,7 +112,7 @@ class CanvasTexture {
|
|
|
112
112
|
* @param {number} y - The y-axis coordinate of the top-left corner of the rectangle from which the ImageData will be extracted
|
|
113
113
|
* @param {number} width - The width of the rectangle from which the ImageData will be extracted. Positive values are to the right, and negative to the left
|
|
114
114
|
* @param {number} height - The height of the rectangle from which the ImageData will be extracted. Positive values are down, and negative are up
|
|
115
|
-
* @
|
|
115
|
+
* @returns {ImageData} The ImageData extracted from this CanvasTexture.
|
|
116
116
|
*/
|
|
117
117
|
getImageData(x, y, width, height) {
|
|
118
118
|
// clamp values
|
|
@@ -126,10 +126,10 @@ class CanvasTexture {
|
|
|
126
126
|
|
|
127
127
|
/**
|
|
128
128
|
* creates a Blob object representing the image contained in this canvas texture
|
|
129
|
-
* @param {
|
|
130
|
-
* @param {
|
|
131
|
-
* @param {
|
|
132
|
-
* @
|
|
129
|
+
* @param {object} [options] - An object with the following properties:
|
|
130
|
+
* @param {string} [options.type="image/png"] - A string indicating the image format
|
|
131
|
+
* @param {number} [options.quality] - A Number between 0 and 1 indicating the image quality to be used when creating images using file formats that support lossy compression (such as image/jpeg or image/webp). A user agent will use its default quality value if this option is not specified, or if the number is outside the allowed range.
|
|
132
|
+
* @returns {Promise} A Promise returning a Blob object representing the image contained in this canvas texture
|
|
133
133
|
* @example
|
|
134
134
|
* canvasTexture.convertToBlob().then((blob) => console.log(blob));
|
|
135
135
|
*/
|
|
@@ -147,10 +147,10 @@ class CanvasTexture {
|
|
|
147
147
|
|
|
148
148
|
/**
|
|
149
149
|
* creates an ImageBitmap object from the most recently rendered image of this canvas texture
|
|
150
|
-
* @param {
|
|
151
|
-
* @param {
|
|
152
|
-
* @param {
|
|
153
|
-
* @
|
|
150
|
+
* @param {object} [options] - An object with the following properties:
|
|
151
|
+
* @param {string} [options.type="image/png"] - A string indicating the image format
|
|
152
|
+
* @param {number} [options.quality] - A Number between 0 and 1 indicating the image quality to be used when creating images using file formats that support lossy compression (such as image/jpeg or image/webp). A user agent will use its default quality value if this option is not specified, or if the number is outside the allowed range.
|
|
153
|
+
* @returns {Promise} A Promise returning an ImageBitmap.
|
|
154
154
|
* @example
|
|
155
155
|
* canvasTexture.transferToImageBitmap().then((bitmap) => console.log(bitmap));
|
|
156
156
|
*/
|
|
@@ -171,10 +171,10 @@ class CanvasTexture {
|
|
|
171
171
|
/**
|
|
172
172
|
* returns a data URL containing a representation of the most recently rendered image of this canvas texture
|
|
173
173
|
* (not supported by OffscreenCanvas)
|
|
174
|
-
* @param {
|
|
175
|
-
* @param {
|
|
176
|
-
* @param {
|
|
177
|
-
* @
|
|
174
|
+
* @param {object} [options] - An object with the following properties:
|
|
175
|
+
* @param {string} [options.type="image/png"] - A string indicating the image format
|
|
176
|
+
* @param {number} [options.quality] - A Number between 0 and 1 indicating the image quality to be used when creating images using file formats that support lossy compression (such as image/jpeg or image/webp). A user agent will use its default quality value if this option is not specified, or if the number is outside the allowed range.
|
|
177
|
+
* @returns {Promise} A Promise returning a string containing the requested data URL.
|
|
178
178
|
* @example
|
|
179
179
|
* renderer.toDataURL().then((dataURL) => console.log(dataURL));
|
|
180
180
|
*/
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/*!
|
|
2
|
-
* melonJS Game Engine - v15.
|
|
2
|
+
* melonJS Game Engine - v15.4.0
|
|
3
3
|
* http://www.melonjs.org
|
|
4
4
|
* melonjs is licensed under the MIT License.
|
|
5
5
|
* http://www.opensource.org/licenses/mit-license
|
|
@@ -20,34 +20,10 @@ let renderer = null;
|
|
|
20
20
|
|
|
21
21
|
/**
|
|
22
22
|
* Initialize the "video" system (create a canvas based on the given arguments, and the related renderer). <br>
|
|
23
|
-
* melonJS support various scaling mode, that can be enabled <u>once the scale option is set to <b>`auto`</b></u> : <br>
|
|
24
|
-
* - <i><b>`fit`</b></i> : Letterboxed; content is scaled to design aspect ratio <br>
|
|
25
|
-
* <center><img src="images/scale-fit.png"/></center><br>
|
|
26
|
-
* - <i><b>`fill-min`</b></i> : Canvas is resized to fit minimum design resolution; content is scaled to design aspect ratio <br>
|
|
27
|
-
* <center><img src="images/scale-fill-min.png"/></center><br>
|
|
28
|
-
* - <i><b>`fill-max`</b></i> : Canvas is resized to fit maximum design resolution; content is scaled to design aspect ratio <br>
|
|
29
|
-
* <center><img src="images/scale-fill-max.png"/></center><br>
|
|
30
|
-
* - <i><b>`flex`</b><</i> : Canvas width & height is resized to fit; content is scaled to design aspect ratio <br>
|
|
31
|
-
* <center><img src="images/scale-flex.png"/></center><br>
|
|
32
|
-
* - <i><b>`flex-width`</b></i> : Canvas width is resized to fit; content is scaled to design aspect ratio <br>
|
|
33
|
-
* <center><img src="images/scale-flex-width.png"/></center><br>
|
|
34
|
-
* - <i><b>`flex-height`</b></i> : Canvas height is resized to fit; content is scaled to design aspect ratio <br>
|
|
35
|
-
* <center><img src="images/scale-flex-height.png"/></center><br>
|
|
36
|
-
* - <i><b>`stretch`</b></i> : Canvas is resized to fit; content is scaled to screen aspect ratio
|
|
37
|
-
* <center><img src="images/scale-stretch.png"/></center><br>
|
|
38
23
|
* @memberof video
|
|
39
24
|
* @param {number} width - The width of the canvas viewport
|
|
40
25
|
* @param {number} height - The height of the canvas viewport
|
|
41
|
-
* @param {
|
|
42
|
-
* @param {string|HTMLElement} [options.parent=document.body] - the DOM parent element to hold the canvas in the HTML file
|
|
43
|
-
* @param {number|Renderer} [options.renderer=video.AUTO] - renderer to use (me.video.CANVAS, me.video.WEBGL, me.video.AUTO), or a custom renderer class
|
|
44
|
-
* @param {number|string} [options.scale=1.0] - enable scaling of the canvas ('auto' for automatic scaling)
|
|
45
|
-
* @param {string} [options.scaleMethod="fit"] - screen scaling modes ('fit','fill-min','fill-max','flex','flex-width','flex-height','stretch')
|
|
46
|
-
* @param {boolean} [options.preferWebGL1=false] - if true the renderer will only use WebGL 1
|
|
47
|
-
* @param {string} [options.powerPreference="default"] - a hint to the user agent indicating what configuration of GPU is suitable for the WebGL context ("default", "high-performance", "low-power"). To be noted that Safari and Chrome (since version 80) both default to "low-power" to save battery life and improve the user experience on these dual-GPU machines.
|
|
48
|
-
* @param {boolean} [options.transparent=false] - whether to allow transparent pixels in the front buffer (screen).
|
|
49
|
-
* @param {boolean} [options.antiAlias=false] - whether to enable or not video scaling interpolation
|
|
50
|
-
* @param {boolean} [options.consoleHeader=true] - whether to display melonJS version and basic device information in the console
|
|
26
|
+
* @param {Application.Settings} [options] - optional parameters for the renderer
|
|
51
27
|
* @returns {boolean} false if initialization failed (canvas not supported)
|
|
52
28
|
* @example
|
|
53
29
|
* // init the video with a 640x480 canvas
|
|
@@ -65,7 +41,7 @@ function init(width, height, options) {
|
|
|
65
41
|
}
|
|
66
42
|
|
|
67
43
|
try {
|
|
68
|
-
|
|
44
|
+
// initialize the default game Application with the given options
|
|
69
45
|
game.init(width, height, options);
|
|
70
46
|
} catch (e) {
|
|
71
47
|
console.log(e.message);
|
|
@@ -127,7 +103,7 @@ function init(width, height, options) {
|
|
|
127
103
|
* @param {number} width - width
|
|
128
104
|
* @param {number} height - height
|
|
129
105
|
* @param {boolean} [returnOffscreenCanvas=false] - will return an OffscreenCanvas if supported
|
|
130
|
-
* @returns {HTMLCanvasElement|OffscreenCanvas}
|
|
106
|
+
* @returns {HTMLCanvasElement|OffscreenCanvas} a new Canvas element of the given size
|
|
131
107
|
*/
|
|
132
108
|
function createCanvas(width, height, returnOffscreenCanvas = false) {
|
|
133
109
|
let _canvas;
|
|
@@ -156,7 +132,7 @@ function createCanvas(width, height, returnOffscreenCanvas = false) {
|
|
|
156
132
|
/**
|
|
157
133
|
* return a reference to the parent DOM element holding the main canvas
|
|
158
134
|
* @memberof video
|
|
159
|
-
* @returns {HTMLElement}
|
|
135
|
+
* @returns {HTMLElement} the HTML parent element
|
|
160
136
|
*/
|
|
161
137
|
function getParent() {
|
|
162
138
|
return game.getParentElement();
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/*!
|
|
2
|
-
* melonJS Game Engine - v15.
|
|
2
|
+
* melonJS Game Engine - v15.4.0
|
|
3
3
|
* http://www.melonjs.org
|
|
4
4
|
* melonjs is licensed under the MIT License.
|
|
5
5
|
* http://www.opensource.org/licenses/mit-license
|
|
@@ -12,7 +12,7 @@
|
|
|
12
12
|
* @ignore
|
|
13
13
|
*/
|
|
14
14
|
|
|
15
|
-
|
|
15
|
+
class VertexArrayBuffer {
|
|
16
16
|
|
|
17
17
|
constructor(vertex_size, vertex_per_obj) {
|
|
18
18
|
// the size of one vertex in float
|
|
@@ -45,7 +45,7 @@
|
|
|
45
45
|
* @ignore
|
|
46
46
|
*/
|
|
47
47
|
isFull(vertex = this.objSize) {
|
|
48
|
-
|
|
48
|
+
return (this.vertexCount + vertex >= this.maxVertex);
|
|
49
49
|
}
|
|
50
50
|
|
|
51
51
|
/**
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/*!
|
|
2
|
-
* melonJS Game Engine - v15.
|
|
2
|
+
* melonJS Game Engine - v15.4.0
|
|
3
3
|
* http://www.melonjs.org
|
|
4
4
|
* melonjs is licensed under the MIT License.
|
|
5
5
|
* http://www.opensource.org/licenses/mit-license
|
|
@@ -12,19 +12,19 @@ import GLShader from '../glshader.js';
|
|
|
12
12
|
* @classdesc
|
|
13
13
|
* A base Compositor object.
|
|
14
14
|
*/
|
|
15
|
-
|
|
15
|
+
class Compositor {
|
|
16
16
|
/**
|
|
17
17
|
* @param {WebGLRenderer} renderer - the current WebGL renderer session
|
|
18
|
-
* @param {
|
|
19
|
-
* @param {object[]} attribute - an array of attributes definition
|
|
20
|
-
* @param {string} attribute.name - name of the attribute in the vertex shader
|
|
21
|
-
* @param {number} attribute.size - number of components per vertex attribute. Must be 1, 2, 3, or 4.
|
|
22
|
-
* @param {GLenum} attribute.type - data type of each component in the array
|
|
23
|
-
* @param {boolean} attribute.normalized - whether integer data values should be normalized into a certain range when being cast to a float
|
|
24
|
-
* @param {number} attribute.offset - offset in bytes of the first component in the vertex attribute array
|
|
25
|
-
* @param {object} shader - an array of attributes definition
|
|
26
|
-
* @param {string} shader.vertex - a string containing the GLSL source code to set
|
|
27
|
-
* @param {string} shader.fragment - a string containing the GLSL source code to set
|
|
18
|
+
* @param {object} settings - additional settings to initialize this compositors
|
|
19
|
+
* @param {object[]} settings.attribute - an array of attributes definition
|
|
20
|
+
* @param {string} settings.attribute.name - name of the attribute in the vertex shader
|
|
21
|
+
* @param {number} settings.attribute.size - number of components per vertex attribute. Must be 1, 2, 3, or 4.
|
|
22
|
+
* @param {GLenum} settings.attribute.type - data type of each component in the array
|
|
23
|
+
* @param {boolean} settings.attribute.normalized - whether integer data values should be normalized into a certain range when being cast to a float
|
|
24
|
+
* @param {number} settings.attribute.offset - offset in bytes of the first component in the vertex attribute array
|
|
25
|
+
* @param {object} settings.shader - an array of attributes definition
|
|
26
|
+
* @param {string} settings.shader.vertex - a string containing the GLSL source code to set
|
|
27
|
+
* @param {string} settings.shader.fragment - a string containing the GLSL source code to set
|
|
28
28
|
*/
|
|
29
29
|
constructor (renderer, settings) {
|
|
30
30
|
this.init(renderer, settings);
|
|
@@ -126,7 +126,6 @@ import GLShader from '../glshader.js';
|
|
|
126
126
|
}
|
|
127
127
|
|
|
128
128
|
/**
|
|
129
|
-
* @ignore
|
|
130
129
|
* called by the WebGL renderer when a compositor become the current one
|
|
131
130
|
*/
|
|
132
131
|
bind() {
|
|
@@ -199,7 +198,7 @@ import GLShader from '../glshader.js';
|
|
|
199
198
|
|
|
200
199
|
/**
|
|
201
200
|
* set/change the current projection matrix
|
|
202
|
-
* @param {Matrix3d} matrix
|
|
201
|
+
* @param {Matrix3d} matrix - the new projection matrix
|
|
203
202
|
*/
|
|
204
203
|
setProjection(matrix) {
|
|
205
204
|
this.currentShader.setUniform("uProjectionMatrix", matrix);
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/*!
|
|
2
|
-
* melonJS Game Engine - v15.
|
|
2
|
+
* melonJS Game Engine - v15.4.0
|
|
3
3
|
* http://www.melonjs.org
|
|
4
4
|
* melonjs is licensed under the MIT License.
|
|
5
5
|
* http://www.opensource.org/licenses/mit-license
|
|
@@ -15,7 +15,7 @@ import Compositor from './compositor.js';
|
|
|
15
15
|
* Pushes texture regions or shape geometry into WebGL buffers, automatically flushes to GPU
|
|
16
16
|
* @augments Compositor
|
|
17
17
|
*/
|
|
18
|
-
|
|
18
|
+
class PrimitiveCompositor extends Compositor {
|
|
19
19
|
|
|
20
20
|
/**
|
|
21
21
|
* Initialize the compositor
|
|
@@ -42,8 +42,8 @@ import Compositor from './compositor.js';
|
|
|
42
42
|
drawVertices(mode, verts, vertexCount = verts.length) {
|
|
43
43
|
let viewMatrix = this.viewMatrix;
|
|
44
44
|
let vertexData = this.vertexData;
|
|
45
|
-
let color = this.renderer.currentColor;
|
|
46
45
|
let alpha = this.renderer.getGlobalAlpha();
|
|
46
|
+
let colorUint32 = this.renderer.currentColor.toUint32(alpha);
|
|
47
47
|
|
|
48
48
|
if (vertexData.isFull(vertexCount)) {
|
|
49
49
|
// is the vertex buffer full if we add more vertices
|
|
@@ -59,11 +59,11 @@ import Compositor from './compositor.js';
|
|
|
59
59
|
if (!viewMatrix.isIdentity()) {
|
|
60
60
|
verts.forEach((vert) => {
|
|
61
61
|
viewMatrix.apply(vert);
|
|
62
|
-
vertexData.push(vert.x, vert.y, undefined, undefined,
|
|
62
|
+
vertexData.push(vert.x, vert.y, undefined, undefined, colorUint32);
|
|
63
63
|
});
|
|
64
64
|
} else {
|
|
65
65
|
verts.forEach((vert) => {
|
|
66
|
-
vertexData.push(vert.x, vert.y, undefined, undefined,
|
|
66
|
+
vertexData.push(vert.x, vert.y, undefined, undefined, colorUint32);
|
|
67
67
|
});
|
|
68
68
|
}
|
|
69
69
|
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/*!
|
|
2
|
-
* melonJS Game Engine - v15.
|
|
2
|
+
* melonJS Game Engine - v15.4.0
|
|
3
3
|
* http://www.melonjs.org
|
|
4
4
|
* melonjs is licensed under the MIT License.
|
|
5
5
|
* http://www.opensource.org/licenses/mit-license
|
|
@@ -25,7 +25,7 @@ let V_ARRAY = [
|
|
|
25
25
|
* Pushes texture regions or shape geometry into WebGL buffers, automatically flushes to GPU
|
|
26
26
|
* @augments Compositor
|
|
27
27
|
*/
|
|
28
|
-
|
|
28
|
+
class QuadCompositor extends Compositor {
|
|
29
29
|
|
|
30
30
|
/**
|
|
31
31
|
* Initialize the compositor
|
|
@@ -115,7 +115,6 @@ let V_ARRAY = [
|
|
|
115
115
|
/**
|
|
116
116
|
* delete the given WebGL texture
|
|
117
117
|
* @param {WebGLTexture} [texture] - a WebGL texture to delete
|
|
118
|
-
* @param {number} [unit] - Texture unit to delete
|
|
119
118
|
*/
|
|
120
119
|
deleteTexture2D(texture) {
|
|
121
120
|
this.gl.deleteTexture(texture);
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/*!
|
|
2
|
-
* melonJS Game Engine - v15.
|
|
2
|
+
* melonJS Game Engine - v15.4.0
|
|
3
3
|
* http://www.melonjs.org
|
|
4
4
|
* melonjs is licensed under the MIT License.
|
|
5
5
|
* http://www.opensource.org/licenses/mit-license
|
|
@@ -16,7 +16,7 @@ import { minify } from './utils/string.js';
|
|
|
16
16
|
* @classdesc
|
|
17
17
|
* a base GL Shader object
|
|
18
18
|
*/
|
|
19
|
-
|
|
19
|
+
class GLShader {
|
|
20
20
|
/**
|
|
21
21
|
* @param {WebGLRenderingContext} gl - the current WebGL rendering context
|
|
22
22
|
* @param {string} vertex - a string containing the GLSL source code to set
|