melonjs 17.4.0 → 18.0.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/{dist/types → build}/application/application.d.ts +9 -10
- package/build/application/application.d.ts.map +1 -0
- package/build/application/defaultApplicationSettings.d.ts +18 -0
- package/build/application/defaultApplicationSettings.d.ts.map +1 -0
- package/{dist/types → build}/application/header.d.ts +1 -0
- package/build/application/header.d.ts.map +1 -0
- package/{dist/types → build}/application/resize.d.ts +1 -0
- package/build/application/resize.d.ts.map +1 -0
- package/build/application/scaleMethods.d.ts +44 -0
- package/build/application/scaleMethods.d.ts.map +1 -0
- package/build/application/settings.d.ts +85 -0
- package/build/application/settings.d.ts.map +1 -0
- package/{dist/types → build}/audio/audio.d.ts +35 -58
- package/build/audio/audio.d.ts.map +1 -0
- package/{dist/types → build}/camera/camera2d.d.ts +38 -76
- package/build/camera/camera2d.d.ts.map +1 -0
- package/build/const.d.ts +14 -0
- package/build/const.d.ts.map +1 -0
- package/build/geometries/earcut.d.ts +3 -0
- package/build/geometries/earcut.d.ts.map +1 -0
- package/build/geometries/ellipse.d.ts +117 -0
- package/build/geometries/ellipse.d.ts.map +1 -0
- package/build/geometries/line.d.ts +39 -0
- package/build/geometries/line.d.ts.map +1 -0
- package/build/geometries/observablePoint.d.ts +75 -0
- package/build/geometries/observablePoint.d.ts.map +1 -0
- package/{dist/types → build}/geometries/path2d.d.ts +8 -7
- package/build/geometries/path2d.d.ts.map +1 -0
- package/build/geometries/point.d.ts +44 -0
- package/build/geometries/point.d.ts.map +1 -0
- package/build/geometries/polygon.d.ts +182 -0
- package/build/geometries/polygon.d.ts.map +1 -0
- package/build/geometries/rectangle.d.ts +135 -0
- package/build/geometries/rectangle.d.ts.map +1 -0
- package/build/geometries/roundrect.d.ts +67 -0
- package/build/geometries/roundrect.d.ts.map +1 -0
- package/build/geometries/toarccanvas.d.ts +28 -0
- package/build/geometries/toarccanvas.d.ts.map +1 -0
- package/{dist/types → build}/index.d.ts +41 -45
- package/build/index.d.ts.map +1 -0
- package/build/index.js +28318 -0
- package/build/index.js.map +7 -0
- package/{dist/types → build}/input/gamepad.d.ts +3 -11
- package/build/input/gamepad.d.ts.map +1 -0
- package/{dist/types → build}/input/input.d.ts +4 -2
- package/build/input/input.d.ts.map +1 -0
- package/build/input/key.d.ts +105 -0
- package/build/input/key.d.ts.map +1 -0
- package/build/input/keyboard.d.ts +72 -0
- package/build/input/keyboard.d.ts.map +1 -0
- package/build/input/pointer.d.ts +180 -0
- package/build/input/pointer.d.ts.map +1 -0
- package/{dist/types → build}/input/pointerevent.d.ts +17 -16
- package/build/input/pointerevent.d.ts.map +1 -0
- package/{dist/types → build}/lang/console.d.ts +1 -0
- package/build/lang/console.d.ts.map +1 -0
- package/build/lang/deprecated.d.ts +24 -0
- package/build/lang/deprecated.d.ts.map +1 -0
- package/{dist/types → build}/level/level.d.ts +7 -7
- package/build/level/level.d.ts.map +1 -0
- package/{dist/types → build}/level/tiled/TMXGroup.d.ts +2 -2
- package/build/level/tiled/TMXGroup.d.ts.map +1 -0
- package/{dist/types → build}/level/tiled/TMXLayer.d.ts +4 -4
- package/build/level/tiled/TMXLayer.d.ts.map +1 -0
- package/{dist/types → build}/level/tiled/TMXObject.d.ts +3 -3
- package/build/level/tiled/TMXObject.d.ts.map +1 -0
- package/{dist/types → build}/level/tiled/TMXTile.d.ts +4 -5
- package/build/level/tiled/TMXTile.d.ts.map +1 -0
- package/{dist/types → build}/level/tiled/TMXTileMap.d.ts +4 -4
- package/build/level/tiled/TMXTileMap.d.ts.map +1 -0
- package/{dist/types → build}/level/tiled/TMXTileset.d.ts +2 -2
- package/build/level/tiled/TMXTileset.d.ts.map +1 -0
- package/{dist/types → build}/level/tiled/TMXTilesetGroup.d.ts +1 -1
- package/build/level/tiled/TMXTilesetGroup.d.ts.map +1 -0
- package/{dist/types → build}/level/tiled/TMXUtils.d.ts +2 -1
- package/build/level/tiled/TMXUtils.d.ts.map +1 -0
- package/{dist/types → build}/level/tiled/constants.d.ts +1 -0
- package/build/level/tiled/constants.d.ts.map +1 -0
- package/{dist/types → build}/level/tiled/renderer/TMXHexagonalRenderer.d.ts +3 -4
- package/build/level/tiled/renderer/TMXHexagonalRenderer.d.ts.map +1 -0
- package/{dist/types → build}/level/tiled/renderer/TMXIsometricRenderer.d.ts +2 -3
- package/build/level/tiled/renderer/TMXIsometricRenderer.d.ts.map +1 -0
- package/{dist/types → build}/level/tiled/renderer/TMXOrthogonalRenderer.d.ts +1 -2
- package/build/level/tiled/renderer/TMXOrthogonalRenderer.d.ts.map +1 -0
- package/{dist/types → build}/level/tiled/renderer/TMXRenderer.d.ts +7 -7
- package/build/level/tiled/renderer/TMXRenderer.d.ts.map +1 -0
- package/{dist/types → build}/level/tiled/renderer/TMXStaggeredRenderer.d.ts +1 -2
- package/build/level/tiled/renderer/TMXStaggeredRenderer.d.ts.map +1 -0
- package/{dist/types → build}/level/tiled/renderer/autodetect.d.ts +4 -3
- package/build/level/tiled/renderer/autodetect.d.ts.map +1 -0
- package/build/loader/cache.d.ts +10 -0
- package/build/loader/cache.d.ts.map +1 -0
- package/{dist/types → build}/loader/loader.d.ts +19 -13
- package/build/loader/loader.d.ts.map +1 -0
- package/{dist/types → build}/loader/loadingscreen.d.ts +1 -0
- package/build/loader/loadingscreen.d.ts.map +1 -0
- package/{dist/types → build}/loader/parsers/binary.d.ts +2 -1
- package/build/loader/parsers/binary.d.ts.map +1 -0
- package/{dist/types → build}/loader/parsers/compressed_textures/compressed_image.d.ts +1 -0
- package/build/loader/parsers/compressed_textures/compressed_image.d.ts.map +1 -0
- package/build/loader/parsers/compressed_textures/parseDDS.d.ts +2 -0
- package/build/loader/parsers/compressed_textures/parseDDS.d.ts.map +1 -0
- package/build/loader/parsers/compressed_textures/parseKTX.d.ts +2 -0
- package/build/loader/parsers/compressed_textures/parseKTX.d.ts.map +1 -0
- package/build/loader/parsers/compressed_textures/parseKTX2.d.ts +2 -0
- package/build/loader/parsers/compressed_textures/parseKTX2.d.ts.map +1 -0
- package/build/loader/parsers/compressed_textures/parsePKM.d.ts +2 -0
- package/build/loader/parsers/compressed_textures/parsePKM.d.ts.map +1 -0
- package/build/loader/parsers/compressed_textures/parsePVR.d.ts +2 -0
- package/build/loader/parsers/compressed_textures/parsePVR.d.ts.map +1 -0
- package/{dist/types → build}/loader/parsers/fetchdata.d.ts +2 -1
- package/build/loader/parsers/fetchdata.d.ts.map +1 -0
- package/{dist/types → build}/loader/parsers/fontface.d.ts +2 -1
- package/build/loader/parsers/fontface.d.ts.map +1 -0
- package/{dist/types → build}/loader/parsers/image.d.ts +2 -1
- package/build/loader/parsers/image.d.ts.map +1 -0
- package/{dist/types → build}/loader/parsers/json.d.ts +2 -1
- package/build/loader/parsers/json.d.ts.map +1 -0
- package/{dist/types → build}/loader/parsers/script.d.ts +2 -1
- package/build/loader/parsers/script.d.ts.map +1 -0
- package/{dist/types → build}/loader/parsers/tmx.d.ts +2 -1
- package/build/loader/parsers/tmx.d.ts.map +1 -0
- package/{dist/types → build}/loader/parsers/video.d.ts +2 -1
- package/build/loader/parsers/video.d.ts.map +1 -0
- package/build/math/color.d.ts +192 -0
- package/build/math/color.d.ts.map +1 -0
- package/build/math/math.d.ts +128 -0
- package/build/math/math.d.ts.map +1 -0
- package/build/math/matrix2d.d.ts +163 -0
- package/build/math/matrix2d.d.ts.map +1 -0
- package/build/math/matrix3d.d.ts +188 -0
- package/build/math/matrix3d.d.ts.map +1 -0
- package/build/math/observableVector2d.d.ts +286 -0
- package/build/math/observableVector2d.d.ts.map +1 -0
- package/build/math/observableVector2d_old.d.ts +76 -0
- package/build/math/observableVector2d_old.d.ts.map +1 -0
- package/build/math/observableVector3d.d.ts +283 -0
- package/build/math/observableVector3d.d.ts.map +1 -0
- package/build/math/observableVector3d_old.d.ts +81 -0
- package/build/math/observableVector3d_old.d.ts.map +1 -0
- package/build/math/vector2d.d.ts +253 -0
- package/build/math/vector2d.d.ts.map +1 -0
- package/build/math/vector3d.d.ts +242 -0
- package/build/math/vector3d.d.ts.map +1 -0
- package/{dist/types → build}/particles/emitter.d.ts +7 -10
- package/build/particles/emitter.d.ts.map +1 -0
- package/build/particles/particle.d.ts +47 -0
- package/build/particles/particle.d.ts.map +1 -0
- package/{dist/types → build}/particles/settings.d.ts +1 -0
- package/build/particles/settings.d.ts.map +1 -0
- package/{dist/types → build}/physics/body.d.ts +27 -27
- package/build/physics/body.d.ts.map +1 -0
- package/build/physics/bounds.d.ts +192 -0
- package/build/physics/bounds.d.ts.map +1 -0
- package/{dist/types → build}/physics/collision.d.ts +5 -5
- package/build/physics/collision.d.ts.map +1 -0
- package/{dist/types → build}/physics/detector.d.ts +8 -6
- package/build/physics/detector.d.ts.map +1 -0
- package/{dist/types → build}/physics/quadtree.d.ts +5 -19
- package/build/physics/quadtree.d.ts.map +1 -0
- package/{dist/types → build}/physics/response.d.ts +46 -5
- package/build/physics/response.d.ts.map +1 -0
- package/{dist/types → build}/physics/sat.d.ts +3 -2
- package/build/physics/sat.d.ts.map +1 -0
- package/{dist/types → build}/physics/world.d.ts +5 -4
- package/build/physics/world.d.ts.map +1 -0
- package/{dist/types → build}/plugin/plugin.d.ts +8 -19
- package/build/plugin/plugin.d.ts.map +1 -0
- package/build/polyfill/console.d.ts +2 -0
- package/build/polyfill/console.d.ts.map +1 -0
- package/build/polyfill/index.d.ts +6 -0
- package/build/polyfill/index.d.ts.map +1 -0
- package/build/polyfill/roundrect.d.ts +2 -0
- package/build/polyfill/roundrect.d.ts.map +1 -0
- package/build/pool.d.ts +39 -0
- package/build/pool.d.ts.map +1 -0
- package/{dist/types → build}/renderable/collectable.d.ts +2 -2
- package/build/renderable/collectable.d.ts.map +1 -0
- package/{dist/types → build}/renderable/colorlayer.d.ts +6 -10
- package/build/renderable/colorlayer.d.ts.map +1 -0
- package/{dist/types → build}/renderable/container.d.ts +14 -15
- package/build/renderable/container.d.ts.map +1 -0
- package/{dist/types → build}/renderable/draggable.d.ts +5 -13
- package/build/renderable/draggable.d.ts.map +1 -0
- package/{dist/types → build}/renderable/dragndrop.d.ts +7 -21
- package/build/renderable/dragndrop.d.ts.map +1 -0
- package/{dist/types → build}/renderable/entity/entity.d.ts +12 -13
- package/build/renderable/entity/entity.d.ts.map +1 -0
- package/{dist/types → build}/renderable/imagelayer.d.ts +17 -9
- package/build/renderable/imagelayer.d.ts.map +1 -0
- package/build/renderable/light2d.d.ts +73 -0
- package/build/renderable/light2d.d.ts.map +1 -0
- package/{dist/types → build}/renderable/nineslicesprite.d.ts +3 -4
- package/build/renderable/nineslicesprite.d.ts.map +1 -0
- package/{dist/types → build}/renderable/renderable.d.ts +57 -60
- package/build/renderable/renderable.d.ts.map +1 -0
- package/{dist/types → build}/renderable/sprite.d.ts +28 -14
- package/build/renderable/sprite.d.ts.map +1 -0
- package/{dist/types → build}/renderable/text/bitmaptext.d.ts +6 -7
- package/build/renderable/text/bitmaptext.d.ts.map +1 -0
- package/build/renderable/text/bitmaptextdata.d.ts +17 -0
- package/build/renderable/text/bitmaptextdata.d.ts.map +1 -0
- package/{dist/types → build}/renderable/text/glyph.d.ts +15 -3
- package/build/renderable/text/glyph.d.ts.map +1 -0
- package/{dist/types → build}/renderable/text/text.d.ts +7 -16
- package/build/renderable/text/text.d.ts.map +1 -0
- package/{dist/types → build}/renderable/text/textmetrics.d.ts +8 -9
- package/build/renderable/text/textmetrics.d.ts.map +1 -0
- package/{dist/types → build}/renderable/text/textstyle.d.ts +1 -0
- package/build/renderable/text/textstyle.d.ts.map +1 -0
- package/{dist/types → build}/renderable/trigger.d.ts +18 -7
- package/build/renderable/trigger.d.ts.map +1 -0
- package/{dist/types → build}/renderable/ui/uibaseelement.d.ts +7 -7
- package/build/renderable/ui/uibaseelement.d.ts.map +1 -0
- package/{dist/types → build}/renderable/ui/uispriteelement.d.ts +4 -6
- package/build/renderable/ui/uispriteelement.d.ts.map +1 -0
- package/{dist/types → build}/renderable/ui/uitextbutton.d.ts +17 -4
- package/build/renderable/ui/uitextbutton.d.ts.map +1 -0
- package/{dist/types → build}/state/stage.d.ts +3 -3
- package/build/state/stage.d.ts.map +1 -0
- package/{dist/types → build}/state/state.d.ts +10 -9
- package/build/state/state.d.ts.map +1 -0
- package/{dist/types → build}/system/device.d.ts +49 -80
- package/build/system/device.d.ts.map +1 -0
- package/build/system/dom.d.ts +2 -0
- package/build/system/dom.d.ts.map +1 -0
- package/{dist/types → build}/system/event.d.ts +124 -291
- package/build/system/event.d.ts.map +1 -0
- package/build/system/eventEmitter.d.ts +19 -0
- package/build/system/eventEmitter.d.ts.map +1 -0
- package/build/system/eventEmitter.spec.d.ts +2 -0
- package/build/system/eventEmitter.spec.d.ts.map +1 -0
- package/{dist/types/system/pooling.d.ts → build/system/legacy_pool.d.ts} +22 -7
- package/build/system/legacy_pool.d.ts.map +1 -0
- package/build/system/platform.d.ts +34 -0
- package/build/system/platform.d.ts.map +1 -0
- package/build/system/pool.d.ts +26 -0
- package/build/system/pool.d.ts.map +1 -0
- package/build/system/save.d.ts +3 -0
- package/build/system/save.d.ts.map +1 -0
- package/build/system/timer.d.ts +118 -0
- package/build/system/timer.d.ts.map +1 -0
- package/build/tweens/easing.d.ts +93 -0
- package/build/tweens/easing.d.ts.map +1 -0
- package/build/tweens/interpolation.d.ts +7 -0
- package/build/tweens/interpolation.d.ts.map +1 -0
- package/build/tweens/tween.d.ts +234 -0
- package/build/tweens/tween.d.ts.map +1 -0
- package/build/utils/agent.d.ts +16 -0
- package/build/utils/agent.d.ts.map +1 -0
- package/build/utils/array-multimap.d.ts +14 -0
- package/build/utils/array-multimap.d.ts.map +1 -0
- package/build/utils/array.d.ts +30 -0
- package/build/utils/array.d.ts.map +1 -0
- package/build/utils/file.d.ts +16 -0
- package/build/utils/file.d.ts.map +1 -0
- package/build/utils/function.d.ts +24 -0
- package/build/utils/function.d.ts.map +1 -0
- package/build/utils/semver.d.ts +2 -0
- package/build/utils/semver.d.ts.map +1 -0
- package/build/utils/string.d.ts +35 -0
- package/build/utils/string.d.ts.map +1 -0
- package/build/utils/types.d.ts +5 -0
- package/build/utils/types.d.ts.map +1 -0
- package/build/utils/utils.d.ts +49 -0
- package/build/utils/utils.d.ts.map +1 -0
- package/build/version.d.ts +5 -0
- package/build/version.d.ts.map +1 -0
- package/{dist/types → build}/video/canvas/canvas_renderer.d.ts +40 -32
- package/build/video/canvas/canvas_renderer.d.ts.map +1 -0
- package/{dist/types → build}/video/renderer.d.ts +36 -29
- package/build/video/renderer.d.ts.map +1 -0
- package/{dist/types → build}/video/rendertarget/canvasrendertarget.d.ts +8 -26
- package/build/video/rendertarget/canvasrendertarget.d.ts.map +1 -0
- package/{dist/types → build}/video/texture/atlas.d.ts +8 -8
- package/build/video/texture/atlas.d.ts.map +1 -0
- package/{dist/types → build}/video/texture/cache.d.ts +4 -3
- package/build/video/texture/cache.d.ts.map +1 -0
- package/{dist/types → build}/video/texture/parser/aseprite.d.ts +1 -0
- package/build/video/texture/parser/aseprite.d.ts.map +1 -0
- package/{dist/types → build}/video/texture/parser/spritesheet.d.ts +1 -0
- package/build/video/texture/parser/spritesheet.d.ts.map +1 -0
- package/{dist/types → build}/video/texture/parser/texturepacker.d.ts +1 -0
- package/build/video/texture/parser/texturepacker.d.ts.map +1 -0
- package/build/video/utils/autodetect.d.ts +8 -0
- package/build/video/utils/autodetect.d.ts.map +1 -0
- package/{dist/types → build}/video/video.d.ts +4 -3
- package/build/video/video.d.ts.map +1 -0
- package/{dist/types → build}/video/webgl/buffer/vertex.d.ts +5 -6
- package/build/video/webgl/buffer/vertex.d.ts.map +1 -0
- package/{dist/types → build}/video/webgl/compositors/compositor.d.ts +4 -4
- package/build/video/webgl/compositors/compositor.d.ts.map +1 -0
- package/{dist/types → build}/video/webgl/compositors/primitive_compositor.d.ts +4 -5
- package/build/video/webgl/compositors/primitive_compositor.d.ts.map +1 -0
- package/{dist/types → build}/video/webgl/compositors/quad_compositor.d.ts +4 -5
- package/build/video/webgl/compositors/quad_compositor.d.ts.map +1 -0
- package/{dist/types → build}/video/webgl/glshader.d.ts +2 -2
- package/build/video/webgl/glshader.d.ts.map +1 -0
- package/{dist/types → build}/video/webgl/utils/attributes.d.ts +1 -0
- package/build/video/webgl/utils/attributes.d.ts.map +1 -0
- package/{dist/types → build}/video/webgl/utils/precision.d.ts +1 -0
- package/build/video/webgl/utils/precision.d.ts.map +1 -0
- package/{dist/types → build}/video/webgl/utils/program.d.ts +1 -0
- package/build/video/webgl/utils/program.d.ts.map +1 -0
- package/{dist/types → build}/video/webgl/utils/string.d.ts +1 -0
- package/build/video/webgl/utils/string.d.ts.map +1 -0
- package/{dist/types → build}/video/webgl/utils/uniforms.d.ts +1 -0
- package/build/video/webgl/utils/uniforms.d.ts.map +1 -0
- package/{dist/types → build}/video/webgl/webgl_renderer.d.ts +37 -29
- package/build/video/webgl/webgl_renderer.d.ts.map +1 -0
- package/package.json +83 -104
- package/LICENSE.md +0 -21
- package/README.md +0 -223
- package/dist/melonjs.mjs/_virtual/_commonjsHelpers.js +0 -14
- package/dist/melonjs.mjs/_virtual/earcut.js +0 -10
- package/dist/melonjs.mjs/_virtual/howler.js +0 -10
- package/dist/melonjs.mjs/_virtual/index.js +0 -10
- package/dist/melonjs.mjs/_virtual/re.js +0 -10
- package/dist/melonjs.mjs/application/application.js +0 -443
- package/dist/melonjs.mjs/application/header.js +0 -40
- package/dist/melonjs.mjs/application/resize.js +0 -128
- package/dist/melonjs.mjs/application/settings.js +0 -70
- package/dist/melonjs.mjs/audio/audio.js +0 -623
- package/dist/melonjs.mjs/camera/camera2d.js +0 -737
- package/dist/melonjs.mjs/const.js +0 -32
- package/dist/melonjs.mjs/geometries/ellipse.js +0 -253
- package/dist/melonjs.mjs/geometries/line.js +0 -113
- package/dist/melonjs.mjs/geometries/path2d.js +0 -479
- package/dist/melonjs.mjs/geometries/point.js +0 -85
- package/dist/melonjs.mjs/geometries/poly.js +0 -441
- package/dist/melonjs.mjs/geometries/rectangle.js +0 -335
- package/dist/melonjs.mjs/geometries/roundrect.js +0 -165
- package/dist/melonjs.mjs/geometries/toarccanvas.js +0 -103
- package/dist/melonjs.mjs/index.js +0 -239
- package/dist/melonjs.mjs/input/gamepad.js +0 -495
- package/dist/melonjs.mjs/input/input.js +0 -26
- package/dist/melonjs.mjs/input/keyboard.js +0 -470
- package/dist/melonjs.mjs/input/pointer.js +0 -393
- package/dist/melonjs.mjs/input/pointerevent.js +0 -807
- package/dist/melonjs.mjs/lang/console.js +0 -44
- package/dist/melonjs.mjs/lang/deprecated.js +0 -200
- package/dist/melonjs.mjs/level/level.js +0 -298
- package/dist/melonjs.mjs/level/tiled/TMXGroup.js +0 -120
- package/dist/melonjs.mjs/level/tiled/TMXLayer.js +0 -432
- package/dist/melonjs.mjs/level/tiled/TMXObject.js +0 -295
- package/dist/melonjs.mjs/level/tiled/TMXTile.js +0 -177
- package/dist/melonjs.mjs/level/tiled/TMXTileMap.js +0 -574
- package/dist/melonjs.mjs/level/tiled/TMXTileset.js +0 -292
- package/dist/melonjs.mjs/level/tiled/TMXTilesetGroup.js +0 -74
- package/dist/melonjs.mjs/level/tiled/TMXUtils.js +0 -417
- package/dist/melonjs.mjs/level/tiled/constants.js +0 -17
- package/dist/melonjs.mjs/level/tiled/renderer/TMXHexagonalRenderer.js +0 -503
- package/dist/melonjs.mjs/level/tiled/renderer/TMXIsometricRenderer.js +0 -215
- package/dist/melonjs.mjs/level/tiled/renderer/TMXOrthogonalRenderer.js +0 -155
- package/dist/melonjs.mjs/level/tiled/renderer/TMXRenderer.js +0 -113
- package/dist/melonjs.mjs/level/tiled/renderer/TMXStaggeredRenderer.js +0 -107
- package/dist/melonjs.mjs/level/tiled/renderer/autodetect.js +0 -38
- package/dist/melonjs.mjs/loader/cache.js +0 -30
- package/dist/melonjs.mjs/loader/loader.js +0 -729
- package/dist/melonjs.mjs/loader/loadingscreen.js +0 -118
- package/dist/melonjs.mjs/loader/melonjs_logo.png.js +0 -10
- package/dist/melonjs.mjs/loader/parsers/binary.js +0 -42
- package/dist/melonjs.mjs/loader/parsers/compressed_textures/compressed_image.js +0 -58
- package/dist/melonjs.mjs/loader/parsers/compressed_textures/parseDDS.js +0 -13
- package/dist/melonjs.mjs/loader/parsers/compressed_textures/parseKTX.js +0 -13
- package/dist/melonjs.mjs/loader/parsers/compressed_textures/parseKTX2.js +0 -13
- package/dist/melonjs.mjs/loader/parsers/compressed_textures/parsePKM.js +0 -13
- package/dist/melonjs.mjs/loader/parsers/compressed_textures/parsePVR.js +0 -136
- package/dist/melonjs.mjs/loader/parsers/fetchdata.js +0 -62
- package/dist/melonjs.mjs/loader/parsers/fontface.js +0 -62
- package/dist/melonjs.mjs/loader/parsers/image.js +0 -129
- package/dist/melonjs.mjs/loader/parsers/json.js +0 -43
- package/dist/melonjs.mjs/loader/parsers/script.js +0 -46
- package/dist/melonjs.mjs/loader/parsers/tmx.js +0 -103
- package/dist/melonjs.mjs/loader/parsers/video.js +0 -99
- package/dist/melonjs.mjs/math/color.js +0 -635
- package/dist/melonjs.mjs/math/math.js +0 -221
- package/dist/melonjs.mjs/math/matrix2.js +0 -495
- package/dist/melonjs.mjs/math/matrix3.js +0 -628
- package/dist/melonjs.mjs/math/observable_vector2.js +0 -468
- package/dist/melonjs.mjs/math/observable_vector3.js +0 -564
- package/dist/melonjs.mjs/math/vector2.js +0 -431
- package/dist/melonjs.mjs/math/vector3.js +0 -473
- package/dist/melonjs.mjs/node_modules/@teppeis/multimaps/dist/esm/arraymultimap.js +0 -45
- package/dist/melonjs.mjs/node_modules/@teppeis/multimaps/dist/esm/multimap.js +0 -130
- package/dist/melonjs.mjs/node_modules/earcut/src/earcut.js +0 -694
- package/dist/melonjs.mjs/node_modules/eventemitter3/index.js +0 -352
- package/dist/melonjs.mjs/node_modules/eventemitter3/index2.js +0 -12
- package/dist/melonjs.mjs/node_modules/howler/dist/howler.js +0 -3246
- package/dist/melonjs.mjs/node_modules/semver/classes/comparator.js +0 -165
- package/dist/melonjs.mjs/node_modules/semver/classes/range.js +0 -565
- package/dist/melonjs.mjs/node_modules/semver/classes/semver.js +0 -317
- package/dist/melonjs.mjs/node_modules/semver/functions/clean.js +0 -17
- package/dist/melonjs.mjs/node_modules/semver/functions/cmp.js +0 -68
- package/dist/melonjs.mjs/node_modules/semver/functions/coerce.js +0 -73
- package/dist/melonjs.mjs/node_modules/semver/functions/compare-build.js +0 -18
- package/dist/melonjs.mjs/node_modules/semver/functions/compare-loose.js +0 -14
- package/dist/melonjs.mjs/node_modules/semver/functions/compare.js +0 -16
- package/dist/melonjs.mjs/node_modules/semver/functions/diff.js +0 -76
- package/dist/melonjs.mjs/node_modules/semver/functions/eq.js +0 -14
- package/dist/melonjs.mjs/node_modules/semver/functions/gt.js +0 -14
- package/dist/melonjs.mjs/node_modules/semver/functions/gte.js +0 -14
- package/dist/melonjs.mjs/node_modules/semver/functions/inc.js +0 -30
- package/dist/melonjs.mjs/node_modules/semver/functions/lt.js +0 -14
- package/dist/melonjs.mjs/node_modules/semver/functions/lte.js +0 -14
- package/dist/melonjs.mjs/node_modules/semver/functions/major.js +0 -14
- package/dist/melonjs.mjs/node_modules/semver/functions/minor.js +0 -14
- package/dist/melonjs.mjs/node_modules/semver/functions/neq.js +0 -14
- package/dist/melonjs.mjs/node_modules/semver/functions/parse.js +0 -27
- package/dist/melonjs.mjs/node_modules/semver/functions/patch.js +0 -14
- package/dist/melonjs.mjs/node_modules/semver/functions/prerelease.js +0 -17
- package/dist/melonjs.mjs/node_modules/semver/functions/rcompare.js +0 -14
- package/dist/melonjs.mjs/node_modules/semver/functions/rsort.js +0 -14
- package/dist/melonjs.mjs/node_modules/semver/functions/satisfies.js +0 -21
- package/dist/melonjs.mjs/node_modules/semver/functions/sort.js +0 -14
- package/dist/melonjs.mjs/node_modules/semver/functions/valid.js +0 -17
- package/dist/melonjs.mjs/node_modules/semver/index.js +0 -140
- package/dist/melonjs.mjs/node_modules/semver/internal/constants.js +0 -44
- package/dist/melonjs.mjs/node_modules/semver/internal/debug.js +0 -18
- package/dist/melonjs.mjs/node_modules/semver/internal/identifiers.js +0 -32
- package/dist/melonjs.mjs/node_modules/semver/internal/lrucache.js +0 -49
- package/dist/melonjs.mjs/node_modules/semver/internal/parse-options.js +0 -24
- package/dist/melonjs.mjs/node_modules/semver/internal/re.js +0 -234
- package/dist/melonjs.mjs/node_modules/semver/ranges/gtr.js +0 -15
- package/dist/melonjs.mjs/node_modules/semver/ranges/intersects.js +0 -18
- package/dist/melonjs.mjs/node_modules/semver/ranges/ltr.js +0 -15
- package/dist/melonjs.mjs/node_modules/semver/ranges/max-satisfying.js +0 -37
- package/dist/melonjs.mjs/node_modules/semver/ranges/min-satisfying.js +0 -36
- package/dist/melonjs.mjs/node_modules/semver/ranges/min-version.js +0 -74
- package/dist/melonjs.mjs/node_modules/semver/ranges/outside.js +0 -98
- package/dist/melonjs.mjs/node_modules/semver/ranges/simplify.js +0 -59
- package/dist/melonjs.mjs/node_modules/semver/ranges/subset.js +0 -261
- package/dist/melonjs.mjs/node_modules/semver/ranges/to-comparators.js +0 -19
- package/dist/melonjs.mjs/node_modules/semver/ranges/valid.js +0 -22
- package/dist/melonjs.mjs/particles/emitter.js +0 -265
- package/dist/melonjs.mjs/particles/particle.js +0 -190
- package/dist/melonjs.mjs/particles/settings.js +0 -317
- package/dist/melonjs.mjs/physics/body.js +0 -717
- package/dist/melonjs.mjs/physics/bounds.js +0 -415
- package/dist/melonjs.mjs/physics/collision.js +0 -135
- package/dist/melonjs.mjs/physics/detector.js +0 -227
- package/dist/melonjs.mjs/physics/quadtree.js +0 -402
- package/dist/melonjs.mjs/physics/response.js +0 -57
- package/dist/melonjs.mjs/physics/sat.js +0 -492
- package/dist/melonjs.mjs/physics/world.js +0 -228
- package/dist/melonjs.mjs/plugin/plugin.js +0 -172
- package/dist/melonjs.mjs/renderable/collectable.js +0 -60
- package/dist/melonjs.mjs/renderable/colorlayer.js +0 -83
- package/dist/melonjs.mjs/renderable/container.js +0 -1016
- package/dist/melonjs.mjs/renderable/draggable.js +0 -121
- package/dist/melonjs.mjs/renderable/dragndrop.js +0 -119
- package/dist/melonjs.mjs/renderable/entity/entity.js +0 -263
- package/dist/melonjs.mjs/renderable/imagelayer.js +0 -293
- package/dist/melonjs.mjs/renderable/light2d.js +0 -172
- package/dist/melonjs.mjs/renderable/nineslicesprite.js +0 -248
- package/dist/melonjs.mjs/renderable/renderable.js +0 -878
- package/dist/melonjs.mjs/renderable/sprite.js +0 -700
- package/dist/melonjs.mjs/renderable/text/bitmaptext.js +0 -421
- package/dist/melonjs.mjs/renderable/text/bitmaptextdata.js +0 -195
- package/dist/melonjs.mjs/renderable/text/glyph.js +0 -65
- package/dist/melonjs.mjs/renderable/text/text.js +0 -424
- package/dist/melonjs.mjs/renderable/text/textmetrics.js +0 -176
- package/dist/melonjs.mjs/renderable/text/textstyle.js +0 -21
- package/dist/melonjs.mjs/renderable/trigger.js +0 -163
- package/dist/melonjs.mjs/renderable/ui/uibaseelement.js +0 -285
- package/dist/melonjs.mjs/renderable/ui/uispriteelement.js +0 -231
- package/dist/melonjs.mjs/renderable/ui/uitextbutton.js +0 -146
- package/dist/melonjs.mjs/state/stage.js +0 -235
- package/dist/melonjs.mjs/state/state.js +0 -548
- package/dist/melonjs.mjs/system/device.js +0 -872
- package/dist/melonjs.mjs/system/dom.js +0 -79
- package/dist/melonjs.mjs/system/event.js +0 -606
- package/dist/melonjs.mjs/system/platform.js +0 -43
- package/dist/melonjs.mjs/system/pooling.js +0 -182
- package/dist/melonjs.mjs/system/save.js +0 -157
- package/dist/melonjs.mjs/system/timer.js +0 -274
- package/dist/melonjs.mjs/tweens/easing.js +0 -334
- package/dist/melonjs.mjs/tweens/interpolation.js +0 -112
- package/dist/melonjs.mjs/tweens/tween.js +0 -479
- package/dist/melonjs.mjs/utils/agent.js +0 -77
- package/dist/melonjs.mjs/utils/array.js +0 -63
- package/dist/melonjs.mjs/utils/file.js +0 -54
- package/dist/melonjs.mjs/utils/function.js +0 -69
- package/dist/melonjs.mjs/utils/string.js +0 -82
- package/dist/melonjs.mjs/utils/utils.js +0 -139
- package/dist/melonjs.mjs/video/canvas/canvas_renderer.js +0 -914
- package/dist/melonjs.mjs/video/renderer.js +0 -402
- package/dist/melonjs.mjs/video/rendertarget/canvasrendertarget.js +0 -316
- package/dist/melonjs.mjs/video/texture/atlas.js +0 -465
- package/dist/melonjs.mjs/video/texture/cache.js +0 -186
- package/dist/melonjs.mjs/video/texture/parser/aseprite.js +0 -78
- package/dist/melonjs.mjs/video/texture/parser/spritesheet.js +0 -77
- package/dist/melonjs.mjs/video/texture/parser/texturepacker.js +0 -64
- package/dist/melonjs.mjs/video/utils/autodetect.js +0 -27
- package/dist/melonjs.mjs/video/video.js +0 -142
- package/dist/melonjs.mjs/video/webgl/buffer/vertex.js +0 -146
- package/dist/melonjs.mjs/video/webgl/compositors/compositor.js +0 -240
- package/dist/melonjs.mjs/video/webgl/compositors/primitive_compositor.js +0 -82
- package/dist/melonjs.mjs/video/webgl/compositors/quad_compositor.js +0 -259
- package/dist/melonjs.mjs/video/webgl/glshader.js +0 -166
- package/dist/melonjs.mjs/video/webgl/shaders/primitive.frag.js +0 -10
- package/dist/melonjs.mjs/video/webgl/shaders/primitive.vert.js +0 -10
- package/dist/melonjs.mjs/video/webgl/shaders/quad.frag.js +0 -10
- package/dist/melonjs.mjs/video/webgl/shaders/quad.vert.js +0 -10
- package/dist/melonjs.mjs/video/webgl/utils/attributes.js +0 -25
- package/dist/melonjs.mjs/video/webgl/utils/precision.js +0 -38
- package/dist/melonjs.mjs/video/webgl/utils/program.js +0 -67
- package/dist/melonjs.mjs/video/webgl/utils/string.js +0 -25
- package/dist/melonjs.mjs/video/webgl/utils/uniforms.js +0 -92
- package/dist/melonjs.mjs/video/webgl/webgl_renderer.js +0 -1246
- package/dist/melonjs.module.js +0 -43200
- package/dist/types/application/settings.d.ts +0 -106
- package/dist/types/const.d.ts +0 -21
- package/dist/types/geometries/ellipse.d.ts +0 -138
- package/dist/types/geometries/line.d.ts +0 -15
- package/dist/types/geometries/point.d.ts +0 -50
- package/dist/types/geometries/poly.d.ts +0 -186
- package/dist/types/geometries/rectangle.d.ts +0 -135
- package/dist/types/geometries/roundrect.d.ts +0 -43
- package/dist/types/geometries/toarccanvas.d.ts +0 -10
- package/dist/types/input/keyboard.d.ts +0 -205
- package/dist/types/input/pointer.d.ts +0 -261
- package/dist/types/lang/deprecated.d.ts +0 -68
- package/dist/types/loader/cache.d.ts +0 -9
- package/dist/types/loader/parsers/compressed_textures/parseDDS.d.ts +0 -1
- package/dist/types/loader/parsers/compressed_textures/parseKTX.d.ts +0 -1
- package/dist/types/loader/parsers/compressed_textures/parseKTX2.d.ts +0 -1
- package/dist/types/loader/parsers/compressed_textures/parsePKM.d.ts +0 -1
- package/dist/types/loader/parsers/compressed_textures/parsePVR.d.ts +0 -1
- package/dist/types/math/color.d.ts +0 -179
- package/dist/types/math/math.d.ts +0 -149
- package/dist/types/math/matrix2.d.ts +0 -174
- package/dist/types/math/matrix3.d.ts +0 -186
- package/dist/types/math/observable_vector2.d.ts +0 -278
- package/dist/types/math/observable_vector3.d.ts +0 -300
- package/dist/types/math/vector2.d.ts +0 -255
- package/dist/types/math/vector3.d.ts +0 -271
- package/dist/types/particles/particle.d.ts +0 -36
- package/dist/types/physics/bounds.d.ts +0 -203
- package/dist/types/polyfill/console.d.ts +0 -1
- package/dist/types/polyfill/index.d.ts +0 -1
- package/dist/types/polyfill/roundrect.d.ts +0 -1
- package/dist/types/renderable/light2d.d.ts +0 -60
- package/dist/types/renderable/text/bitmaptextdata.d.ts +0 -35
- package/dist/types/system/dom.d.ts +0 -1
- package/dist/types/system/platform.d.ts +0 -33
- package/dist/types/system/save.d.ts +0 -25
- package/dist/types/system/timer.d.ts +0 -126
- package/dist/types/tweens/easing.d.ts +0 -46
- package/dist/types/tweens/interpolation.d.ts +0 -18
- package/dist/types/tweens/tween.d.ts +0 -195
- package/dist/types/utils/agent.d.ts +0 -21
- package/dist/types/utils/array.d.ts +0 -39
- package/dist/types/utils/file.d.ts +0 -27
- package/dist/types/utils/function.d.ts +0 -31
- package/dist/types/utils/string.d.ts +0 -50
- package/dist/types/utils/utils.d.ts +0 -54
- package/dist/types/video/utils/autodetect.d.ts +0 -5
- package/src/application/application.js +0 -435
- package/src/application/header.js +0 -31
- package/src/application/resize.js +0 -119
- package/src/application/settings.js +0 -61
- package/src/audio/audio.js +0 -622
- package/src/camera/camera2d.js +0 -731
- package/src/const.js +0 -23
- package/src/geometries/ellipse.js +0 -244
- package/src/geometries/line.js +0 -104
- package/src/geometries/path2d.js +0 -470
- package/src/geometries/point.js +0 -76
- package/src/geometries/poly.js +0 -432
- package/src/geometries/rectangle.js +0 -326
- package/src/geometries/roundrect.js +0 -156
- package/src/geometries/toarccanvas.js +0 -94
- package/src/index.js +0 -315
- package/src/input/gamepad.js +0 -487
- package/src/input/input.js +0 -17
- package/src/input/keyboard.js +0 -461
- package/src/input/pointer.js +0 -386
- package/src/input/pointerevent.js +0 -798
- package/src/lang/console.js +0 -36
- package/src/lang/deprecated.js +0 -192
- package/src/level/level.js +0 -290
- package/src/level/tiled/TMXGroup.js +0 -111
- package/src/level/tiled/TMXLayer.js +0 -424
- package/src/level/tiled/TMXObject.js +0 -286
- package/src/level/tiled/TMXTile.js +0 -168
- package/src/level/tiled/TMXTileMap.js +0 -569
- package/src/level/tiled/TMXTileset.js +0 -284
- package/src/level/tiled/TMXTilesetGroup.js +0 -66
- package/src/level/tiled/TMXUtils.js +0 -408
- package/src/level/tiled/constants.js +0 -8
- package/src/level/tiled/renderer/TMXHexagonalRenderer.js +0 -497
- package/src/level/tiled/renderer/TMXIsometricRenderer.js +0 -208
- package/src/level/tiled/renderer/TMXOrthogonalRenderer.js +0 -149
- package/src/level/tiled/renderer/TMXRenderer.js +0 -103
- package/src/level/tiled/renderer/TMXStaggeredRenderer.js +0 -100
- package/src/level/tiled/renderer/autodetect.js +0 -29
- package/src/loader/cache.js +0 -22
- package/src/loader/loader.js +0 -728
- package/src/loader/loadingscreen.js +0 -112
- package/src/loader/melonjs_logo.png +0 -0
- package/src/loader/parsers/binary.js +0 -33
- package/src/loader/parsers/compressed_textures/compressed_image.js +0 -49
- package/src/loader/parsers/compressed_textures/parseDDS.js +0 -5
- package/src/loader/parsers/compressed_textures/parseKTX.js +0 -5
- package/src/loader/parsers/compressed_textures/parseKTX2.js +0 -5
- package/src/loader/parsers/compressed_textures/parsePKM.js +0 -5
- package/src/loader/parsers/compressed_textures/parsePVR.js +0 -127
- package/src/loader/parsers/fetchdata.js +0 -53
- package/src/loader/parsers/fontface.js +0 -54
- package/src/loader/parsers/image.js +0 -120
- package/src/loader/parsers/json.js +0 -35
- package/src/loader/parsers/script.js +0 -37
- package/src/loader/parsers/tmx.js +0 -95
- package/src/loader/parsers/video.js +0 -90
- package/src/math/color.js +0 -627
- package/src/math/math.js +0 -212
- package/src/math/matrix2.js +0 -487
- package/src/math/matrix3.js +0 -620
- package/src/math/observable_vector2.js +0 -460
- package/src/math/observable_vector3.js +0 -556
- package/src/math/vector2.js +0 -423
- package/src/math/vector3.js +0 -465
- package/src/particles/emitter.js +0 -258
- package/src/particles/particle.js +0 -182
- package/src/particles/settings.js +0 -310
- package/src/physics/body.js +0 -709
- package/src/physics/bounds.js +0 -407
- package/src/physics/collision.js +0 -128
- package/src/physics/detector.js +0 -218
- package/src/physics/quadtree.js +0 -393
- package/src/physics/response.js +0 -48
- package/src/physics/sat.js +0 -483
- package/src/physics/world.js +0 -220
- package/src/plugin/plugin.js +0 -163
- package/src/polyfill/console.js +0 -11
- package/src/polyfill/index.js +0 -13
- package/src/polyfill/roundrect.js +0 -237
- package/src/renderable/collectable.js +0 -51
- package/src/renderable/colorlayer.js +0 -74
- package/src/renderable/container.js +0 -1008
- package/src/renderable/draggable.js +0 -114
- package/src/renderable/dragndrop.js +0 -110
- package/src/renderable/entity/entity.js +0 -254
- package/src/renderable/imagelayer.js +0 -284
- package/src/renderable/light2d.js +0 -163
- package/src/renderable/nineslicesprite.js +0 -239
- package/src/renderable/renderable.js +0 -869
- package/src/renderable/sprite.js +0 -691
- package/src/renderable/text/bitmaptext.js +0 -418
- package/src/renderable/text/bitmaptextdata.js +0 -186
- package/src/renderable/text/glyph.js +0 -57
- package/src/renderable/text/text.js +0 -415
- package/src/renderable/text/textmetrics.js +0 -167
- package/src/renderable/text/textstyle.js +0 -12
- package/src/renderable/trigger.js +0 -154
- package/src/renderable/ui/uibaseelement.js +0 -276
- package/src/renderable/ui/uispriteelement.js +0 -223
- package/src/renderable/ui/uitextbutton.js +0 -140
- package/src/state/stage.js +0 -226
- package/src/state/state.js +0 -541
- package/src/system/device.js +0 -863
- package/src/system/dom.js +0 -70
- package/src/system/event.js +0 -597
- package/src/system/platform.js +0 -34
- package/src/system/pooling.js +0 -190
- package/src/system/save.js +0 -148
- package/src/system/timer.js +0 -281
- package/src/tweens/easing.js +0 -325
- package/src/tweens/interpolation.js +0 -103
- package/src/tweens/tween.js +0 -470
- package/src/utils/agent.js +0 -68
- package/src/utils/array.js +0 -54
- package/src/utils/file.js +0 -46
- package/src/utils/function.js +0 -60
- package/src/utils/string.js +0 -73
- package/src/utils/utils.js +0 -127
- package/src/video/canvas/canvas_renderer.js +0 -905
- package/src/video/renderer.js +0 -393
- package/src/video/rendertarget/canvasrendertarget.js +0 -309
- package/src/video/texture/atlas.js +0 -456
- package/src/video/texture/cache.js +0 -178
- package/src/video/texture/parser/aseprite.js +0 -69
- package/src/video/texture/parser/spritesheet.js +0 -68
- package/src/video/texture/parser/texturepacker.js +0 -55
- package/src/video/utils/autodetect.js +0 -18
- package/src/video/video.js +0 -160
- package/src/video/webgl/buffer/vertex.js +0 -137
- package/src/video/webgl/compositors/compositor.js +0 -231
- package/src/video/webgl/compositors/primitive_compositor.js +0 -73
- package/src/video/webgl/compositors/quad_compositor.js +0 -250
- package/src/video/webgl/glshader.js +0 -158
- package/src/video/webgl/shaders/primitive.frag +0 -5
- package/src/video/webgl/shaders/primitive.vert +0 -15
- package/src/video/webgl/shaders/quad.frag +0 -7
- package/src/video/webgl/shaders/quad.vert +0 -18
- package/src/video/webgl/utils/attributes.js +0 -16
- package/src/video/webgl/utils/precision.js +0 -29
- package/src/video/webgl/utils/program.js +0 -58
- package/src/video/webgl/utils/string.js +0 -16
- package/src/video/webgl/utils/uniforms.js +0 -84
- package/src/video/webgl/webgl_renderer.js +0 -1237
|
@@ -1,1016 +0,0 @@
|
|
|
1
|
-
/*!
|
|
2
|
-
* melonJS Game Engine - v17.4.0
|
|
3
|
-
* http://www.melonjs.org
|
|
4
|
-
* melonjs is licensed under the MIT License.
|
|
5
|
-
* http://www.opensource.org/licenses/mit-license
|
|
6
|
-
* @copyright (C) 2011 - 2024 Olivier Biot (AltByte Pte Ltd)
|
|
7
|
-
*/
|
|
8
|
-
import Renderable from './renderable.js';
|
|
9
|
-
import { createGUID } from '../utils/utils.js';
|
|
10
|
-
import { defer } from '../utils/function.js';
|
|
11
|
-
import { game } from '../index.js';
|
|
12
|
-
import { on, CANVAS_ONRESIZE } from '../system/event.js';
|
|
13
|
-
import pool from '../system/pooling.js';
|
|
14
|
-
import state from '../state/state.js';
|
|
15
|
-
import Body from '../physics/body.js';
|
|
16
|
-
|
|
17
|
-
/**
|
|
18
|
-
* Private function to re-use for object removal in a defer
|
|
19
|
-
* @ignore
|
|
20
|
-
*/
|
|
21
|
-
function deferredRemove(child, keepalive) {
|
|
22
|
-
this.removeChildNow(child, keepalive);
|
|
23
|
-
}
|
|
24
|
-
|
|
25
|
-
let globalFloatingCounter = 0;
|
|
26
|
-
|
|
27
|
-
/**
|
|
28
|
-
* additional import for TypeScript
|
|
29
|
-
* @import Color from "./../math/color.js";
|
|
30
|
-
* @import Entity from "./entity/entity.js";
|
|
31
|
-
* @import Sprite from "./sprite.js";
|
|
32
|
-
* @import Collectable from "./collectable.js";
|
|
33
|
-
* @import Trigger from "./trigger.js";
|
|
34
|
-
* @import { Draggable } from "./draggable.js";
|
|
35
|
-
* @import { DropTarget } from "./dragndrop.js";
|
|
36
|
-
* @import NineSliceSprite from "./nineslicesprite.js";
|
|
37
|
-
* @import ImageLayer from "./imagelayer.js";
|
|
38
|
-
* @import ColorLayer from "./colorlayer.js";
|
|
39
|
-
* @import Light2d from "./light2d.js";
|
|
40
|
-
* @import UIBaseElement from "./ui/uibaseelement.js";
|
|
41
|
-
* @import UISpriteElement from "./ui/uispriteelement.js";
|
|
42
|
-
* @import UITextButton from "./ui/uitextbutton.js";
|
|
43
|
-
* @import Text from "./text/text.js";
|
|
44
|
-
* @import BitmapText from "./text/bitmaptext.js";
|
|
45
|
-
* @import Bounds from "./../physics/bounds.js";
|
|
46
|
-
* @import CanvasRenderer from "./../video/canvas/canvas_renderer.js";
|
|
47
|
-
* @import WebGLRenderer from "./../video/webgl/webgl_renderer.js";
|
|
48
|
-
*/
|
|
49
|
-
|
|
50
|
-
/**
|
|
51
|
-
* @classdesc
|
|
52
|
-
* Container represents a collection of child objects
|
|
53
|
-
* @augments Renderable
|
|
54
|
-
*/
|
|
55
|
-
class Container extends Renderable {
|
|
56
|
-
/**
|
|
57
|
-
* @param {number} [x=0] - position of the container (accessible via the inherited pos.x property)
|
|
58
|
-
* @param {number} [y=0] - position of the container (accessible via the inherited pos.y property)
|
|
59
|
-
* @param {number} [width=game.viewport.width] - width of the container
|
|
60
|
-
* @param {number} [height=game.viewport.height] - height of the container
|
|
61
|
-
*/
|
|
62
|
-
constructor(x = 0, y = 0, width, height, root = false) {
|
|
63
|
-
|
|
64
|
-
// call the super constructor
|
|
65
|
-
super(
|
|
66
|
-
x, y,
|
|
67
|
-
typeof width === "undefined" ? (typeof game.viewport !== "undefined" ? game.viewport.width : Infinity) : width,
|
|
68
|
-
typeof height === "undefined" ? (typeof game.viewport !== "undefined" ? game.viewport.height : Infinity) : height
|
|
69
|
-
);
|
|
70
|
-
|
|
71
|
-
/**
|
|
72
|
-
* keep track of pending sort
|
|
73
|
-
* @ignore
|
|
74
|
-
*/
|
|
75
|
-
this.pendingSort = null;
|
|
76
|
-
|
|
77
|
-
/**
|
|
78
|
-
* whether the container is the root of the scene
|
|
79
|
-
* @type {boolean}
|
|
80
|
-
* @default false
|
|
81
|
-
*/
|
|
82
|
-
this.root = root;
|
|
83
|
-
|
|
84
|
-
/**
|
|
85
|
-
* The array of children of this container.
|
|
86
|
-
* @ignore
|
|
87
|
-
*/
|
|
88
|
-
this.children = undefined;
|
|
89
|
-
|
|
90
|
-
/**
|
|
91
|
-
* The property of the child object that should be used to sort on this container
|
|
92
|
-
* value : "x", "y", "z"
|
|
93
|
-
* @type {string}
|
|
94
|
-
* @default "z"
|
|
95
|
-
*/
|
|
96
|
-
this.sortOn = "z";
|
|
97
|
-
|
|
98
|
-
/**
|
|
99
|
-
* Specify if the children list should be automatically sorted when adding a new child
|
|
100
|
-
* @type {boolean}
|
|
101
|
-
* @default true
|
|
102
|
-
*/
|
|
103
|
-
this.autoSort = true;
|
|
104
|
-
|
|
105
|
-
/**
|
|
106
|
-
* Specify if the children z index should automatically be managed by the parent container
|
|
107
|
-
* @type {boolean}
|
|
108
|
-
* @default true
|
|
109
|
-
*/
|
|
110
|
-
this.autoDepth = true;
|
|
111
|
-
|
|
112
|
-
/**
|
|
113
|
-
* Specify if the container draw operation should clip his children to its own bounds
|
|
114
|
-
* @type {boolean}
|
|
115
|
-
* @default false
|
|
116
|
-
*/
|
|
117
|
-
this.clipping = false;
|
|
118
|
-
|
|
119
|
-
/**
|
|
120
|
-
* a callback to be extended, triggered after a child has been added or removed
|
|
121
|
-
* @param {number} index - added or removed child index
|
|
122
|
-
*/
|
|
123
|
-
this.onChildChange = function (index) { // eslint-disable-line no-unused-vars
|
|
124
|
-
// to be extended
|
|
125
|
-
};
|
|
126
|
-
|
|
127
|
-
/**
|
|
128
|
-
* Specify if the container bounds should automatically take in account
|
|
129
|
-
* all child bounds when updated (this is expensive and disabled by default,
|
|
130
|
-
* only enable if necessary)
|
|
131
|
-
* @type {boolean}
|
|
132
|
-
* @default false
|
|
133
|
-
*/
|
|
134
|
-
this.enableChildBoundsUpdate = false;
|
|
135
|
-
|
|
136
|
-
/**
|
|
137
|
-
* define a background color for this container
|
|
138
|
-
* @type {Color}
|
|
139
|
-
* @default (0, 0, 0, 0.0)
|
|
140
|
-
* @example
|
|
141
|
-
* // add a red background color to this container
|
|
142
|
-
* this.backgroundColor.setColor(255, 0, 0);
|
|
143
|
-
*/
|
|
144
|
-
this.backgroundColor = pool.pull("Color", 0, 0, 0, 0.0);
|
|
145
|
-
|
|
146
|
-
/**
|
|
147
|
-
* Used by the debug panel plugin
|
|
148
|
-
* @ignore
|
|
149
|
-
*/
|
|
150
|
-
this.drawCount = 0;
|
|
151
|
-
|
|
152
|
-
// container self apply any defined transformation
|
|
153
|
-
this.autoTransform = true;
|
|
154
|
-
|
|
155
|
-
// enable collision and event detection
|
|
156
|
-
this.isKinematic = false;
|
|
157
|
-
|
|
158
|
-
this.anchorPoint.set(0, 0);
|
|
159
|
-
|
|
160
|
-
// subscribe on the canvas resize event
|
|
161
|
-
if (this.root === true) {
|
|
162
|
-
// Workaround for not updating container child-bounds automatically (it's expensive!)
|
|
163
|
-
on(CANVAS_ONRESIZE, () => {
|
|
164
|
-
// temporarly enable the enableChildBoundsUpdate flag
|
|
165
|
-
this.enableChildBoundsUpdate === true;
|
|
166
|
-
// update bounds
|
|
167
|
-
this.updateBounds();
|
|
168
|
-
this.enableChildBoundsUpdate === false;
|
|
169
|
-
});
|
|
170
|
-
}
|
|
171
|
-
}
|
|
172
|
-
|
|
173
|
-
/**
|
|
174
|
-
* reset the container, removing all childrens, and reseting transforms.
|
|
175
|
-
*/
|
|
176
|
-
reset() {
|
|
177
|
-
// cancel any sort operation
|
|
178
|
-
if (this.pendingSort) {
|
|
179
|
-
clearTimeout(this.pendingSort);
|
|
180
|
-
this.pendingSort = null;
|
|
181
|
-
}
|
|
182
|
-
|
|
183
|
-
// delete all children
|
|
184
|
-
let children = this.getChildren();
|
|
185
|
-
for (let i = children.length, child; i >= 0; (child = children[--i])) {
|
|
186
|
-
// don't remove it if a persistent object
|
|
187
|
-
if (child && child.isPersistent !== true) {
|
|
188
|
-
this.removeChildNow(child);
|
|
189
|
-
}
|
|
190
|
-
}
|
|
191
|
-
|
|
192
|
-
if (typeof this.currentTransform !== "undefined") {
|
|
193
|
-
// just reset some variables
|
|
194
|
-
this.currentTransform.identity();
|
|
195
|
-
}
|
|
196
|
-
|
|
197
|
-
this.backgroundColor.setColor(0, 0, 0, 0.0);
|
|
198
|
-
}
|
|
199
|
-
|
|
200
|
-
/**
|
|
201
|
-
* Add a child to the container <br>
|
|
202
|
-
* if auto-sort is disable, the object will be appended at the bottom of the list.
|
|
203
|
-
* Adding a child to the container will automatically remove it from its other container.
|
|
204
|
-
* Meaning a child can only have one parent. This is important if you add a renderable
|
|
205
|
-
* to a container then add it to the World container it will move it out of the
|
|
206
|
-
* orginal container. Then when the World container reset() method is called the renderable
|
|
207
|
-
* will not be in any container. <br>
|
|
208
|
-
* if the given child implements a onActivateEvent method, that method will be called
|
|
209
|
-
* once the child is added to this container.
|
|
210
|
-
* @param {Renderable|Entity|Sprite|Collectable|Trigger|Draggable|DropTarget|NineSliceSprite|ImageLayer|ColorLayer|Light2d|UIBaseElement|UISpriteElement|UITextButton|Text|BitmapText} child - Child to be added
|
|
211
|
-
* @param {number} [z] - forces the z index of the child to the specified value
|
|
212
|
-
* @returns {Renderable} the added child
|
|
213
|
-
*/
|
|
214
|
-
addChild(child, z) {
|
|
215
|
-
if (child.ancestor instanceof Container) {
|
|
216
|
-
child.ancestor.removeChildNow(child);
|
|
217
|
-
}
|
|
218
|
-
else {
|
|
219
|
-
// only allocate a GUID if the object has no previous ancestor
|
|
220
|
-
// (e.g. move one child from one container to another)
|
|
221
|
-
if (child.isRenderable) {
|
|
222
|
-
// allocated a GUID value (use child.id as based index if defined)
|
|
223
|
-
child.GUID = createGUID(child.id);
|
|
224
|
-
}
|
|
225
|
-
}
|
|
226
|
-
|
|
227
|
-
// add the new child
|
|
228
|
-
child.ancestor = this;
|
|
229
|
-
this.getChildren().push(child);
|
|
230
|
-
|
|
231
|
-
// update child bounds to reflect the new ancestor
|
|
232
|
-
if (typeof child.updateBounds === "function") {
|
|
233
|
-
if (this.isFloating === true) {
|
|
234
|
-
// only parent container can be floating
|
|
235
|
-
child.floating = false;
|
|
236
|
-
}
|
|
237
|
-
child.updateBounds();
|
|
238
|
-
}
|
|
239
|
-
|
|
240
|
-
// set the child z value if required
|
|
241
|
-
if (typeof(child.pos) !== "undefined") {
|
|
242
|
-
if (typeof(z) === "number") {
|
|
243
|
-
child.pos.z = z;
|
|
244
|
-
} else if (this.autoDepth === true) {
|
|
245
|
-
child.pos.z = this.getChildren().length;
|
|
246
|
-
}
|
|
247
|
-
}
|
|
248
|
-
|
|
249
|
-
if (this.autoSort === true) {
|
|
250
|
-
this.sort();
|
|
251
|
-
}
|
|
252
|
-
|
|
253
|
-
if (typeof child.onActivateEvent === "function" && this.isAttachedToRoot()) {
|
|
254
|
-
child.onActivateEvent();
|
|
255
|
-
}
|
|
256
|
-
|
|
257
|
-
// force container bounds update if required
|
|
258
|
-
if (this.enableChildBoundsUpdate === true) {
|
|
259
|
-
this.updateBounds();
|
|
260
|
-
}
|
|
261
|
-
|
|
262
|
-
// if a physic body(ies) to the game world
|
|
263
|
-
if (this.isAttachedToRoot()) {
|
|
264
|
-
let worldContainer = this.getRootAncestor();
|
|
265
|
-
if (child.body instanceof Body) {
|
|
266
|
-
worldContainer.addBody(child.body);
|
|
267
|
-
}
|
|
268
|
-
// if the child is a container
|
|
269
|
-
if (child instanceof Container) {
|
|
270
|
-
// add all container child bodies
|
|
271
|
-
// TODO: make it recursive ?
|
|
272
|
-
child.forEach((cchild) => {
|
|
273
|
-
if (cchild.body instanceof Body) {
|
|
274
|
-
worldContainer.addBody(cchild.body);
|
|
275
|
-
}
|
|
276
|
-
});
|
|
277
|
-
}
|
|
278
|
-
}
|
|
279
|
-
|
|
280
|
-
// mark the container for repaint
|
|
281
|
-
this.isDirty = true;
|
|
282
|
-
|
|
283
|
-
// triggered callback if defined
|
|
284
|
-
this.onChildChange.call(this, this.getChildren().length - 1);
|
|
285
|
-
|
|
286
|
-
return child;
|
|
287
|
-
}
|
|
288
|
-
|
|
289
|
-
/**
|
|
290
|
-
* Add a child to the container at the specified index<br>
|
|
291
|
-
* (the list won't be sorted after insertion)
|
|
292
|
-
* @param {Renderable|Entity|Sprite|Collectable|Trigger|Draggable|DropTarget|NineSliceSprite|ImageLayer|ColorLayer|Light2d|UIBaseElement|UISpriteElement|UITextButton|Text|BitmapText} child - Child to be added
|
|
293
|
-
* @param {number} index - The index at which to insert the child
|
|
294
|
-
* @returns {Renderable} the added child
|
|
295
|
-
*/
|
|
296
|
-
addChildAt(child, index) {
|
|
297
|
-
if (index >= 0 && index < this.getChildren().length) {
|
|
298
|
-
if (child.ancestor instanceof Container) {
|
|
299
|
-
child.ancestor.removeChildNow(child);
|
|
300
|
-
}
|
|
301
|
-
else {
|
|
302
|
-
// only allocate a GUID if the object has no previous ancestor
|
|
303
|
-
// (e.g. move one child from one container to another)
|
|
304
|
-
if (child.isRenderable) {
|
|
305
|
-
// allocated a GUID value
|
|
306
|
-
child.GUID = createGUID();
|
|
307
|
-
}
|
|
308
|
-
}
|
|
309
|
-
|
|
310
|
-
// add the new child
|
|
311
|
-
child.ancestor = this;
|
|
312
|
-
this.getChildren().splice(index, 0, child);
|
|
313
|
-
|
|
314
|
-
// update child bounds to reflect the new ancestor
|
|
315
|
-
if (typeof child.updateBounds === "function") {
|
|
316
|
-
if (this.isFloating === true) {
|
|
317
|
-
// only parent container can be floating
|
|
318
|
-
child.floating = false;
|
|
319
|
-
}
|
|
320
|
-
child.updateBounds();
|
|
321
|
-
}
|
|
322
|
-
|
|
323
|
-
if (typeof child.onActivateEvent === "function" && this.isAttachedToRoot()) {
|
|
324
|
-
child.onActivateEvent();
|
|
325
|
-
}
|
|
326
|
-
|
|
327
|
-
// force container bounds update if required
|
|
328
|
-
if (this.enableChildBoundsUpdate === true) {
|
|
329
|
-
this.updateBounds();
|
|
330
|
-
}
|
|
331
|
-
|
|
332
|
-
// if a physic body(ies) to the game world
|
|
333
|
-
if (this.isAttachedToRoot()) {
|
|
334
|
-
let worldContainer = this.getRootAncestor();
|
|
335
|
-
if (child.body instanceof Body) {
|
|
336
|
-
worldContainer.addBody(child.body);
|
|
337
|
-
}
|
|
338
|
-
// if the child is a container
|
|
339
|
-
if (child instanceof Container) {
|
|
340
|
-
// add all container child bodies
|
|
341
|
-
// TODO: make it recursive ?
|
|
342
|
-
child.forEach((cchild) => {
|
|
343
|
-
if (cchild.body instanceof Body) {
|
|
344
|
-
worldContainer.addBody(cchild.body);
|
|
345
|
-
}
|
|
346
|
-
});
|
|
347
|
-
}
|
|
348
|
-
}
|
|
349
|
-
|
|
350
|
-
// mark the container for repaint
|
|
351
|
-
this.isDirty = true;
|
|
352
|
-
|
|
353
|
-
// triggered callback if defined
|
|
354
|
-
this.onChildChange.call(this, index);
|
|
355
|
-
|
|
356
|
-
return child;
|
|
357
|
-
}
|
|
358
|
-
else {
|
|
359
|
-
throw new Error("Index (" + index + ") Out Of Bounds for addChildAt()");
|
|
360
|
-
}
|
|
361
|
-
}
|
|
362
|
-
|
|
363
|
-
/**
|
|
364
|
-
* The forEach() method executes a provided function once per child element. <br>
|
|
365
|
-
* the callback function is invoked with three arguments: <br>
|
|
366
|
-
* - The current element being processed in the array <br>
|
|
367
|
-
* - The index of element in the array. <br>
|
|
368
|
-
* - The array forEach() was called upon. <br>
|
|
369
|
-
* @param {Function} callback - fnction to execute on each element
|
|
370
|
-
* @param {object} [thisArg] - value to use as this(i.e reference Object) when executing callback.
|
|
371
|
-
* @example
|
|
372
|
-
* // iterate through all children of this container
|
|
373
|
-
* container.forEach((child) => {
|
|
374
|
-
* // do something with the child
|
|
375
|
-
* child.doSomething();
|
|
376
|
-
* });
|
|
377
|
-
* container.forEach((child, index) => { ... });
|
|
378
|
-
* container.forEach((child, index, array) => { ... });
|
|
379
|
-
* container.forEach((child, index, array) => { ... }, thisArg);
|
|
380
|
-
*/
|
|
381
|
-
forEach(callback, thisArg) {
|
|
382
|
-
let context = this, i = 0;
|
|
383
|
-
let children = this.getChildren();
|
|
384
|
-
|
|
385
|
-
let len = children.length;
|
|
386
|
-
|
|
387
|
-
if (typeof callback !== "function") {
|
|
388
|
-
throw new Error(callback + " is not a function");
|
|
389
|
-
}
|
|
390
|
-
|
|
391
|
-
if (arguments.length > 1) {
|
|
392
|
-
context = thisArg;
|
|
393
|
-
}
|
|
394
|
-
|
|
395
|
-
while (i < len) {
|
|
396
|
-
callback.call(context, children[i], i, children);
|
|
397
|
-
i++;
|
|
398
|
-
}
|
|
399
|
-
}
|
|
400
|
-
|
|
401
|
-
/**
|
|
402
|
-
* Swaps the position (z-index) of 2 children
|
|
403
|
-
* @param {Renderable|Entity|Sprite|Collectable|Trigger|Draggable|DropTarget|NineSliceSprite|ImageLayer|ColorLayer|Light2d|UIBaseElement|UISpriteElement|UITextButton|Text|BitmapText} child - Child to be added
|
|
404
|
-
* @param {Renderable|Entity|Sprite|Collectable|Trigger|Draggable|DropTarget|NineSliceSprite|ImageLayer|ColorLayer|Light2d|UIBaseElement|UISpriteElement|UITextButton|Text|BitmapText} child2 - Child to be added
|
|
405
|
-
*/
|
|
406
|
-
swapChildren(child, child2) {
|
|
407
|
-
let index = this.getChildIndex(child);
|
|
408
|
-
let index2 = this.getChildIndex(child2);
|
|
409
|
-
|
|
410
|
-
if ((index !== -1) && (index2 !== -1)) {
|
|
411
|
-
// swap z index
|
|
412
|
-
let _z = child.pos.z;
|
|
413
|
-
child.pos.z = child2.pos.z;
|
|
414
|
-
child2.pos.z = _z;
|
|
415
|
-
// swap the positions..
|
|
416
|
-
this.getChildren()[index] = child2;
|
|
417
|
-
this.getChildren()[index2] = child;
|
|
418
|
-
// mark the container as dirty
|
|
419
|
-
this.isDirty = true;
|
|
420
|
-
}
|
|
421
|
-
else {
|
|
422
|
-
throw new Error(child + " Both the supplied childs must be a child of the caller " + this);
|
|
423
|
-
}
|
|
424
|
-
}
|
|
425
|
-
|
|
426
|
-
/**
|
|
427
|
-
* Returns the Child at the specified index
|
|
428
|
-
* @param {number} index - The index of the child
|
|
429
|
-
* @returns {Renderable} the child at the specified index
|
|
430
|
-
*/
|
|
431
|
-
getChildAt(index) {
|
|
432
|
-
if (index >= 0 && index < this.getChildren().length) {
|
|
433
|
-
return this.getChildren()[index];
|
|
434
|
-
}
|
|
435
|
-
else {
|
|
436
|
-
throw new Error("Index (" + index + ") Out Of Bounds for getChildAt()");
|
|
437
|
-
}
|
|
438
|
-
}
|
|
439
|
-
|
|
440
|
-
/**
|
|
441
|
-
* Returns the index of the given Child
|
|
442
|
-
* @param {Renderable|Entity|Sprite|Collectable|Trigger|Draggable|DropTarget|NineSliceSprite|ImageLayer|ColorLayer|Light2d|UIBaseElement|UISpriteElement|UITextButton|Text|BitmapText} child - The child object
|
|
443
|
-
* @returns {number} index
|
|
444
|
-
*/
|
|
445
|
-
getChildIndex(child) {
|
|
446
|
-
return this.getChildren().indexOf(child);
|
|
447
|
-
}
|
|
448
|
-
|
|
449
|
-
/**
|
|
450
|
-
* Returns the next child within the container or undefined if none
|
|
451
|
-
* @param {Renderable|Entity|Sprite|Collectable|Trigger|Draggable|DropTarget|NineSliceSprite|ImageLayer|ColorLayer|Light2d|UIBaseElement|UISpriteElement|UITextButton|Text|BitmapText} child - The child object
|
|
452
|
-
* @returns {Renderable} child
|
|
453
|
-
*/
|
|
454
|
-
getNextChild(child) {
|
|
455
|
-
let index = this.getChildren().indexOf(child) - 1;
|
|
456
|
-
if (index >= 0 && index < this.getChildren().length) {
|
|
457
|
-
return this.getChildAt(index);
|
|
458
|
-
}
|
|
459
|
-
return undefined;
|
|
460
|
-
}
|
|
461
|
-
|
|
462
|
-
/**
|
|
463
|
-
* Returns true if contains the specified Child
|
|
464
|
-
* @param {Renderable|Entity|Sprite|Collectable|Trigger|Draggable|DropTarget|NineSliceSprite|ImageLayer|ColorLayer|Light2d|UIBaseElement|UISpriteElement|UITextButton|Text|BitmapText} child - The child object
|
|
465
|
-
* @returns {boolean}
|
|
466
|
-
*/
|
|
467
|
-
hasChild(child) {
|
|
468
|
-
return this === child.ancestor;
|
|
469
|
-
}
|
|
470
|
-
|
|
471
|
-
/**
|
|
472
|
-
* return the child corresponding to the given property and value.<br>
|
|
473
|
-
* note : avoid calling this function every frame since
|
|
474
|
-
* it parses the whole object tree each time
|
|
475
|
-
* @param {string} prop - Property name
|
|
476
|
-
* @param {string|RegExp|number|boolean} value - Value of the property
|
|
477
|
-
* @returns {Renderable[]} Array of childs
|
|
478
|
-
* @example
|
|
479
|
-
* // get the first child object called "mainPlayer" in a specific container :
|
|
480
|
-
* let ent = myContainer.getChildByProp("name", "mainPlayer");
|
|
481
|
-
*
|
|
482
|
-
* // or query the whole world :
|
|
483
|
-
* let ent = container.getChildByProp("name", "mainPlayer");
|
|
484
|
-
*
|
|
485
|
-
* // partial property matches are also allowed by using a RegExp.
|
|
486
|
-
* // the following matches "redCOIN", "bluecoin", "bagOfCoins", etc :
|
|
487
|
-
* let allCoins = container.getChildByProp("name", /coin/i);
|
|
488
|
-
*
|
|
489
|
-
* // searching for numbers or other data types :
|
|
490
|
-
* let zIndex10 = container.getChildByProp("z", 10);
|
|
491
|
-
* let inViewport = container.getChildByProp("inViewport", true);
|
|
492
|
-
*/
|
|
493
|
-
getChildByProp(prop, value) {
|
|
494
|
-
let objList = [];
|
|
495
|
-
|
|
496
|
-
/**
|
|
497
|
-
* @ignore
|
|
498
|
-
*/
|
|
499
|
-
function compare(obj, prop) {
|
|
500
|
-
let v = obj[prop];
|
|
501
|
-
if (value instanceof RegExp && typeof(v) === "string") {
|
|
502
|
-
if (value.test(v)) {
|
|
503
|
-
objList.push(obj);
|
|
504
|
-
}
|
|
505
|
-
}
|
|
506
|
-
else if (v === value) {
|
|
507
|
-
objList.push(obj);
|
|
508
|
-
}
|
|
509
|
-
}
|
|
510
|
-
|
|
511
|
-
this.forEach((child) => {
|
|
512
|
-
compare(child, prop);
|
|
513
|
-
if (child instanceof Container) {
|
|
514
|
-
objList = objList.concat(child.getChildByProp(prop, value));
|
|
515
|
-
}
|
|
516
|
-
});
|
|
517
|
-
|
|
518
|
-
return objList;
|
|
519
|
-
}
|
|
520
|
-
|
|
521
|
-
/**
|
|
522
|
-
* returns the list of childs with the specified class type
|
|
523
|
-
* @param {object} classType - Class type
|
|
524
|
-
* @returns {Renderable[]} Array of children
|
|
525
|
-
*/
|
|
526
|
-
getChildByType(classType) {
|
|
527
|
-
let objList = [];
|
|
528
|
-
|
|
529
|
-
this.forEach((child) => {
|
|
530
|
-
if (child instanceof classType) {
|
|
531
|
-
objList.push(child);
|
|
532
|
-
}
|
|
533
|
-
if (child instanceof Container) {
|
|
534
|
-
objList = objList.concat(child.getChildByType(classType));
|
|
535
|
-
}
|
|
536
|
-
});
|
|
537
|
-
|
|
538
|
-
return objList;
|
|
539
|
-
}
|
|
540
|
-
|
|
541
|
-
/**
|
|
542
|
-
* returns the list of childs with the specified name<br>
|
|
543
|
-
* as defined in Tiled (Name field of the Object Properties)<br>
|
|
544
|
-
* note : avoid calling this function every frame since
|
|
545
|
-
* it parses the whole object list each time
|
|
546
|
-
* @param {string|RegExp|number|boolean} name - child name
|
|
547
|
-
* @returns {Renderable[]} Array of children
|
|
548
|
-
*/
|
|
549
|
-
getChildByName(name) {
|
|
550
|
-
return this.getChildByProp("name", name);
|
|
551
|
-
}
|
|
552
|
-
|
|
553
|
-
/**
|
|
554
|
-
* return the child corresponding to the specified GUID<br>
|
|
555
|
-
* note : avoid calling this function every frame since
|
|
556
|
-
* it parses the whole object list each time
|
|
557
|
-
* @param {string|RegExp|number|boolean} guid - child GUID
|
|
558
|
-
* @returns {Renderable} corresponding child or null
|
|
559
|
-
*/
|
|
560
|
-
getChildByGUID(guid) {
|
|
561
|
-
let obj = this.getChildByProp("GUID", guid);
|
|
562
|
-
return (obj.length > 0) ? obj[0] : null;
|
|
563
|
-
}
|
|
564
|
-
|
|
565
|
-
/**
|
|
566
|
-
* return all child in this container
|
|
567
|
-
* @returns {Renderable[]} an array of renderable object
|
|
568
|
-
*/
|
|
569
|
-
getChildren() {
|
|
570
|
-
if (typeof this.children === "undefined") {
|
|
571
|
-
this.children = [];
|
|
572
|
-
}
|
|
573
|
-
return this.children;
|
|
574
|
-
}
|
|
575
|
-
|
|
576
|
-
/**
|
|
577
|
-
* update the bounding box for this container.
|
|
578
|
-
* @param {boolean} [absolute=true] - update the bounds size and position in (world) absolute coordinates
|
|
579
|
-
* @returns {Bounds} this container bounding box Rectangle object
|
|
580
|
-
*/
|
|
581
|
-
updateBounds(absolute = true) {
|
|
582
|
-
let bounds = this.getBounds();
|
|
583
|
-
|
|
584
|
-
// call parent method
|
|
585
|
-
super.updateBounds(absolute);
|
|
586
|
-
|
|
587
|
-
if (this.enableChildBoundsUpdate === true) {
|
|
588
|
-
this.forEach((child) => {
|
|
589
|
-
if (child.isRenderable) {
|
|
590
|
-
let childBounds = child.updateBounds(true);
|
|
591
|
-
if (childBounds.isFinite()) {
|
|
592
|
-
bounds.addBounds(childBounds);
|
|
593
|
-
}
|
|
594
|
-
}
|
|
595
|
-
});
|
|
596
|
-
}
|
|
597
|
-
|
|
598
|
-
return bounds;
|
|
599
|
-
}
|
|
600
|
-
|
|
601
|
-
/**
|
|
602
|
-
* Checks if this container is root or if it's attached to the root container.
|
|
603
|
-
* @returns {boolean} true if this container is root or if it's attached to the root container
|
|
604
|
-
*/
|
|
605
|
-
isAttachedToRoot() {
|
|
606
|
-
if (this.root === true) {
|
|
607
|
-
return true;
|
|
608
|
-
} else {
|
|
609
|
-
let ancestor = this.ancestor;
|
|
610
|
-
while (ancestor) {
|
|
611
|
-
if (ancestor.root === true) {
|
|
612
|
-
return true;
|
|
613
|
-
}
|
|
614
|
-
ancestor = ancestor.ancestor;
|
|
615
|
-
}
|
|
616
|
-
return false;
|
|
617
|
-
}
|
|
618
|
-
}
|
|
619
|
-
|
|
620
|
-
/**
|
|
621
|
-
* Returns the instance of the root container (i.e. the current application World container).
|
|
622
|
-
* @returns {Container} root container
|
|
623
|
-
*/
|
|
624
|
-
getRootAncestor() {
|
|
625
|
-
if (this.root === true) {
|
|
626
|
-
return this;
|
|
627
|
-
} else {
|
|
628
|
-
let ancestor = this.ancestor;
|
|
629
|
-
while (ancestor) {
|
|
630
|
-
if (ancestor.root === true) {
|
|
631
|
-
break;
|
|
632
|
-
}
|
|
633
|
-
ancestor = ancestor.ancestor;
|
|
634
|
-
}
|
|
635
|
-
return ancestor;
|
|
636
|
-
}
|
|
637
|
-
}
|
|
638
|
-
|
|
639
|
-
/**
|
|
640
|
-
* update the cointainer's bounding rect (private)
|
|
641
|
-
* @ignore
|
|
642
|
-
*/
|
|
643
|
-
updateBoundsPos(newX = this.pos.x, newY = this.pos.y) {
|
|
644
|
-
// call the parent method
|
|
645
|
-
super.updateBoundsPos(newX, newY);
|
|
646
|
-
|
|
647
|
-
// Notify children that the parent's position has changed
|
|
648
|
-
this.forEach((child) => {
|
|
649
|
-
if (child.isRenderable) {
|
|
650
|
-
child.updateBoundsPos(
|
|
651
|
-
child.pos.x + newX - this.pos.x,
|
|
652
|
-
child.pos.y + newY - this.pos.y
|
|
653
|
-
);
|
|
654
|
-
}
|
|
655
|
-
});
|
|
656
|
-
}
|
|
657
|
-
|
|
658
|
-
/**
|
|
659
|
-
* @ignore
|
|
660
|
-
*/
|
|
661
|
-
onActivateEvent() {
|
|
662
|
-
this.forEach((child) => {
|
|
663
|
-
if (typeof child.onActivateEvent === "function") {
|
|
664
|
-
child.onActivateEvent();
|
|
665
|
-
}
|
|
666
|
-
});
|
|
667
|
-
}
|
|
668
|
-
|
|
669
|
-
/**
|
|
670
|
-
* Invokes the removeChildNow in a defer, to ensure the child is removed safely after the update & draw stack has completed. <br>
|
|
671
|
-
* if the given child implements a onDeactivateEvent() method, that method will be called once the child is removed from this container.
|
|
672
|
-
* @param {Renderable|Sprite|Collectable|Trigger|Draggable|DropTarget|NineSliceSprite|ImageLayer|ColorLayer|Light2d|UIBaseElement|UISpriteElement|UITextButton|Text|BitmapText} child - Child to be removed
|
|
673
|
-
* @param {boolean} [keepalive=false] - true to prevent calling child.destroy()
|
|
674
|
-
*/
|
|
675
|
-
removeChild(child, keepalive) {
|
|
676
|
-
if (this.hasChild(child)) {
|
|
677
|
-
defer(deferredRemove, this, child, keepalive);
|
|
678
|
-
}
|
|
679
|
-
else {
|
|
680
|
-
throw new Error("Child is not mine.");
|
|
681
|
-
}
|
|
682
|
-
}
|
|
683
|
-
|
|
684
|
-
/**
|
|
685
|
-
* Removes (and optionally destroys) a child from the container.<br>
|
|
686
|
-
* (removal is immediate and unconditional)<br>
|
|
687
|
-
* Never use keepalive=true with objects from {@link pool}. Doing so will create a memory leak.
|
|
688
|
-
* @param {Renderable|Entity|Sprite|Collectable|Trigger|Draggable|DropTarget|NineSliceSprite|ImageLayer|ColorLayer|Light2d|UIBaseElement|UISpriteElement|UITextButton|Text|BitmapText} child - Child to be removed
|
|
689
|
-
* @param {boolean} [keepalive=False] - True to prevent calling child.destroy()
|
|
690
|
-
*/
|
|
691
|
-
removeChildNow(child, keepalive) {
|
|
692
|
-
if (this.hasChild(child) && (this.getChildIndex(child) >= 0)) {
|
|
693
|
-
if (typeof child.onDeactivateEvent === "function") {
|
|
694
|
-
child.onDeactivateEvent();
|
|
695
|
-
}
|
|
696
|
-
|
|
697
|
-
// remove the body first to avoid a condition where a body can be detached
|
|
698
|
-
// from its parent, before the body is removed from the game world
|
|
699
|
-
if (child.body instanceof Body) {
|
|
700
|
-
this.getRootAncestor().removeBody(child.body);
|
|
701
|
-
}
|
|
702
|
-
|
|
703
|
-
if (!keepalive) {
|
|
704
|
-
// attempt at recycling the object
|
|
705
|
-
if (pool.push(child, false) === false) {
|
|
706
|
-
// else just destroy it
|
|
707
|
-
if (typeof child.destroy === "function") {
|
|
708
|
-
child.destroy();
|
|
709
|
-
}
|
|
710
|
-
}
|
|
711
|
-
}
|
|
712
|
-
|
|
713
|
-
// Don't cache the child index; another element might have been removed
|
|
714
|
-
// by the child's `onDeactivateEvent` or `destroy` methods
|
|
715
|
-
let childIndex = this.getChildIndex(child);
|
|
716
|
-
if (childIndex >= 0) {
|
|
717
|
-
this.getChildren().splice(childIndex, 1);
|
|
718
|
-
child.ancestor = undefined;
|
|
719
|
-
}
|
|
720
|
-
|
|
721
|
-
// force bounds update if required
|
|
722
|
-
if (this.enableChildBoundsUpdate === true) {
|
|
723
|
-
this.updateBounds();
|
|
724
|
-
}
|
|
725
|
-
|
|
726
|
-
// mark the container for repaint
|
|
727
|
-
this.isDirty = true;
|
|
728
|
-
|
|
729
|
-
// triggered callback if defined
|
|
730
|
-
this.onChildChange.call(this, childIndex);
|
|
731
|
-
}
|
|
732
|
-
}
|
|
733
|
-
|
|
734
|
-
/**
|
|
735
|
-
* Automatically set the specified property of all childs to the given value
|
|
736
|
-
* @param {string} prop - property name
|
|
737
|
-
* @param {object} value - property value
|
|
738
|
-
* @param {boolean} [recursive=false] - recursively apply the value to child containers if true
|
|
739
|
-
*/
|
|
740
|
-
setChildsProperty(prop, value, recursive) {
|
|
741
|
-
this.forEach((child) => {
|
|
742
|
-
if ((recursive === true) && (child instanceof Container)) {
|
|
743
|
-
child.setChildsProperty(prop, value, recursive);
|
|
744
|
-
}
|
|
745
|
-
child[prop] = value;
|
|
746
|
-
});
|
|
747
|
-
}
|
|
748
|
-
|
|
749
|
-
/**
|
|
750
|
-
* Move the child in the group one step forward (z depth).
|
|
751
|
-
* @param {Renderable|Entity|Sprite|Collectable|Trigger|Draggable|DropTarget|NineSliceSprite|ImageLayer|ColorLayer|Light2d|UIBaseElement|UISpriteElement|UITextButton|Text|BitmapText} child - Child to be moved
|
|
752
|
-
*/
|
|
753
|
-
moveUp(child) {
|
|
754
|
-
let childIndex = this.getChildIndex(child);
|
|
755
|
-
if (childIndex - 1 >= 0) {
|
|
756
|
-
// note : we use an inverted loop
|
|
757
|
-
this.swapChildren(child, this.getChildAt(childIndex - 1));
|
|
758
|
-
// mark the container as dirty
|
|
759
|
-
this.isDirty = true;
|
|
760
|
-
}
|
|
761
|
-
}
|
|
762
|
-
|
|
763
|
-
/**
|
|
764
|
-
* Move the child in the group one step backward (z depth).
|
|
765
|
-
* @param {Renderable|Entity|Sprite|Collectable|Trigger|Draggable|DropTarget|NineSliceSprite|ImageLayer|ColorLayer|Light2d|UIBaseElement|UISpriteElement|UITextButton|Text|BitmapText} child - Child to be moved
|
|
766
|
-
*/
|
|
767
|
-
moveDown(child) {
|
|
768
|
-
let childIndex = this.getChildIndex(child);
|
|
769
|
-
if (childIndex >= 0 && (childIndex + 1) < this.getChildren().length) {
|
|
770
|
-
// note : we use an inverted loop
|
|
771
|
-
this.swapChildren(child, this.getChildAt(childIndex + 1));
|
|
772
|
-
// mark the container as dirty
|
|
773
|
-
this.isDirty = true;
|
|
774
|
-
}
|
|
775
|
-
}
|
|
776
|
-
|
|
777
|
-
/**
|
|
778
|
-
* Move the specified child to the top(z depth).
|
|
779
|
-
* @param {Renderable|Entity|Sprite|Collectable|Trigger|Draggable|DropTarget|NineSliceSprite|ImageLayer|ColorLayer|Light2d|UIBaseElement|UISpriteElement|UITextButton|Text|BitmapText} child - Child to be moved
|
|
780
|
-
*/
|
|
781
|
-
moveToTop(child) {
|
|
782
|
-
let childIndex = this.getChildIndex(child);
|
|
783
|
-
if (childIndex > 0) {
|
|
784
|
-
let children = this.getChildren();
|
|
785
|
-
// note : we use an inverted loop
|
|
786
|
-
children.splice(0, 0, children.splice(childIndex, 1)[0]);
|
|
787
|
-
// increment our child z value based on the previous child depth
|
|
788
|
-
child.pos.z = children[1].pos.z + 1;
|
|
789
|
-
// mark the container as dirty
|
|
790
|
-
this.isDirty = true;
|
|
791
|
-
}
|
|
792
|
-
}
|
|
793
|
-
|
|
794
|
-
/**
|
|
795
|
-
* Move the specified child the bottom (z depth).
|
|
796
|
-
* @param {Renderable|Entity|Sprite|Collectable|Trigger|Draggable|DropTarget|NineSliceSprite|ImageLayer|ColorLayer|Light2d|UIBaseElement|UISpriteElement|UITextButton|Text|BitmapText} child - Child to be moved
|
|
797
|
-
*/
|
|
798
|
-
moveToBottom(child) {
|
|
799
|
-
let childIndex = this.getChildIndex(child);
|
|
800
|
-
let children = this.getChildren();
|
|
801
|
-
if (childIndex >= 0 && childIndex < (children.length - 1)) {
|
|
802
|
-
// note : we use an inverted loop
|
|
803
|
-
children.splice((children.length - 1), 0, children.splice(childIndex, 1)[0]);
|
|
804
|
-
// increment our child z value based on the next child depth
|
|
805
|
-
child.pos.z = children[(children.length - 2)].pos.z - 1;
|
|
806
|
-
// mark the container as dirty
|
|
807
|
-
this.isDirty = true;
|
|
808
|
-
}
|
|
809
|
-
}
|
|
810
|
-
|
|
811
|
-
/**
|
|
812
|
-
* Manually trigger the sort of all the childs in the container
|
|
813
|
-
* @param {boolean} [recursive=false] - recursively sort all containers if true
|
|
814
|
-
*/
|
|
815
|
-
sort(recursive) {
|
|
816
|
-
// do nothing if there is already a pending sort
|
|
817
|
-
if (!this.pendingSort) {
|
|
818
|
-
if (recursive === true) {
|
|
819
|
-
this.forEach((child) => {
|
|
820
|
-
if (child instanceof Container) {
|
|
821
|
-
// note : this will generate one defered sorting function
|
|
822
|
-
// for each existing containe
|
|
823
|
-
child.sort(recursive);
|
|
824
|
-
}
|
|
825
|
-
});
|
|
826
|
-
}
|
|
827
|
-
/** @ignore */
|
|
828
|
-
this.pendingSort = defer(function () {
|
|
829
|
-
// sort everything in this container
|
|
830
|
-
this.getChildren().sort(this["_sort" + this.sortOn.toUpperCase()]);
|
|
831
|
-
// clear the defer id
|
|
832
|
-
this.pendingSort = null;
|
|
833
|
-
// make sure we redraw everything
|
|
834
|
-
this.isDirty = true;
|
|
835
|
-
}, this);
|
|
836
|
-
}
|
|
837
|
-
}
|
|
838
|
-
|
|
839
|
-
/**
|
|
840
|
-
* @ignore
|
|
841
|
-
*/
|
|
842
|
-
onDeactivateEvent() {
|
|
843
|
-
this.forEach((child) => {
|
|
844
|
-
if (typeof child.onDeactivateEvent === "function") {
|
|
845
|
-
child.onDeactivateEvent();
|
|
846
|
-
}
|
|
847
|
-
});
|
|
848
|
-
}
|
|
849
|
-
|
|
850
|
-
/**
|
|
851
|
-
* Z Sorting function
|
|
852
|
-
* @ignore
|
|
853
|
-
*/
|
|
854
|
-
_sortZ(a, b) {
|
|
855
|
-
return (b.pos && a.pos) ? (b.pos.z - a.pos.z) : (a.pos ? -Infinity : Infinity);
|
|
856
|
-
}
|
|
857
|
-
|
|
858
|
-
/**
|
|
859
|
-
* Reverse Z Sorting function
|
|
860
|
-
* @ignore
|
|
861
|
-
*/
|
|
862
|
-
_sortReverseZ(a, b) {
|
|
863
|
-
return (a.pos && b.pos) ? (a.pos.z - b.pos.z) : (a.pos ? Infinity : -Infinity);
|
|
864
|
-
}
|
|
865
|
-
|
|
866
|
-
/**
|
|
867
|
-
* X Sorting function
|
|
868
|
-
* @ignore
|
|
869
|
-
*/
|
|
870
|
-
_sortX(a, b) {
|
|
871
|
-
if (!b.pos || !a.pos) {
|
|
872
|
-
return (a.pos ? -Infinity : Infinity);
|
|
873
|
-
}
|
|
874
|
-
let result = b.pos.z - a.pos.z;
|
|
875
|
-
return (result ? result : (b.pos.x - a.pos.x));
|
|
876
|
-
}
|
|
877
|
-
|
|
878
|
-
/**
|
|
879
|
-
* Y Sorting function
|
|
880
|
-
* @ignore
|
|
881
|
-
*/
|
|
882
|
-
_sortY(a, b) {
|
|
883
|
-
if (!b.pos || !a.pos) {
|
|
884
|
-
return (a.pos ? -Infinity : Infinity);
|
|
885
|
-
}
|
|
886
|
-
let result = b.pos.z - a.pos.z;
|
|
887
|
-
return (result ? result : (b.pos.y - a.pos.y));
|
|
888
|
-
}
|
|
889
|
-
|
|
890
|
-
/**
|
|
891
|
-
* Destroy function<br>
|
|
892
|
-
* @ignore
|
|
893
|
-
*/
|
|
894
|
-
destroy() {
|
|
895
|
-
// empty the container
|
|
896
|
-
this.reset();
|
|
897
|
-
// call the parent destroy method
|
|
898
|
-
super.destroy(arguments);
|
|
899
|
-
}
|
|
900
|
-
|
|
901
|
-
/**
|
|
902
|
-
* container update function. <br>
|
|
903
|
-
* automatically called by the application update loop {@link Application}
|
|
904
|
-
* @protected
|
|
905
|
-
* @param {number} dt - time since the last update in milliseconds.
|
|
906
|
-
* @returns {boolean} true if the Container is dirty
|
|
907
|
-
*/
|
|
908
|
-
update(dt) {
|
|
909
|
-
let isFloating = false;
|
|
910
|
-
let isPaused = state.isPaused();
|
|
911
|
-
let children = this.getChildren();
|
|
912
|
-
const childrenLength = children.length;
|
|
913
|
-
|
|
914
|
-
for (let i = childrenLength, obj; i--, (obj = children[i]);) {
|
|
915
|
-
if (isPaused && (!obj.updateWhenPaused)) {
|
|
916
|
-
// skip this object
|
|
917
|
-
continue;
|
|
918
|
-
}
|
|
919
|
-
|
|
920
|
-
if (obj.isRenderable) {
|
|
921
|
-
isFloating = (globalFloatingCounter > 0 || obj.floating);
|
|
922
|
-
if (isFloating) {
|
|
923
|
-
globalFloatingCounter++;
|
|
924
|
-
}
|
|
925
|
-
|
|
926
|
-
// check if object is in any active cameras
|
|
927
|
-
obj.inViewport = false;
|
|
928
|
-
// iterate through all cameras
|
|
929
|
-
state.current().cameras.forEach((camera) => {
|
|
930
|
-
if (camera.isVisible(obj, isFloating)) {
|
|
931
|
-
obj.inViewport = true;
|
|
932
|
-
}
|
|
933
|
-
});
|
|
934
|
-
|
|
935
|
-
// update our object
|
|
936
|
-
this.isDirty |= ((obj.inViewport || obj.alwaysUpdate) && obj.update(dt));
|
|
937
|
-
|
|
938
|
-
if (globalFloatingCounter > 0) {
|
|
939
|
-
globalFloatingCounter--;
|
|
940
|
-
}
|
|
941
|
-
}
|
|
942
|
-
else {
|
|
943
|
-
// just directly call update() for non renderable object
|
|
944
|
-
this.isDirty |= obj.update(dt);
|
|
945
|
-
}
|
|
946
|
-
}
|
|
947
|
-
|
|
948
|
-
// call the parent method
|
|
949
|
-
return super.update(dt);
|
|
950
|
-
}
|
|
951
|
-
|
|
952
|
-
/**
|
|
953
|
-
* draw this renderable (automatically called by melonJS)
|
|
954
|
-
* @param {CanvasRenderer|WebGLRenderer} renderer - a renderer instance
|
|
955
|
-
* @param {Camera2d} [viewport] - the viewport to (re)draw
|
|
956
|
-
*/
|
|
957
|
-
draw(renderer, viewport) {
|
|
958
|
-
let isFloating = false;
|
|
959
|
-
let bounds = this.getBounds();
|
|
960
|
-
|
|
961
|
-
this.drawCount = 0;
|
|
962
|
-
|
|
963
|
-
// clip the containter children to the container bounds
|
|
964
|
-
if (this.root === false && this.clipping === true && bounds.isFinite() === true) {
|
|
965
|
-
renderer.clipRect(
|
|
966
|
-
bounds.left,
|
|
967
|
-
bounds.top,
|
|
968
|
-
bounds.width,
|
|
969
|
-
bounds.height
|
|
970
|
-
);
|
|
971
|
-
}
|
|
972
|
-
|
|
973
|
-
// adjust position if required (e.g. canvas/window centering)
|
|
974
|
-
renderer.translate(this.pos.x, this.pos.y);
|
|
975
|
-
|
|
976
|
-
// color background if defined
|
|
977
|
-
if (this.backgroundColor.alpha > 1 / 255) {
|
|
978
|
-
renderer.clearColor(this.backgroundColor);
|
|
979
|
-
}
|
|
980
|
-
|
|
981
|
-
let children = this.getChildren();
|
|
982
|
-
for (let i = children.length, obj; i--, (obj = children[i]);) {
|
|
983
|
-
if (obj.isRenderable) {
|
|
984
|
-
|
|
985
|
-
isFloating = obj.floating === true;
|
|
986
|
-
|
|
987
|
-
if ((obj.inViewport || isFloating)) {
|
|
988
|
-
|
|
989
|
-
if (isFloating) {
|
|
990
|
-
// translate to screen coordinates
|
|
991
|
-
renderer.save();
|
|
992
|
-
renderer.resetTransform();
|
|
993
|
-
}
|
|
994
|
-
|
|
995
|
-
// predraw (apply transforms)
|
|
996
|
-
obj.preDraw(renderer);
|
|
997
|
-
|
|
998
|
-
// draw the object
|
|
999
|
-
obj.draw(renderer, viewport);
|
|
1000
|
-
|
|
1001
|
-
// postdraw (clean-up);
|
|
1002
|
-
obj.postDraw(renderer);
|
|
1003
|
-
|
|
1004
|
-
// restore the previous "state"
|
|
1005
|
-
if (isFloating) {
|
|
1006
|
-
renderer.restore();
|
|
1007
|
-
}
|
|
1008
|
-
|
|
1009
|
-
this.drawCount++;
|
|
1010
|
-
}
|
|
1011
|
-
}
|
|
1012
|
-
}
|
|
1013
|
-
}
|
|
1014
|
-
}
|
|
1015
|
-
|
|
1016
|
-
export { Container as default };
|