melonjs 18.0.0 → 18.2.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/build/application/application.d.ts +33 -40
- package/build/application/application.d.ts.map +1 -1
- package/build/application/defaultApplicationSettings.d.ts +1 -1
- package/build/application/header.d.ts +3 -7
- package/build/application/header.d.ts.map +1 -1
- package/build/application/resize.d.ts +3 -4
- package/build/application/resize.d.ts.map +1 -1
- package/build/application/settings.d.ts +8 -3
- package/build/application/settings.d.ts.map +1 -1
- package/build/audio/audio.d.ts +179 -128
- package/build/audio/audio.d.ts.map +1 -1
- package/build/camera/camera2d.d.ts +194 -103
- package/build/camera/camera2d.d.ts.map +1 -1
- package/build/geometries/ellipse.d.ts +40 -4
- package/build/geometries/ellipse.d.ts.map +1 -1
- package/build/geometries/line.d.ts +2 -1
- package/build/geometries/line.d.ts.map +1 -1
- package/build/geometries/path2d.d.ts +39 -4
- package/build/geometries/path2d.d.ts.map +1 -1
- package/build/geometries/polygon.d.ts +6 -5
- package/build/geometries/polygon.d.ts.map +1 -1
- package/build/geometries/rectangle.d.ts +1 -0
- package/build/geometries/rectangle.d.ts.map +1 -1
- package/build/geometries/roundrect.d.ts +83 -17
- package/build/geometries/roundrect.d.ts.map +1 -1
- package/build/index.d.ts +18 -16
- package/build/index.d.ts.map +1 -1
- package/build/index.js +5283 -2234
- package/build/index.js.map +4 -4
- package/build/input/gamepad.d.ts +113 -61
- package/build/input/gamepad.d.ts.map +1 -1
- package/build/input/input.d.ts +3 -7
- package/build/input/input.d.ts.map +1 -1
- package/build/input/keyboard.d.ts +6 -0
- package/build/input/keyboard.d.ts.map +1 -1
- package/build/input/pointer.d.ts +25 -51
- package/build/input/pointer.d.ts.map +1 -1
- package/build/input/pointerevent.d.ts +51 -79
- package/build/input/pointerevent.d.ts.map +1 -1
- package/build/lang/console.d.ts.map +1 -1
- package/build/lang/deprecated.d.ts +27 -0
- package/build/lang/deprecated.d.ts.map +1 -1
- package/build/level/tiled/TMXGroup.d.ts +5 -0
- package/build/level/tiled/TMXGroup.d.ts.map +1 -1
- package/build/level/tiled/TMXLayer.d.ts +1 -0
- package/build/level/tiled/TMXLayer.d.ts.map +1 -1
- package/build/level/tiled/TMXObject.d.ts +21 -16
- package/build/level/tiled/TMXObject.d.ts.map +1 -1
- package/build/level/tiled/TMXTile.d.ts +16 -5
- package/build/level/tiled/TMXTile.d.ts.map +1 -1
- package/build/level/tiled/TMXTileMap.d.ts +16 -3
- package/build/level/tiled/TMXTileMap.d.ts.map +1 -1
- package/build/level/tiled/TMXTileset.d.ts +138 -16
- package/build/level/tiled/TMXTileset.d.ts.map +1 -1
- package/build/level/tiled/TMXTilesetGroup.d.ts +1 -0
- package/build/level/tiled/TMXTilesetGroup.d.ts.map +1 -1
- package/build/level/tiled/TMXUtils.d.ts +29 -12
- package/build/level/tiled/TMXUtils.d.ts.map +1 -1
- package/build/level/tiled/constants.d.ts +1 -0
- package/build/level/tiled/constants.d.ts.map +1 -1
- package/build/level/tiled/renderer/TMXHexagonalRenderer.d.ts +2 -7
- package/build/level/tiled/renderer/TMXHexagonalRenderer.d.ts.map +1 -1
- package/build/level/tiled/renderer/TMXIsometricRenderer.d.ts +2 -1
- package/build/level/tiled/renderer/TMXIsometricRenderer.d.ts.map +1 -1
- package/build/level/tiled/renderer/TMXObliqueRenderer.d.ts +42 -0
- package/build/level/tiled/renderer/TMXObliqueRenderer.d.ts.map +1 -0
- package/build/level/tiled/renderer/TMXOrthogonalRenderer.d.ts +2 -7
- package/build/level/tiled/renderer/TMXOrthogonalRenderer.d.ts.map +1 -1
- package/build/level/tiled/renderer/TMXRenderer.d.ts +7 -0
- package/build/level/tiled/renderer/TMXRenderer.d.ts.map +1 -1
- package/build/level/tiled/renderer/TMXStaggeredRenderer.d.ts +2 -1
- package/build/level/tiled/renderer/TMXStaggeredRenderer.d.ts.map +1 -1
- package/build/level/tiled/renderer/autodetect.d.ts +2 -1
- package/build/level/tiled/renderer/autodetect.d.ts.map +1 -1
- package/build/loader/loader.d.ts +39 -15
- package/build/loader/loader.d.ts.map +1 -1
- package/build/loader/loadingscreen.d.ts +8 -0
- package/build/loader/loadingscreen.d.ts.map +1 -1
- package/build/loader/parsers/compressed_textures/compressed_image.d.ts +44 -1
- package/build/loader/parsers/compressed_textures/compressed_image.d.ts.map +1 -1
- package/build/loader/parsers/compressed_textures/parseDDS.d.ts +7 -1
- package/build/loader/parsers/compressed_textures/parseDDS.d.ts.map +1 -1
- package/build/loader/parsers/compressed_textures/parseKTX.d.ts +7 -1
- package/build/loader/parsers/compressed_textures/parseKTX.d.ts.map +1 -1
- package/build/loader/parsers/compressed_textures/parseKTX2.d.ts +7 -1
- package/build/loader/parsers/compressed_textures/parseKTX2.d.ts.map +1 -1
- package/build/loader/parsers/compressed_textures/parsePKM.d.ts +7 -1
- package/build/loader/parsers/compressed_textures/parsePKM.d.ts.map +1 -1
- package/build/loader/parsers/compressed_textures/parsePVR.d.ts +7 -1
- package/build/loader/parsers/compressed_textures/parsePVR.d.ts.map +1 -1
- package/build/loader/parsers/fontface.d.ts +1 -1
- package/build/loader/parsers/fontface.d.ts.map +1 -1
- package/build/loader/parsers/image.d.ts +6 -1
- package/build/loader/parsers/image.d.ts.map +1 -1
- package/build/math/color.d.ts +2 -1
- package/build/math/color.d.ts.map +1 -1
- package/build/math/matrix2d.d.ts +1 -0
- package/build/math/matrix2d.d.ts.map +1 -1
- package/build/math/matrix3d.d.ts +1 -0
- package/build/math/matrix3d.d.ts.map +1 -1
- package/build/math/observableVector2d.d.ts +3 -2
- package/build/math/observableVector2d.d.ts.map +1 -1
- package/build/math/observableVector3d.d.ts +5 -4
- package/build/math/observableVector3d.d.ts.map +1 -1
- package/build/math/vector2d.d.ts +2 -1
- package/build/math/vector2d.d.ts.map +1 -1
- package/build/math/vector3d.d.ts +4 -3
- package/build/math/vector3d.d.ts.map +1 -1
- package/build/particles/emitter.d.ts +40 -122
- package/build/particles/emitter.d.ts.map +1 -1
- package/build/particles/particle.d.ts +2 -4
- package/build/particles/particle.d.ts.map +1 -1
- package/build/physics/body.d.ts +8 -7
- package/build/physics/body.d.ts.map +1 -1
- package/build/physics/bounds.d.ts +2 -1
- package/build/physics/bounds.d.ts.map +1 -1
- package/build/physics/detector.d.ts.map +1 -1
- package/build/physics/quadtree.d.ts +1 -0
- package/build/physics/quadtree.d.ts.map +1 -1
- package/build/physics/sat.d.ts.map +1 -1
- package/build/physics/world.d.ts +4 -3
- package/build/physics/world.d.ts.map +1 -1
- package/build/plugin/plugin.d.ts +36 -53
- package/build/plugin/plugin.d.ts.map +1 -1
- package/build/polyfill/ellipse.d.ts +2 -0
- package/build/polyfill/ellipse.d.ts.map +1 -0
- package/build/polyfill/index.d.ts +1 -0
- package/build/polyfill/index.d.ts.map +1 -1
- package/build/renderable/collectable.d.ts +1 -0
- package/build/renderable/collectable.d.ts.map +1 -1
- package/build/renderable/colorlayer.d.ts +3 -2
- package/build/renderable/colorlayer.d.ts.map +1 -1
- package/build/renderable/container.d.ts +19 -18
- package/build/renderable/container.d.ts.map +1 -1
- package/build/renderable/draggable.d.ts +1 -0
- package/build/renderable/draggable.d.ts.map +1 -1
- package/build/renderable/entity/entity.d.ts +141 -0
- package/build/renderable/entity/entity.d.ts.map +1 -1
- package/build/renderable/imagelayer.d.ts +3 -2
- package/build/renderable/imagelayer.d.ts.map +1 -1
- package/build/renderable/nineslicesprite.d.ts +4 -3
- package/build/renderable/nineslicesprite.d.ts.map +1 -1
- package/build/renderable/renderable.d.ts +42 -7
- package/build/renderable/renderable.d.ts.map +1 -1
- package/build/renderable/sprite.d.ts +7 -5
- package/build/renderable/sprite.d.ts.map +1 -1
- package/build/renderable/text/bitmaptext.d.ts +3 -2
- package/build/renderable/text/bitmaptext.d.ts.map +1 -1
- package/build/renderable/text/bitmaptextdata.d.ts +4 -0
- package/build/renderable/text/bitmaptextdata.d.ts.map +1 -1
- package/build/renderable/text/text.d.ts +2 -1
- package/build/renderable/text/text.d.ts.map +1 -1
- package/build/renderable/trigger.d.ts +1 -0
- package/build/renderable/trigger.d.ts.map +1 -1
- package/build/renderable/ui/uibaseelement.d.ts +47 -33
- package/build/renderable/ui/uibaseelement.d.ts.map +1 -1
- package/build/renderable/ui/uispriteelement.d.ts +54 -43
- package/build/renderable/ui/uispriteelement.d.ts.map +1 -1
- package/build/renderable/ui/uitextbutton.d.ts +70 -75
- package/build/renderable/ui/uitextbutton.d.ts.map +1 -1
- package/build/state/stage.d.ts +2 -1
- package/build/state/stage.d.ts.map +1 -1
- package/build/state/state.d.ts +93 -90
- package/build/state/state.d.ts.map +1 -1
- package/build/system/device.d.ts +33 -3
- package/build/system/device.d.ts.map +1 -1
- package/build/system/dom.d.ts +7 -0
- package/build/system/dom.d.ts.map +1 -1
- package/build/system/event.d.ts +2 -2
- package/build/system/event.d.ts.map +1 -1
- package/build/system/legacy_pool.d.ts.map +1 -1
- package/build/tweens/tween.d.ts +1 -0
- package/build/tweens/tween.d.ts.map +1 -1
- package/build/utils/array.d.ts +2 -2
- package/build/utils/decode.d.ts +35 -0
- package/build/utils/decode.d.ts.map +1 -0
- package/build/utils/function.d.ts +1 -1
- package/build/utils/function.d.ts.map +1 -1
- package/build/utils/utils.d.ts +1 -1
- package/build/utils/utils.d.ts.map +1 -1
- package/build/utils/xml.d.ts +21 -0
- package/build/utils/xml.d.ts.map +1 -0
- package/build/video/canvas/canvas_renderer.d.ts +42 -14
- package/build/video/canvas/canvas_renderer.d.ts.map +1 -1
- package/build/video/renderer.d.ts +39 -8
- package/build/video/renderer.d.ts.map +1 -1
- package/build/video/renderstate.d.ts +85 -0
- package/build/video/renderstate.d.ts.map +1 -0
- package/build/video/rendertarget/canvasrendertarget.d.ts +1 -0
- package/build/video/rendertarget/canvasrendertarget.d.ts.map +1 -1
- package/build/video/texture/atlas.d.ts +44 -5
- package/build/video/texture/atlas.d.ts.map +1 -1
- package/build/video/texture/cache.d.ts +9 -0
- package/build/video/texture/cache.d.ts.map +1 -1
- package/build/video/texture/parser/texturepacker.d.ts.map +1 -1
- package/build/video/webgl/{compositors/compositor.d.ts → batchers/batcher.d.ts} +63 -30
- package/build/video/webgl/batchers/batcher.d.ts.map +1 -0
- package/build/video/webgl/{compositors/primitive_compositor.d.ts → batchers/primitive_batcher.d.ts} +10 -3
- package/build/video/webgl/batchers/primitive_batcher.d.ts.map +1 -0
- package/build/video/webgl/{compositors/quad_compositor.d.ts → batchers/quad_batcher.d.ts} +6 -5
- package/build/video/webgl/batchers/quad_batcher.d.ts.map +1 -0
- package/build/video/webgl/buffer/index.d.ts +49 -0
- package/build/video/webgl/buffer/index.d.ts.map +1 -0
- package/build/video/webgl/buffer/vertex.d.ts +12 -19
- package/build/video/webgl/buffer/vertex.d.ts.map +1 -1
- package/build/video/webgl/glshader.d.ts +3 -2
- package/build/video/webgl/glshader.d.ts.map +1 -1
- package/build/video/webgl/shadereffect.d.ts +72 -0
- package/build/video/webgl/shadereffect.d.ts.map +1 -0
- package/build/video/webgl/webgl_renderer.d.ts +53 -69
- package/build/video/webgl/webgl_renderer.d.ts.map +1 -1
- package/package.json +19 -13
- package/build/video/webgl/compositors/compositor.d.ts.map +0 -1
- package/build/video/webgl/compositors/primitive_compositor.d.ts.map +0 -1
- package/build/video/webgl/compositors/quad_compositor.d.ts.map +0 -1
|
@@ -11,9 +11,9 @@
|
|
|
11
11
|
* @import ImageLayer from "./imagelayer.js";
|
|
12
12
|
* @import ColorLayer from "./colorlayer.js";
|
|
13
13
|
* @import Light2d from "./light2d.js";
|
|
14
|
-
* @import UIBaseElement from "./ui/uibaseelement.
|
|
15
|
-
* @import UISpriteElement from "./ui/uispriteelement.
|
|
16
|
-
* @import UITextButton from "./ui/uitextbutton.
|
|
14
|
+
* @import UIBaseElement from "./ui/uibaseelement.ts";
|
|
15
|
+
* @import UISpriteElement from "./ui/uispriteelement.ts";
|
|
16
|
+
* @import UITextButton from "./ui/uitextbutton.ts";
|
|
17
17
|
* @import Text from "./text/text.js";
|
|
18
18
|
* @import BitmapText from "./text/bitmaptext.js";
|
|
19
19
|
* @import {Bounds} from "./../physics/bounds.ts";
|
|
@@ -22,6 +22,7 @@
|
|
|
22
22
|
*/
|
|
23
23
|
/**
|
|
24
24
|
* Container represents a collection of child objects
|
|
25
|
+
* @category Container
|
|
25
26
|
*/
|
|
26
27
|
export default class Container extends Renderable {
|
|
27
28
|
/**
|
|
@@ -67,7 +68,7 @@ export default class Container extends Renderable {
|
|
|
67
68
|
*/
|
|
68
69
|
autoDepth: boolean;
|
|
69
70
|
/**
|
|
70
|
-
* Specify if the container draw operation should clip
|
|
71
|
+
* Specify if the container draw operation should clip its children to its own bounds
|
|
71
72
|
* @type {boolean}
|
|
72
73
|
* @default false
|
|
73
74
|
*/
|
|
@@ -100,18 +101,18 @@ export default class Container extends Renderable {
|
|
|
100
101
|
*/
|
|
101
102
|
drawCount: number;
|
|
102
103
|
/**
|
|
103
|
-
* reset the container, removing all
|
|
104
|
+
* reset the container, removing all children, and resetting transforms.
|
|
104
105
|
*/
|
|
105
106
|
reset(): void;
|
|
106
107
|
/**
|
|
107
108
|
* Add a child to the container <br>
|
|
108
|
-
* if auto-sort is
|
|
109
|
+
* if auto-sort is disabled, the object will be appended at the bottom of the list.
|
|
109
110
|
* Adding a child to the container will automatically remove it from its other container.
|
|
110
111
|
* Meaning a child can only have one parent. This is important if you add a renderable
|
|
111
112
|
* to a container then add it to the World container it will move it out of the
|
|
112
|
-
*
|
|
113
|
+
* original container. Then when the World container reset() method is called the renderable
|
|
113
114
|
* will not be in any container. <br>
|
|
114
|
-
* if the given child implements
|
|
115
|
+
* if the given child implements an onActivateEvent method, that method will be called
|
|
115
116
|
* once the child is added to this container.
|
|
116
117
|
* @param {Renderable|Entity|Sprite|Collectable|Trigger|Draggable|DropTarget|NineSliceSprite|ImageLayer|ColorLayer|Light2d|UIBaseElement|UISpriteElement|UITextButton|Text|BitmapText|Tween} child - Child to be added
|
|
117
118
|
* @param {number} [z] - forces the z index of the child to the specified value
|
|
@@ -132,7 +133,7 @@ export default class Container extends Renderable {
|
|
|
132
133
|
* - The current element being processed in the array <br>
|
|
133
134
|
* - The index of element in the array. <br>
|
|
134
135
|
* - The array forEach() was called upon. <br>
|
|
135
|
-
* @param {Function} callback -
|
|
136
|
+
* @param {Function} callback - function to execute on each element
|
|
136
137
|
* @param {object} [thisArg] - value to use as this(i.e reference Object) when executing callback.
|
|
137
138
|
* @example
|
|
138
139
|
* // iterate through all children of this container
|
|
@@ -181,7 +182,7 @@ export default class Container extends Renderable {
|
|
|
181
182
|
* it parses the whole object tree each time
|
|
182
183
|
* @param {string} prop - Property name
|
|
183
184
|
* @param {string|RegExp|number|boolean} value - Value of the property
|
|
184
|
-
* @returns {Renderable[]} Array of
|
|
185
|
+
* @returns {Renderable[]} Array of children
|
|
185
186
|
* @example
|
|
186
187
|
* // get the first child object called "mainPlayer" in a specific container :
|
|
187
188
|
* let ent = myContainer.getChildByProp("name", "mainPlayer");
|
|
@@ -197,15 +198,15 @@ export default class Container extends Renderable {
|
|
|
197
198
|
* let zIndex10 = container.getChildByProp("z", 10);
|
|
198
199
|
* let inViewport = container.getChildByProp("inViewport", true);
|
|
199
200
|
*/
|
|
200
|
-
getChildByProp(prop: string, value: string | RegExp | number | boolean): Renderable[];
|
|
201
|
+
getChildByProp(prop: string, value: string | RegExp | number | boolean, objList?: any[]): Renderable[];
|
|
201
202
|
/**
|
|
202
|
-
* returns the list of
|
|
203
|
+
* returns the list of children with the specified class type
|
|
203
204
|
* @param {object} classType - Class type
|
|
204
205
|
* @returns {Renderable[]} Array of children
|
|
205
206
|
*/
|
|
206
|
-
getChildByType(classType: object): Renderable[];
|
|
207
|
+
getChildByType(classType: object, objList?: any[]): Renderable[];
|
|
207
208
|
/**
|
|
208
|
-
* returns the list of
|
|
209
|
+
* returns the list of children with the specified name<br>
|
|
209
210
|
* as defined in Tiled (Name field of the Object Properties)<br>
|
|
210
211
|
* note : avoid calling this function every frame since
|
|
211
212
|
* it parses the whole object list each time
|
|
@@ -242,7 +243,7 @@ export default class Container extends Renderable {
|
|
|
242
243
|
onActivateEvent(): void;
|
|
243
244
|
/**
|
|
244
245
|
* Invokes the removeChildNow in a defer, to ensure the child is removed safely after the update & draw stack has completed. <br>
|
|
245
|
-
* if the given child implements
|
|
246
|
+
* if the given child implements an onDeactivateEvent() method, that method will be called once the child is removed from this container.
|
|
246
247
|
* @param {Renderable|Sprite|Collectable|Trigger|Draggable|DropTarget|NineSliceSprite|ImageLayer|ColorLayer|Light2d|UIBaseElement|UISpriteElement|UITextButton|Text|BitmapText} child - Child to be removed
|
|
247
248
|
* @param {boolean} [keepalive=false] - true to prevent calling child.destroy()
|
|
248
249
|
*/
|
|
@@ -324,9 +325,9 @@ import type NineSliceSprite from "./nineslicesprite.js";
|
|
|
324
325
|
import type ImageLayer from "./imagelayer.js";
|
|
325
326
|
import type ColorLayer from "./colorlayer.js";
|
|
326
327
|
import type Light2d from "./light2d.js";
|
|
327
|
-
import type UIBaseElement from "./ui/uibaseelement.
|
|
328
|
-
import type UISpriteElement from "./ui/uispriteelement.
|
|
329
|
-
import type UITextButton from "./ui/uitextbutton.
|
|
328
|
+
import type UIBaseElement from "./ui/uibaseelement.ts";
|
|
329
|
+
import type UISpriteElement from "./ui/uispriteelement.ts";
|
|
330
|
+
import type UITextButton from "./ui/uitextbutton.ts";
|
|
330
331
|
import type Text from "./text/text.js";
|
|
331
332
|
import type BitmapText from "./text/bitmaptext.js";
|
|
332
333
|
//# sourceMappingURL=container.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"container.d.ts","sourceRoot":"","sources":["../../src/renderable/container.js"],"names":[],"mappings":"AAoBA;;;;;;;;;;;;;;;;;;;;;GAqBG;AAEH
|
|
1
|
+
{"version":3,"file":"container.d.ts","sourceRoot":"","sources":["../../src/renderable/container.js"],"names":[],"mappings":"AAoBA;;;;;;;;;;;;;;;;;;;;;GAqBG;AAEH;;;GAGG;AACH;IACC;;;;;OAKG;IACH,gBALW,MAAM,M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ED;;;OAGG;IACH,iBAFW,UAAU,GAAC,MAAM,GAAC,MAAM,GAAC,WAAW,GAAC,OAAO,GAAC,SAAS,GAAC,UAAU,GAAC,eAAe,GAAC,UAAU,GAAC,UAAU,GAAC,OAAO,GAAC,aAAa,GAAC,eAAe,GAAC,YAAY,GAAC,IAAI,GAAC,UAAU,QAapL;IAED;;;OAGG;IACH,oBAFW,UAAU,GAAC,MAAM,GAAC,MAAM,GAAC,WAAW,GAAC,OAAO,GAAC,SAAS,GAAC,UAAU,GAAC,eAAe,GAAC,UAAU,GAAC,UAAU,GAAC,OAAO,GAAC,aAAa,GAAC,eAAe,GAAC,YAAY,GAAC,IAAI,GAAC,UAAU,QAiBpL;IAED;;;OAGG;IACH,iBAFW,OAAO,QAuBjB;IAED;;OAEG;IACH,0BAMC;IAED;;;OAGG;IACH,+BAEC;IAED;;;OAGG;IACH,sCAEC;IAED;;;OAGG;IACH,+BAMC;IAED;;;OAGG;IACH,+BAMC;CAmID;uBAx9BsB,iBAAiB;2BAchB,oBAAoB;wBACrB,oBAAoB;wBACpB,aAAa;6BACR,kBAAkB;yBACtB,cAAc;+BACR,gBAAgB;gCACf,gBAAgB;iCACf,sBAAsB;4BAC3B,iBAAiB;4BACjB,iBAAiB;yBACpB,cAAc;+BACR,uBAAuB;iCACrB,yBAAyB;8BAC5B,sBAAsB;sBAC9B,gBAAgB;4BACV,sBAAsB"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"draggable.d.ts","sourceRoot":"","sources":["../../src/renderable/draggable.js"],"names":[],"mappings":"AAUA
|
|
1
|
+
{"version":3,"file":"draggable.d.ts","sourceRoot":"","sources":["../../src/renderable/draggable.js"],"names":[],"mappings":"AAUA;;;;GAIG;AACH;IAUE,kBAAqB;IACrB,YAAkB;IAClB,qBAAoC;IAIrC;;;;;;;OAOG;IACH,mBA8BC;IAnBA,kDAEC;IAED,gEAIC;IAED,8DAIC;IAOF;;;;OAIG;IACH,aAHW,MAAM,GACJ,OAAO,CASnB;IAED;;;OAGG;IACH,YAFW,MAAM,QAOhB;IAED;;;OAGG;IACH,WAFa,OAAO,CAOnB;IAED;;;OAGG;IACH,gBAQC;CACD;uBAtHsB,+BAA+B;yBAD7B,qBAAqB"}
|
|
@@ -9,8 +9,148 @@
|
|
|
9
9
|
**/
|
|
10
10
|
/**
|
|
11
11
|
* a Generic Object Entity
|
|
12
|
+
* @deprecated since 18.1.0 — use {@link Sprite} or {@link Renderable} combined with {@link Body} instead.
|
|
13
|
+
*
|
|
14
|
+
* ### Why Entity is deprecated
|
|
15
|
+
*
|
|
16
|
+
* `Entity` introduced an unnecessary extra layer: it wrapped a child {@link Renderable} (typically a {@link Sprite})
|
|
17
|
+
* inside a parent object that also held a {@link Body}. This design led to a number of long-standing issues:
|
|
18
|
+
*
|
|
19
|
+
* - **Anchor point confusion** — Entity used its own anchor point to position the child renderable relative to the
|
|
20
|
+
* body bounds, which behaved differently from the standard {@link Renderable} anchor point. This caused
|
|
21
|
+
* persistent alignment bugs with bounds and rendering (see issues #848, #834, #754, #580, #922).
|
|
22
|
+
* - **Indirect API** — animations, flipping, tinting, and other visual operations had to go through
|
|
23
|
+
* `this.renderable` instead of being called directly, making the API more verbose and error-prone.
|
|
24
|
+
* - **Custom rendering pipeline** — Entity overrode `preDraw`/`draw` with a custom coordinate system that
|
|
25
|
+
* differed from the rest of the engine, making it harder to reason about positioning and transforms.
|
|
26
|
+
*
|
|
27
|
+
* ### The Sprite + Body approach
|
|
28
|
+
*
|
|
29
|
+
* The recommended replacement is to extend {@link Sprite} (for animated/image-based objects) or
|
|
30
|
+
* {@link Renderable} (for custom-drawn objects) directly, and attach a {@link Body} in the constructor.
|
|
31
|
+
* This approach:
|
|
32
|
+
*
|
|
33
|
+
* - Uses the **standard rendering pipeline** — no custom `preDraw` or coordinate system surprises.
|
|
34
|
+
* - Provides a **direct API** — call `this.flipX()`, `this.setCurrentAnimation()`, `this.tint` directly.
|
|
35
|
+
* - Aligns with **industry conventions** — attaching a physics body to a renderable is the standard pattern
|
|
36
|
+
* used by other game engines.
|
|
37
|
+
* - Gives **full control** over body shape and position within the sprite frame.
|
|
38
|
+
*
|
|
39
|
+
* ### Migration Guide
|
|
40
|
+
*
|
|
41
|
+
* #### Example 1 — Animated Sprite with physics (using a texture atlas)
|
|
42
|
+
* ```js
|
|
43
|
+
* class PlayerSprite extends me.Sprite {
|
|
44
|
+
* constructor(x, y, settings) {
|
|
45
|
+
* // create the Sprite using atlas animation frames
|
|
46
|
+
* super(x, y, {
|
|
47
|
+
* ...game.texture.getAnimationSettings([
|
|
48
|
+
* "walk0001.png", "walk0002.png", "walk0003.png"
|
|
49
|
+
* ]),
|
|
50
|
+
* anchorPoint: { x: 0.5, y: 1.0 }
|
|
51
|
+
* });
|
|
52
|
+
*
|
|
53
|
+
* // add a physic body (use Tiled shapes if available, or define your own)
|
|
54
|
+
* this.body = new me.Body(this,
|
|
55
|
+
* settings.shapes || new me.Rect(0, 0, settings.width, settings.height)
|
|
56
|
+
* );
|
|
57
|
+
* this.body.collisionType = me.collision.types.PLAYER_OBJECT;
|
|
58
|
+
* this.body.setMaxVelocity(3, 15);
|
|
59
|
+
* this.body.setFriction(0.4, 0);
|
|
60
|
+
*
|
|
61
|
+
* // define animations (called directly on the sprite, not on this.renderable)
|
|
62
|
+
* this.addAnimation("walk", ["walk0001.png", "walk0002.png", "walk0003.png"]);
|
|
63
|
+
* this.setCurrentAnimation("walk");
|
|
64
|
+
* }
|
|
65
|
+
*
|
|
66
|
+
* update(dt) {
|
|
67
|
+
* // input handling, animations, etc. — all directly on `this`
|
|
68
|
+
* if (me.input.isKeyPressed("right")) {
|
|
69
|
+
* this.body.force.x = this.body.maxVel.x;
|
|
70
|
+
* this.flipX(false);
|
|
71
|
+
* }
|
|
72
|
+
* return super.update(dt);
|
|
73
|
+
* }
|
|
74
|
+
*
|
|
75
|
+
* onCollision(response, other) {
|
|
76
|
+
* return true; // solid
|
|
77
|
+
* }
|
|
78
|
+
* }
|
|
79
|
+
* ```
|
|
80
|
+
*
|
|
81
|
+
* #### Example 2 — Sprite with physics (using a standalone spritesheet image)
|
|
82
|
+
* ```js
|
|
83
|
+
* class EnemySprite extends me.Sprite {
|
|
84
|
+
* constructor(x, y, settings) {
|
|
85
|
+
* super(x, y, Object.assign({
|
|
86
|
+
* image: "enemy_spritesheet",
|
|
87
|
+
* framewidth: 32,
|
|
88
|
+
* frameheight: 32,
|
|
89
|
+
* }, settings));
|
|
90
|
+
*
|
|
91
|
+
* // add a physic body
|
|
92
|
+
* this.body = new me.Body(this, new me.Rect(0, 0, this.width, this.height));
|
|
93
|
+
* this.body.collisionType = me.collision.types.ENEMY_OBJECT;
|
|
94
|
+
* this.body.setMaxVelocity(1, 1);
|
|
95
|
+
* this.body.gravityScale = 0;
|
|
96
|
+
*
|
|
97
|
+
* this.addAnimation("walk", [0, 1, 2, 3]);
|
|
98
|
+
* this.addAnimation("dead", [4]);
|
|
99
|
+
* this.setCurrentAnimation("walk");
|
|
100
|
+
* }
|
|
101
|
+
*
|
|
102
|
+
* onCollision(response, other) {
|
|
103
|
+
* return false;
|
|
104
|
+
* }
|
|
105
|
+
* }
|
|
106
|
+
* ```
|
|
107
|
+
*
|
|
108
|
+
* #### Example 3 — Custom-drawn Renderable with physics
|
|
109
|
+
* ```js
|
|
110
|
+
* class CustomBall extends me.Renderable {
|
|
111
|
+
* constructor(x, y, radius) {
|
|
112
|
+
* super(x, y, radius * 2, radius * 2);
|
|
113
|
+
* this.radius = radius;
|
|
114
|
+
*
|
|
115
|
+
* // add a physic body with a circular shape
|
|
116
|
+
* this.body = new me.Body(this, new me.Ellipse(radius, radius, radius * 2, radius * 2));
|
|
117
|
+
* this.body.collisionType = me.collision.types.ENEMY_OBJECT;
|
|
118
|
+
* this.body.setMaxVelocity(4, 4);
|
|
119
|
+
* this.body.gravityScale = 0;
|
|
120
|
+
* this.body.force.set(
|
|
121
|
+
* me.Math.randomFloat(-4, 4),
|
|
122
|
+
* me.Math.randomFloat(-4, 4)
|
|
123
|
+
* );
|
|
124
|
+
* }
|
|
125
|
+
*
|
|
126
|
+
* update(dt) {
|
|
127
|
+
* return super.update(dt);
|
|
128
|
+
* }
|
|
129
|
+
*
|
|
130
|
+
* draw(renderer) {
|
|
131
|
+
* renderer.setColor("#FF0000");
|
|
132
|
+
* renderer.fillEllipse(
|
|
133
|
+
* this.width / 2, this.height / 2,
|
|
134
|
+
* this.radius, this.radius
|
|
135
|
+
* );
|
|
136
|
+
* }
|
|
137
|
+
*
|
|
138
|
+
* onCollision(response, other) {
|
|
139
|
+
* // bounce off on collision
|
|
140
|
+
* this.body.force.x = -this.body.force.x;
|
|
141
|
+
* this.body.force.y = -this.body.force.y;
|
|
142
|
+
* return false;
|
|
143
|
+
* }
|
|
144
|
+
* }
|
|
145
|
+
* ```
|
|
146
|
+
*
|
|
147
|
+
* @see Sprite
|
|
148
|
+
* @see Renderable
|
|
149
|
+
* @see Body
|
|
150
|
+
* @category Game Objects
|
|
12
151
|
*/
|
|
13
152
|
export default class Entity extends Renderable {
|
|
153
|
+
static _deprecationWarned: boolean;
|
|
14
154
|
/**
|
|
15
155
|
* @param {number} x - the x coordinates of the entity object
|
|
16
156
|
* @param {number} y - the y coordinates of the entity object
|
|
@@ -27,6 +167,7 @@ export default class Entity extends Renderable {
|
|
|
27
167
|
* @param {string} [settings.type] - object type
|
|
28
168
|
* @param {number} [settings.collisionMask] - Mask collision detection for this object
|
|
29
169
|
* @param {Rect[]|Polygon[]|Line[]|Ellipse[]} [settings.shapes] - the initial list of collision shapes (usually populated through Tiled)
|
|
170
|
+
* @deprecated since 18.1.0 — see the class-level documentation for migration examples
|
|
30
171
|
*/
|
|
31
172
|
constructor(x: number, y: number, settings: {
|
|
32
173
|
width: number;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"entity.d.ts","sourceRoot":"","sources":["../../../src/renderable/entity/entity.js"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"entity.d.ts","sourceRoot":"","sources":["../../../src/renderable/entity/entity.js"],"names":[],"mappings":"AAOA;;;;;;;;IAQI;AAEJ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA6IG;AACH;IACC,mCAAkC;IAElC;;;;;;;;;;;;;;;;;OAiBG;IACH,eAjBW,MAAM,KACN,MAAM,YAGd;QAAyB,KAAK,EAAtB,MAAM;QACW,MAAM,EAAvB,MAAM;QACY,IAAI;QACJ,EAAE;QACI,KAAK;QACT,WAAW;QACb,UAAU;QACV,WAAW;QACX,IAAI;QACJ,aAAa;QACc,MAAM;KAC3D,EAsFF;IA1EA;;;OAGG;IACH,gBAAkB;IAiFnB,sBAPU,UAAU,EAmBnB;IArBD;;;OAGG;IAEH,kBAHU,UAAU,CAKnB;IAnDA;;;OAGG;IACH,IAFU,MAAM,CAEW;IAE3B;;;;OAIG;IACH,OAFU,OAAO,CAEA;IAwDlB,cAAc;IACd,yBAKC;IAiCD;;OAEG;IACH,qBAEC;IAED,6BAkBC;IAoCD;;OAEG;IACH,0BAIC;CACD;uBAzYsB,kBAAkB;0BAKlB,iCAAiC;6BAE9B,6BAA6B;0BAHhC,4BAA4B;6BAEzB,+BAA+B"}
|
|
@@ -4,13 +4,14 @@
|
|
|
4
4
|
*/
|
|
5
5
|
/**
|
|
6
6
|
* a generic Image Layer Object
|
|
7
|
+
* @category Game Objects
|
|
7
8
|
*/
|
|
8
9
|
export default class ImageLayer extends Sprite {
|
|
9
10
|
/**
|
|
10
11
|
* @param {number} x - x coordinate
|
|
11
12
|
* @param {number} y - y coordinate
|
|
12
13
|
* @param {object} settings - ImageLayer properties
|
|
13
|
-
* @param {HTMLImageElement|HTMLCanvasElement|string} settings.image - Image reference. See {@link loader.getImage}
|
|
14
|
+
* @param {HTMLImageElement|HTMLCanvasElement|CompressedImage|string} settings.image - Image reference. See {@link loader.getImage}
|
|
14
15
|
* @param {string} [settings.name="me.ImageLayer"] - layer name
|
|
15
16
|
* @param {number} [settings.z=0] - z-index position
|
|
16
17
|
* @param {number|Vector2d} [settings.ratio=1.0] - Scrolling ratio to be applied. See {@link ImageLayer#ratio}
|
|
@@ -24,7 +25,7 @@ export default class ImageLayer extends Sprite {
|
|
|
24
25
|
* }), 1);
|
|
25
26
|
*/
|
|
26
27
|
constructor(x: number, y: number, settings: {
|
|
27
|
-
image: HTMLImageElement | HTMLCanvasElement | string;
|
|
28
|
+
image: HTMLImageElement | HTMLCanvasElement | CompressedImage | string;
|
|
28
29
|
name?: string | undefined;
|
|
29
30
|
z?: number | undefined;
|
|
30
31
|
ratio?: number | Vector2d | undefined;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"imagelayer.d.ts","sourceRoot":"","sources":["../../src/renderable/imagelayer.js"],"names":[],"mappings":"AAaA;;;GAGG;AAEH
|
|
1
|
+
{"version":3,"file":"imagelayer.d.ts","sourceRoot":"","sources":["../../src/renderable/imagelayer.js"],"names":[],"mappings":"AAaA;;;GAGG;AAEH;;;GAGG;AACH;IACC;;;;;;;;;;;;;;;;OAgBG;IACH,eAhBW,MAAM,KACN,MAAM,YAEd;QAA4E,KAAK,EAAzE,gBAAgB,GAAC,iBAAiB,GAAC,eAAe,GAAC,MAAM;QACvC,IAAI;QACJ,CAAC;QACQ,KAAK;QACsB,MAAM;QACjC,WAAW;KAC9C,EAwDF;IApCA;;;;;;;;;OASG;IACH,OAHU,QAAQ,CAGqB;IA2CxC,kBAPU,MAAM,EA6Bf;IArCD;;;;;;;;;;OAUG;IACH,cAHU,MAAM,CAKf;IAjBA,+BAAuD;IAoBvD,4BAAoB;IAGlB,6BAAoB;IACpB,6BAAoB;IAoBvB,wBAcC;IAbA,2CAAmD;IACnD,kBAgBU,MAAM,KACN,MAAM,uBAjByB;IAc1C;;;;OAIG;IACH,UAHW,MAAM,KACN,MAAM,QAOhB;IAED;;;OAGG;IACH,sBAEC;IADA,cAAgE;IAGjE;;;OAGG;IACH,oBA+CC;IAED;;;;OAIG;IACH,6BAcC;IAED;;;;;OAKG;IACH,yBAHW,cAAc,GAAC,aAAa,aAC5B,QAAQ,QAiDlB;IAGD,0BAKC;CAYD;mBA/SkB,aAAa;8BAIL,qBAAqB"}
|
|
@@ -4,9 +4,10 @@
|
|
|
4
4
|
* @import { TextureAtlas } from "./../video/texture/atlas.js";
|
|
5
5
|
*/
|
|
6
6
|
/**
|
|
7
|
-
* A NineSliceSprite is similar to a Sprite, but it uses 9-slice scaling to
|
|
7
|
+
* A NineSliceSprite is similar to a Sprite, but it uses 9-slice scaling to stretch its inner area to fit the size of the Renderable,
|
|
8
8
|
* by proportionally scaling a sprite by splitting it in a grid of nine parts (with only parts 1, 3, 7, 9 not being scaled). <br>
|
|
9
9
|
* <img src="images/9-slice-scaling.png"/><br>
|
|
10
|
+
* @category Game Objects
|
|
10
11
|
* @see https://en.wikipedia.org/wiki/9-slice_scaling
|
|
11
12
|
*/
|
|
12
13
|
export default class NineSliceSprite extends Sprite {
|
|
@@ -18,7 +19,7 @@ export default class NineSliceSprite extends Sprite {
|
|
|
18
19
|
* @param {number} settings.height - the height of the Renderable over which the sprite needs to be stretched
|
|
19
20
|
* @param {number} [settings.insetx] - the width of a corner over which the sprite is unscaled (default is a quarter of the sprite width)
|
|
20
21
|
* @param {number} [settings.insety] - the height of a corner over which the sprite is unscaled (default is a quarter of the sprite height)
|
|
21
|
-
* @param {HTMLImageElement|HTMLCanvasElement|TextureAtlas|string} settings.image - reference to spritesheet image, a texture atlas or to a texture atlas
|
|
22
|
+
* @param {HTMLImageElement|HTMLCanvasElement|TextureAtlas|CompressedImage|string} settings.image - reference to spritesheet image, a texture atlas, a compressed texture, or to a texture atlas
|
|
22
23
|
* @param {string} [settings.name=""] - name of this object
|
|
23
24
|
* @param {string} [settings.region] - region name of a specific region to use when using a texture atlas, see {@link TextureAtlas}
|
|
24
25
|
* @param {number} [settings.framewidth] - Width of a single frame within the spritesheet
|
|
@@ -40,7 +41,7 @@ export default class NineSliceSprite extends Sprite {
|
|
|
40
41
|
height: number;
|
|
41
42
|
insetx?: number | undefined;
|
|
42
43
|
insety?: number | undefined;
|
|
43
|
-
image: HTMLImageElement | HTMLCanvasElement | TextureAtlas | string;
|
|
44
|
+
image: HTMLImageElement | HTMLCanvasElement | TextureAtlas | CompressedImage | string;
|
|
44
45
|
name?: string | undefined;
|
|
45
46
|
region?: string | undefined;
|
|
46
47
|
framewidth?: number | undefined;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"nineslicesprite.d.ts","sourceRoot":"","sources":["../../src/renderable/nineslicesprite.js"],"names":[],"mappings":"AAEA;;;;GAIG;AAEH
|
|
1
|
+
{"version":3,"file":"nineslicesprite.d.ts","sourceRoot":"","sources":["../../src/renderable/nineslicesprite.js"],"names":[],"mappings":"AAEA;;;;GAIG;AAEH;;;;;;GAMG;AACH;IACC;;;;;;;;;;;;;;;;;;;;;;;;OAwBG;IACH,eAxBW,MAAM,KACN,MAAM,YAEd;QAAyB,KAAK,EAAtB,MAAM;QACW,MAAM,EAAvB,MAAM;QACY,MAAM;QACN,MAAM;QACyD,KAAK,EAAtF,gBAAgB,GAAC,iBAAiB,GAAC,YAAY,GAAC,eAAe,GAAC,MAAM;QACpD,IAAI;QACJ,MAAM;QACN,UAAU;QACV,WAAW;QACL,IAAI;QACV,KAAK;QACL,KAAK;QACH,WAAW;KACvC,EA8BF;IASD,iBALU,MAAM,EAOf;IATD;;;OAGG;IACH,aAFU,MAAM,CAIf;IAYD,kBALU,MAAM,EAOf;IATD;;;OAGG;IACH,cAFU,MAAM,CAIf;IAxBA,kBAA2B;IAC3B,mBAA6B;IAE7B,2BAA6B;IAC7B,2BAA6B;IAyB9B;;OAEG;IACH,0BA4JC;CACD;mBAvPkB,aAAa;kCAKC,6BAA6B;2BADtC,oBAAoB"}
|
|
@@ -7,13 +7,14 @@
|
|
|
7
7
|
* @import {Ellipse} from "./../geometries/ellipse.ts";
|
|
8
8
|
* @import {Polygon} from "../geometries/polygon.ts";
|
|
9
9
|
* @import {RoundRect} from "./../geometries/roundrect.ts";
|
|
10
|
-
* @import Application from "./../application/application.
|
|
10
|
+
* @import Application from "./../application/application.ts";
|
|
11
11
|
* @import CanvasRenderer from "./../video/canvas/canvas_renderer.js";
|
|
12
12
|
* @import WebGLRenderer from "./../video/webgl/webgl_renderer.js";
|
|
13
13
|
* @import ResponseObject from "./../physics/response.js";
|
|
14
14
|
**/
|
|
15
15
|
/**
|
|
16
16
|
* A base class for renderable objects.
|
|
17
|
+
* @category Game Objects
|
|
17
18
|
*/
|
|
18
19
|
export default class Renderable extends Rect {
|
|
19
20
|
isDirty: boolean;
|
|
@@ -115,6 +116,15 @@ export default class Renderable extends Rect {
|
|
|
115
116
|
* @default false
|
|
116
117
|
*/
|
|
117
118
|
floating: boolean;
|
|
119
|
+
/**
|
|
120
|
+
* If true, this floating renderable will be rendered by all cameras
|
|
121
|
+
* (e.g. background image layers). If false (default), floating elements
|
|
122
|
+
* are only rendered by the default camera (e.g. UI/HUD elements).
|
|
123
|
+
* Only applies to floating renderables in multi-camera setups.
|
|
124
|
+
* @type {boolean}
|
|
125
|
+
* @default false
|
|
126
|
+
*/
|
|
127
|
+
visibleInAllCameras: boolean;
|
|
118
128
|
/**
|
|
119
129
|
* When enabled, an object container will automatically apply
|
|
120
130
|
* any defined transformation before calling the child draw method.
|
|
@@ -171,11 +181,37 @@ export default class Renderable extends Rect {
|
|
|
171
181
|
*/
|
|
172
182
|
mask: Rect | RoundRect | Polygon | Line | Ellipse;
|
|
173
183
|
/**
|
|
174
|
-
*
|
|
175
|
-
* @
|
|
184
|
+
* an optional shader, to be used instead of the default built-in one, when drawing this renderable (WebGL only).
|
|
185
|
+
* Use {@link ShaderEffect} for a simplified API that only requires a fragment `apply()` function,
|
|
186
|
+
* or {@link GLShader} for full control over vertex and fragment shaders.
|
|
187
|
+
* In Canvas mode, this property is ignored.
|
|
188
|
+
* @type {GLShader|ShaderEffect}
|
|
176
189
|
* @default undefined
|
|
190
|
+
* @example
|
|
191
|
+
* // grayscale effect — converts the sprite to black and white
|
|
192
|
+
* mySprite.shader = new ShaderEffect(renderer, `
|
|
193
|
+
* vec4 apply(vec4 color, vec2 uv) {
|
|
194
|
+
* float gray = dot(color.rgb, vec3(0.299, 0.587, 0.114));
|
|
195
|
+
* return vec4(vec3(gray), color.a);
|
|
196
|
+
* }
|
|
197
|
+
* `);
|
|
198
|
+
* @example
|
|
199
|
+
* // pulsing brightness effect — makes the sprite glow rhythmically
|
|
200
|
+
* const effect = new ShaderEffect(renderer, `
|
|
201
|
+
* uniform float uTime;
|
|
202
|
+
* vec4 apply(vec4 color, vec2 uv) {
|
|
203
|
+
* float pulse = 0.8 + 0.2 * sin(uTime * 3.0);
|
|
204
|
+
* return vec4(color.rgb * pulse, color.a);
|
|
205
|
+
* }
|
|
206
|
+
* `);
|
|
207
|
+
* mySprite.shader = effect;
|
|
208
|
+
* // update the uniform each frame
|
|
209
|
+
* effect.setUniform("uTime", time);
|
|
210
|
+
* @example
|
|
211
|
+
* // to remove a custom shader
|
|
212
|
+
* mySprite.shader = undefined;
|
|
177
213
|
*/
|
|
178
|
-
shader: GLShader;
|
|
214
|
+
shader: GLShader | ShaderEffect;
|
|
179
215
|
/**
|
|
180
216
|
* the blend mode to be applied to this renderable (see renderer setBlendMode for available blend mode)
|
|
181
217
|
* @type {string}
|
|
@@ -405,7 +441,7 @@ export default class Renderable extends Rect {
|
|
|
405
441
|
* @param {Renderable} other - the other renderable touching this one (a reference to response.a or response.b)
|
|
406
442
|
* @returns {boolean} true if the object should respond to the collision (its position and velocity will be corrected)
|
|
407
443
|
* @example
|
|
408
|
-
* //
|
|
444
|
+
* // collision handler
|
|
409
445
|
* onCollision(response) {
|
|
410
446
|
* if (response.b.body.collisionType === me.collision.types.ENEMY_OBJECT) {
|
|
411
447
|
* // makes the other object solid, by substracting the overlap vector to the current position
|
|
@@ -440,9 +476,8 @@ import type { RoundRect } from "./../geometries/roundrect.ts";
|
|
|
440
476
|
import type { Polygon } from "../geometries/polygon.ts";
|
|
441
477
|
import type { Line } from "./../geometries/line.ts";
|
|
442
478
|
import type { Ellipse } from "./../geometries/ellipse.ts";
|
|
443
|
-
import GLShader from "./../video/webgl/glshader.js";
|
|
444
479
|
import { Color } from "./../math/color.ts";
|
|
445
|
-
import type Application from "./../application/application.
|
|
480
|
+
import type Application from "./../application/application.ts";
|
|
446
481
|
import { Bounds } from "./../physics/bounds.ts";
|
|
447
482
|
import type CanvasRenderer from "./../video/canvas/canvas_renderer.js";
|
|
448
483
|
import type WebGLRenderer from "./../video/webgl/webgl_renderer.js";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"renderable.d.ts","sourceRoot":"","sources":["../../src/renderable/renderable.js"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"renderable.d.ts","sourceRoot":"","sources":["../../src/renderable/renderable.js"],"names":[],"mappings":"AAYA;;;;;;;;;;;;;IAaI;AAEJ;;;GAGG;AACH;IAkBG,iBAAmB;IAGpB;;;;;;;;;;OAUG;IACH,aAHU,eAAe,CAMvB;IAGD;;;OAGG;IACH,kBAFU,QAAQ,CAEwB;IAI3C;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;OAmCG;IACH,MAlCU,IAAI,CAkCO;IAErB;;;;;OAKG;IACH,MAFU,MAAM,CAEK;IAErB;;;;;;;;;;OAUG;IACH,6BAAmC;IAEnC;;;;OAIG;IACH,cAHU,OAAO,CAGQ;IAEzB;;;;OAIG;IACH,kBAHU,OAAO,CAGY;IAE7B;;;;OAIG;IACH,cAHU,OAAO,CAGQ;IAEzB;;;;;OAKG;IACH,UAHU,OAAO,CAGI;IAErB;;;;;;;OAOG;IACH,qBAHU,OAAO,CAGe;IAEhC;;;;;;;;;;;;;;;;OAgBG;IACH,eAdU,OAAO,CAcQ;IAEzB;;;;;;;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IAED;;;;OAIG;IACH,mBAHW,UAAU,GAAC,QAAQ,GAAC,QAAQ,GAC1B,MAAM,CAkBlB;IAED;;;;OAIG;IACH,eAHW,UAAU,GAAC,QAAQ,GAAC,QAAQ,GAC1B,UAAU,CAgBtB;IAED;;;;;OAKG;IACH,cAJW,MAAM,MACN,QAAQ,GAAC,kBAAkB,GACzB,UAAU,CAStB;IAED;;;;;;;;;OASG;IACH,SAJW,MAAM,MACN,MAAM,GACJ,UAAU,CAOtB;IAED;;;;OAIG;IACH,UAHW,QAAQ,GACN,UAAU,CAKtB;IAED;;;;OAIG;IAEH,WAJW,MAAM,GACJ,OAAO,CAKnB;IAED;;;;OAIG;IACH,wBAHW,OAAO,GACL,MAAM,CAwClB;IAED;;;OAGG;IACH,uBAFa,QAAQ,CAgBpB;IAED;;;;;;OAMG;IACH,kBAFW,cAAc,GAAC,aAAa,QAmDtC;IAED;;;;;;;;;;;;OAYG;IAEH,eAJW,cAAc,GAAC,aAAa,aAC5B,QAAQ,QAKlB;IAED;;;;;OAKG;IACH,mBAFW,cAAc,GAAC,aAAa,QAqBtC;IAED;;;;;;;;;;;;;;;;;;;OAmBG;IACH,eAfa,OAAO,CAiBnB;IAED;;;OAGG;IACH,8BA0DC;IAED;;;OAGG;IACH,uBAEC;CACD;qBA/3BoB,8BAA8B;gCADnB,kCAAkC;8BAcvC,qBAAqB;iBAN/B,sBAAsB;2BAQb,gBAAgB;wBADnB,oBAAoB;+BAKf,8BAA8B;6BADhC,0BAA0B;0BAF7B,yBAAyB;6BACtB,4BAA4B;sBAfrB,oBAAoB;6BAkBzB,iCAAiC;uBAZ1B,wBAAwB;gCAa5B,sCAAsC;+BACvC,oCAAoC"}
|
|
@@ -6,13 +6,14 @@
|
|
|
6
6
|
*/
|
|
7
7
|
/**
|
|
8
8
|
* An object to display a fixed or animated sprite on screen.
|
|
9
|
+
* @category Game Objects
|
|
9
10
|
*/
|
|
10
11
|
export default class Sprite extends Renderable {
|
|
11
12
|
/**
|
|
12
13
|
* @param {number} x - the x coordinates of the sprite object
|
|
13
14
|
* @param {number} y - the y coordinates of the sprite object
|
|
14
15
|
* @param {object} settings - Configuration parameters for the Sprite object
|
|
15
|
-
* @param {HTMLImageElement|HTMLCanvasElement|HTMLVideoElement|TextureAtlas|string} settings.image - reference to spritesheet image, a texture atlas, a video element, or to a texture atlas
|
|
16
|
+
* @param {HTMLImageElement|HTMLCanvasElement|HTMLVideoElement|TextureAtlas|CompressedImage|string} settings.image - reference to spritesheet image, a texture atlas, a video element, a compressed texture, or to a texture atlas
|
|
16
17
|
* @param {string} [settings.name=""] - name of this object
|
|
17
18
|
* @param {string} [settings.region] - region name of a specific region to use when using a texture atlas, see {@link TextureAtlas}
|
|
18
19
|
* @param {number} [settings.framewidth] - Width of a single frame within the spritesheet
|
|
@@ -51,7 +52,7 @@ export default class Sprite extends Renderable {
|
|
|
51
52
|
* videoSprite.play();
|
|
52
53
|
*/
|
|
53
54
|
constructor(x: number, y: number, settings: {
|
|
54
|
-
image: HTMLImageElement | HTMLCanvasElement | HTMLVideoElement | TextureAtlas | string;
|
|
55
|
+
image: HTMLImageElement | HTMLCanvasElement | HTMLVideoElement | TextureAtlas | CompressedImage | string;
|
|
55
56
|
name?: string | undefined;
|
|
56
57
|
region?: string | undefined;
|
|
57
58
|
framewidth?: number | undefined;
|
|
@@ -104,6 +105,7 @@ export default class Sprite extends Renderable {
|
|
|
104
105
|
height: number;
|
|
105
106
|
angle: number;
|
|
106
107
|
idx: number;
|
|
108
|
+
trim: null;
|
|
107
109
|
};
|
|
108
110
|
dt: number;
|
|
109
111
|
/**
|
|
@@ -116,7 +118,7 @@ export default class Sprite extends Renderable {
|
|
|
116
118
|
callback: null;
|
|
117
119
|
state: boolean;
|
|
118
120
|
};
|
|
119
|
-
image:
|
|
121
|
+
image: any;
|
|
120
122
|
textureAtlas: any;
|
|
121
123
|
width: any;
|
|
122
124
|
height: any;
|
|
@@ -177,7 +179,7 @@ export default class Sprite extends Renderable {
|
|
|
177
179
|
* this.addAnimation("turn", [{ name: 0, delay: 200 }, { name: 1, delay: 100 }])
|
|
178
180
|
* // can do this with atlas values as well:
|
|
179
181
|
* this.addAnimation("turn", [{ name: "turnone", delay: 200 }, { name: "turntwo", delay: 100 }])
|
|
180
|
-
* // define
|
|
182
|
+
* // define a dying animation that stop on the last frame
|
|
181
183
|
* this.addAnimation("die", [{ name: 3, delay: 200 }, { name: 4, delay: 100 }, { name: 5, delay: Infinity }])
|
|
182
184
|
* // set the standing animation as default
|
|
183
185
|
* this.setCurrentAnimation("stand");
|
|
@@ -270,7 +272,7 @@ export default class Sprite extends Renderable {
|
|
|
270
272
|
*/
|
|
271
273
|
getAnimationFrameObjectByIndex(id: number): number;
|
|
272
274
|
/**
|
|
273
|
-
* draw this
|
|
275
|
+
* draw this sprite (automatically called by melonJS)
|
|
274
276
|
* @param {CanvasRenderer|WebGLRenderer} renderer - a renderer instance
|
|
275
277
|
* @param {Camera2d} [viewport] - the viewport to (re)draw
|
|
276
278
|
*/
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"sprite.d.ts","sourceRoot":"","sources":["../../src/renderable/sprite.js"],"names":[],"mappings":"AAQA;;;;;GAKG;AAEH
|
|
1
|
+
{"version":3,"file":"sprite.d.ts","sourceRoot":"","sources":["../../src/renderable/sprite.js"],"names":[],"mappings":"AAQA;;;;;GAKG;AAEH;;;GAGG;AACH;IACC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;OAyCG;IACH,eAzCW,MAAM,KACN,MAAM,YAEd;QAA0G,KAAK,EAAvG,gBAAgB,GAAC,iBAAiB,GAAC,gBAAgB,GAAC,YAAY,GAAC,eAAe,GAAC,MAAM;QACrE,IAAI;QACJ,MAAM;QACN,UAAU;QACV,WAAW;QACL,IAAI;QACV,KAAK;QACL,KAAK;QACH,WAAW;KACvC,EAoQF;IAnOA;;;OAGG;IACH,gBAHU,OAAO,CAGU;IAE3B;;;;OAIG;IACH,gBAHU,MA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vC,oCAAoC;sBAX5C,kBAAkB"}
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* a bitmap font object
|
|
3
|
+
* @category Text
|
|
3
4
|
*/
|
|
4
5
|
export default class BitmapText extends Renderable {
|
|
5
6
|
/**
|
|
@@ -28,7 +29,7 @@ export default class BitmapText extends Renderable {
|
|
|
28
29
|
* // two possibilities for using "myFont"
|
|
29
30
|
* // either call the draw function from your Renderable draw function
|
|
30
31
|
* myFont.draw(renderer, "Hello!", 0, 0);
|
|
31
|
-
* // or just add it to the
|
|
32
|
+
* // or just add it to the world container
|
|
32
33
|
* me.game.world.addChild(myFont);
|
|
33
34
|
*/
|
|
34
35
|
constructor(x: number, y: number, settings: {
|
|
@@ -54,7 +55,7 @@ export default class BitmapText extends Renderable {
|
|
|
54
55
|
public textAlign: string;
|
|
55
56
|
/**
|
|
56
57
|
* Set the text baseline (e.g. the Y-coordinate for the draw operation), <br>
|
|
57
|
-
* possible values are "top", "hanging, "middle, "alphabetic, "ideographic, "bottom"<br>
|
|
58
|
+
* possible values are "top", "hanging", "middle", "alphabetic", "ideographic", "bottom"<br>
|
|
58
59
|
* @public
|
|
59
60
|
* @type {string}
|
|
60
61
|
* @default "top"
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"bitmaptext.d.ts","sourceRoot":"","sources":["../../../src/renderable/text/bitmaptext.js"],"names":[],"mappings":"AAOA
|
|
1
|
+
{"version":3,"file":"bitmaptext.d.ts","sourceRoot":"","sources":["../../../src/renderable/text/bitmaptext.js"],"names":[],"mappings":"AAOA;;;GAGG;AACH;IACC;;;;;;;;;;;;;;;;;;;;;;;;;;;;OA4BG;IACH,eA5BW,MAAM,KACN,MAAM,YAEd;QAA+B,IAAI,EAA3B,MAAM,8DAAM;QACM,QAAQ;QACR,IAAI;QACE,SAAS;QACf,SAAS;QACT,SAAS;QACT,YAAY;QACZ,UAAU;QACR,WAAW;QACb,aAAa;QACF,IAAI;KACzC,EAsHF;IApGA;;;;;;OAMG;IACH,kBAHU,MAAM,CAG6B;IAE7C;;;;;;OAMG;IACH,qBAHU,MAAM,CAGkC;IAElD;;;;;;OAMG;IACH,mBAHU,MAAM,CAG4B;IAE5C;;;;;;OAMG;IACH,sBAHU,MAAM,CAGiC;IAEjD;;;OAGG;IACH,cAAe;IAEf;;;OAGG;IACH,kBAA2C;IAE3C;;;OAGG;IACH,kBAG2B;IAG1B;;;OAGG;IAEH,iBAAgE;IAyJlE,4BANU,KAAK,EAad;IAhBD;;;;;OAKG;IACH,wBAHU,KAAK,CAKd;IA5HA,qBAAoC;IAWrC;;;;;OAKG;IACH,eAJW,MAAM,UACN,MAAM,GACJ,UAAU,CAWtB;IAED;;;;OAIG;IACH,gBAHW,MAAM,GAAC,MAAM,GAAC,MAAM,EAAE,GACpB,UAAU,CAmBtB;IAED;;;;OAIG;IACH,wBAHW,OAAO,GACL,MAAM,CA2DlB;IAoBD;;;;OAIG;IACH,cAHW,MAAM,GACJ,UAAU,CAUtB;IAED;;;;OAIG;IACH,mBAHW,MAAM,GACJ,WAAW,CAIvB;IAED;;;;;;OAMG;IACH,eALW,cAAc,GAAC,aAAa,SAC5B,MAAM,MACN,MAAM,MACN,MAAM,QAuHhB;IAED;;;OAGG;IACH,gBAQC;CACD;uBA9asB,kBAAkB;sBAFnB,qBAAqB;wBAInB,kBAAkB"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"bitmaptextdata.d.ts","sourceRoot":"","sources":["../../../src/renderable/text/bitmaptextdata.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,MAAM,YAAY,CAAC;AAgF/B,MAAM,CAAC,OAAO,OAAO,cAAc;IAClC,MAAM,EAAE,MAAM,CAAK;IACnB,QAAQ,EAAE,MAAM,CAAK;IACrB,SAAS,EAAE,MAAM,CAAK;IACtB,OAAO,EAAE,MAAM,CAAK;IACpB,UAAU,EAAE,MAAM,CAAK;IACvB,SAAS,EAAE,MAAM,CAAK;IACtB,OAAO,EAAE,MAAM,CAAK;IACpB,MAAM,EAAE;QAAE,CAAC,GAAG,EAAE,MAAM,GAAG,KAAK,CAAA;KAAE,CAAM;gBAE1B,IAAI,EAAE,MAAM;IAIxB,KAAK,CAAC,QAAQ,EAAE,MAAM;CA4FtB;AAED,eAAO,MAAM,kBAAkB,yEAY7B,CAAC"}
|
|
1
|
+
{"version":3,"file":"bitmaptextdata.d.ts","sourceRoot":"","sources":["../../../src/renderable/text/bitmaptextdata.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,MAAM,YAAY,CAAC;AAgF/B;;;GAGG;AACH,MAAM,CAAC,OAAO,OAAO,cAAc;IAClC,MAAM,EAAE,MAAM,CAAK;IACnB,QAAQ,EAAE,MAAM,CAAK;IACrB,SAAS,EAAE,MAAM,CAAK;IACtB,OAAO,EAAE,MAAM,CAAK;IACpB,UAAU,EAAE,MAAM,CAAK;IACvB,SAAS,EAAE,MAAM,CAAK;IACtB,OAAO,EAAE,MAAM,CAAK;IACpB,MAAM,EAAE;QAAE,CAAC,GAAG,EAAE,MAAM,GAAG,KAAK,CAAA;KAAE,CAAM;gBAE1B,IAAI,EAAE,MAAM;IAIxB,KAAK,CAAC,QAAQ,EAAE,MAAM;CA4FtB;AAED,eAAO,MAAM,kBAAkB,yEAY7B,CAAC"}
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* a generic system font object.
|
|
3
|
+
* @category Text
|
|
3
4
|
*/
|
|
4
5
|
export default class Text extends Renderable {
|
|
5
6
|
/**
|
|
@@ -60,7 +61,7 @@ export default class Text extends Renderable {
|
|
|
60
61
|
textAlign: string;
|
|
61
62
|
/**
|
|
62
63
|
* Set the text baseline (e.g. the Y-coordinate for the draw operation), <br>
|
|
63
|
-
* possible values are "top", "hanging, "middle, "alphabetic, "ideographic, "bottom"<br>
|
|
64
|
+
* possible values are "top", "hanging", "middle", "alphabetic", "ideographic", "bottom"<br>
|
|
64
65
|
* @type {string}
|
|
65
66
|
* @default "top"
|
|
66
67
|
*/
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"text.d.ts","sourceRoot":"","sources":["../../../src/renderable/text/text.js"],"names":[],"mappings":"AAoBA
|
|
1
|
+
{"version":3,"file":"text.d.ts","sourceRoot":"","sources":["../../../src/renderable/text/text.js"],"names":[],"mappings":"AAoBA;;;GAGG;AACH;IACC;;;;;;;;;;;;;;;;;OAiBG;IACH,eAjBW,MAAM,KACN,MAAM,YAEd;QAAyB,IAAI,EAArB,MAAM;QACkB,IAAI,EAA5B,MAAM,GAAC,MAAM;QACW,SAAS;QACT,WAAW;QACjB,SAAS;QACT,SAAS;QACT,YAAY;QACZ,UAAU;QACR,WAAW;QACb,aAAa;QACF,IAAI;KACzC,EA2EF;IApEA;;;;OAIG;IACH,WAHU,KAAK,CAGwB;IAEvC;;;;OAIG;IACH,aAHU,KAAK,CAG0B;IAEzC;;;;OAIG;IACH,WAHU,MAAM,CAGE;IAElB;;;;;OAKG;IACH,WAHU,MAAM,CAGO;IAEvB;;;;;OAKG;IACH,cAHU,MAAM,CAGS;IAEzB;;;;;OAKG;IACH,YAHU,MAAM,CAGK;IAErB;;;;;OAKG;IACH,eAHU,MAAM,CAGO;IAEvB;;;;OAIG;IACH,UAHU,MAAM,CAGE;IAElB;;;OAGG;IACH,cAAe;IAMhB,cAAc;IACd,kDAqEC;IATA,8CAEE;IAGF,iCAAoC;IAMrC;;;OAGG;IACH,QAFa,IAAI,CAMhB;IAHA,UAA+B;IAKhC;;;OAGG;IACH,UAFa,IAAI,CAMhB;IAED;;;;;;;;OAQG;IACH,cAPW,MAAM,SACN,MAAM,GAAC,MAAM,GACX,IAAI,CAiChB;IAED;;;;OAIG;IACH,gBAHW,MAAM,GAAC,MAAM,GAAC,MAAM,EAAE,GACpB,IAAI,CA6DhB;IAED;;;;;OAKG;IACH,sBAJW,cAAc,GAAC,aAAa,SAC5B,MAAM,GACJ,WAAW,CAIvB;IAED;;;;;;OAMG;IACH,eALW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