melonjs 14.4.0 → 15.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/LICENSE.md +1 -1
- package/README.md +13 -57
- package/dist/melonjs.mjs/_virtual/_commonjsHelpers.js +1 -1
- package/dist/melonjs.mjs/_virtual/arraymultimap.js +1 -1
- package/dist/melonjs.mjs/_virtual/earcut.js +1 -1
- package/dist/melonjs.mjs/_virtual/howler.js +1 -1
- package/dist/melonjs.mjs/_virtual/index.js +1 -1
- package/dist/melonjs.mjs/_virtual/index2.js +1 -1
- package/dist/melonjs.mjs/_virtual/multimap.js +1 -1
- package/dist/melonjs.mjs/_virtual/setmultimap.js +1 -1
- package/dist/melonjs.mjs/application/application.js +1 -1
- package/dist/melonjs.mjs/application/header.js +1 -1
- package/dist/melonjs.mjs/application/resize.js +1 -1
- package/dist/melonjs.mjs/application/settings.js +1 -1
- package/dist/melonjs.mjs/audio/audio.js +5 -7
- package/dist/melonjs.mjs/camera/camera2d.js +1 -1
- package/dist/melonjs.mjs/const.js +1 -1
- package/dist/melonjs.mjs/entity/entity.js +43 -9
- package/dist/melonjs.mjs/geometries/ellipse.js +2 -3
- package/dist/melonjs.mjs/geometries/line.js +1 -1
- package/dist/melonjs.mjs/geometries/path2d.js +20 -44
- package/dist/melonjs.mjs/geometries/point.js +1 -6
- package/dist/melonjs.mjs/geometries/poly.js +2 -5
- package/dist/melonjs.mjs/geometries/rectangle.js +13 -9
- package/dist/melonjs.mjs/geometries/roundrect.js +1 -1
- package/dist/melonjs.mjs/index.js +10 -6
- package/dist/melonjs.mjs/input/gamepad.js +10 -16
- package/dist/melonjs.mjs/input/input.js +1 -1
- package/dist/melonjs.mjs/input/keyboard.js +1 -1
- package/dist/melonjs.mjs/input/pointer.js +1 -1
- package/dist/melonjs.mjs/input/pointerevent.js +3 -17
- package/dist/melonjs.mjs/lang/console.js +1 -1
- package/dist/melonjs.mjs/lang/deprecated.js +1 -1
- package/dist/melonjs.mjs/level/level.js +3 -3
- package/dist/melonjs.mjs/level/tiled/TMXGroup.js +1 -1
- package/dist/melonjs.mjs/level/tiled/TMXLayer.js +1 -8
- package/dist/melonjs.mjs/level/tiled/TMXObject.js +1 -1
- package/dist/melonjs.mjs/level/tiled/TMXTile.js +1 -1
- package/dist/melonjs.mjs/level/tiled/TMXTileMap.js +8 -4
- package/dist/melonjs.mjs/level/tiled/TMXTileset.js +5 -5
- package/dist/melonjs.mjs/level/tiled/TMXTilesetGroup.js +1 -1
- package/dist/melonjs.mjs/level/tiled/TMXUtils.js +1 -1
- package/dist/melonjs.mjs/level/tiled/constants.js +1 -1
- package/dist/melonjs.mjs/level/tiled/renderer/TMXHexagonalRenderer.js +1 -1
- package/dist/melonjs.mjs/level/tiled/renderer/TMXIsometricRenderer.js +1 -1
- package/dist/melonjs.mjs/level/tiled/renderer/TMXOrthogonalRenderer.js +1 -1
- package/dist/melonjs.mjs/level/tiled/renderer/TMXRenderer.js +1 -1
- package/dist/melonjs.mjs/level/tiled/renderer/TMXStaggeredRenderer.js +1 -1
- package/dist/melonjs.mjs/level/tiled/renderer/autodetect.js +1 -1
- package/dist/melonjs.mjs/loader/cache.js +24 -0
- package/dist/melonjs.mjs/loader/loader.js +331 -716
- package/dist/melonjs.mjs/loader/loadingscreen.js +4 -4
- package/dist/melonjs.mjs/loader/melonjs_logo.png.js +1 -1
- package/dist/melonjs.mjs/loader/parser.js +281 -0
- package/dist/melonjs.mjs/loader/settings.js +91 -0
- package/dist/melonjs.mjs/math/color.js +9 -8
- package/dist/melonjs.mjs/math/math.js +1 -1
- package/dist/melonjs.mjs/math/matrix2.js +7 -9
- package/dist/melonjs.mjs/math/matrix3.js +18 -21
- package/dist/melonjs.mjs/math/observable_vector2.js +3 -3
- package/dist/melonjs.mjs/math/observable_vector3.js +3 -4
- package/dist/melonjs.mjs/math/vector2.js +3 -3
- package/dist/melonjs.mjs/math/vector3.js +3 -4
- package/dist/melonjs.mjs/node_modules/@teppeis/multimaps/dist/src/arraymultimap.js +1 -1
- package/dist/melonjs.mjs/node_modules/@teppeis/multimaps/dist/src/index.js +1 -1
- package/dist/melonjs.mjs/node_modules/@teppeis/multimaps/dist/src/multimap.js +1 -1
- package/dist/melonjs.mjs/node_modules/@teppeis/multimaps/dist/src/setmultimap.js +1 -1
- package/dist/melonjs.mjs/node_modules/earcut/src/earcut.js +1 -1
- package/dist/melonjs.mjs/node_modules/eventemitter3/index.js +1 -1
- package/dist/melonjs.mjs/node_modules/eventemitter3/index2.js +1 -1
- package/dist/melonjs.mjs/node_modules/howler/dist/howler.js +1 -1
- package/dist/melonjs.mjs/particles/emitter.js +3 -3
- package/dist/melonjs.mjs/particles/particle.js +1 -1
- package/dist/melonjs.mjs/particles/settings.js +1 -1
- package/dist/melonjs.mjs/physics/body.js +18 -14
- package/dist/melonjs.mjs/physics/bounds.js +18 -70
- package/dist/melonjs.mjs/physics/collision.js +1 -1
- package/dist/melonjs.mjs/physics/detector.js +1 -1
- package/dist/melonjs.mjs/physics/quadtree.js +1 -1
- package/dist/melonjs.mjs/physics/response.js +1 -1
- package/dist/melonjs.mjs/physics/sat.js +1 -1
- package/dist/melonjs.mjs/physics/world.js +1 -1
- package/dist/melonjs.mjs/plugin/plugin.js +3 -3
- package/dist/melonjs.mjs/renderable/collectable.js +1 -1
- package/dist/melonjs.mjs/renderable/colorlayer.js +1 -1
- package/dist/melonjs.mjs/renderable/container.js +25 -19
- package/dist/melonjs.mjs/renderable/dragndrop.js +1 -1
- package/dist/melonjs.mjs/renderable/imagelayer.js +7 -1
- package/dist/melonjs.mjs/renderable/light2d.js +1 -1
- package/dist/melonjs.mjs/renderable/nineslicesprite.js +1 -1
- package/dist/melonjs.mjs/renderable/renderable.js +148 -105
- package/dist/melonjs.mjs/renderable/sprite.js +33 -54
- package/dist/melonjs.mjs/renderable/trigger.js +1 -1
- package/dist/melonjs.mjs/renderable/ui/uibaseelement.js +1 -1
- package/dist/melonjs.mjs/renderable/ui/uispriteelement.js +1 -1
- package/dist/melonjs.mjs/renderable/ui/uitextbutton.js +1 -3
- package/dist/melonjs.mjs/state/stage.js +1 -1
- package/dist/melonjs.mjs/state/state.js +2 -2
- package/dist/melonjs.mjs/system/device.js +2 -2
- package/dist/melonjs.mjs/system/dom.js +1 -1
- package/dist/melonjs.mjs/system/event.js +1 -1
- package/dist/melonjs.mjs/system/platform.js +1 -1
- package/dist/melonjs.mjs/system/pooling.js +8 -18
- package/dist/melonjs.mjs/system/save.js +1 -1
- package/dist/melonjs.mjs/system/timer.js +1 -1
- package/dist/melonjs.mjs/text/bitmaptext.js +66 -8
- package/dist/melonjs.mjs/text/bitmaptextdata.js +1 -1
- package/dist/melonjs.mjs/text/glyph.js +1 -1
- package/dist/melonjs.mjs/text/text.js +56 -86
- package/dist/melonjs.mjs/text/textmetrics.js +1 -1
- package/dist/melonjs.mjs/text/textstyle.js +4 -6
- package/dist/melonjs.mjs/tweens/easing.js +1 -1
- package/dist/melonjs.mjs/tweens/interpolation.js +1 -1
- package/dist/melonjs.mjs/tweens/tween.js +1 -1
- package/dist/melonjs.mjs/utils/agent.js +1 -1
- package/dist/melonjs.mjs/utils/array.js +1 -1
- package/dist/melonjs.mjs/utils/file.js +1 -1
- package/dist/melonjs.mjs/utils/function.js +1 -1
- package/dist/melonjs.mjs/utils/string.js +2 -2
- package/dist/melonjs.mjs/utils/utils.js +2 -4
- package/dist/melonjs.mjs/video/canvas/canvas_renderer.js +7 -11
- package/dist/melonjs.mjs/video/renderer.js +2 -13
- package/dist/melonjs.mjs/video/texture/atlas.js +12 -17
- package/dist/melonjs.mjs/video/texture/cache.js +3 -3
- package/dist/melonjs.mjs/video/texture/canvas_texture.js +1 -1
- package/dist/melonjs.mjs/video/utils/autodetect.js +1 -1
- package/dist/melonjs.mjs/video/video.js +2 -2
- package/dist/melonjs.mjs/video/webgl/buffer/vertex.js +21 -17
- package/dist/melonjs.mjs/video/webgl/compositors/compositor.js +235 -0
- package/dist/melonjs.mjs/video/webgl/compositors/primitive_compositor.js +77 -0
- package/dist/melonjs.mjs/video/webgl/compositors/quad_compositor.js +249 -0
- package/dist/melonjs.mjs/video/webgl/{webgl_compositor.js → compositors/webgl_compositor.js} +20 -205
- package/dist/melonjs.mjs/video/webgl/glshader.js +1 -1
- package/dist/melonjs.mjs/video/webgl/shaders/primitive.frag.js +1 -1
- package/dist/melonjs.mjs/video/webgl/shaders/primitive.vert.js +2 -2
- package/dist/melonjs.mjs/video/webgl/shaders/quad.frag.js +1 -1
- package/dist/melonjs.mjs/video/webgl/shaders/quad.vert.js +2 -2
- package/dist/melonjs.mjs/video/webgl/utils/attributes.js +1 -1
- package/dist/melonjs.mjs/video/webgl/utils/precision.js +1 -1
- package/dist/melonjs.mjs/video/webgl/utils/program.js +1 -1
- package/dist/melonjs.mjs/video/webgl/utils/string.js +1 -1
- package/dist/melonjs.mjs/video/webgl/utils/uniforms.js +1 -1
- package/dist/melonjs.mjs/video/webgl/webgl_renderer.js +139 -149
- package/dist/melonjs.module.js +26320 -26376
- package/dist/types/entity/entity.d.ts +3 -3
- package/dist/types/geometries/path2d.d.ts +5 -31
- package/dist/types/geometries/point.d.ts +2 -7
- package/dist/types/geometries/poly.d.ts +0 -1
- package/dist/types/index.d.ts +5 -3
- package/dist/types/loader/cache.d.ts +7 -0
- package/dist/types/loader/loader.d.ts +166 -181
- package/dist/types/loader/parser.d.ts +41 -0
- package/dist/types/loader/settings.d.ts +57 -0
- package/dist/types/particles/emitter.d.ts +4 -4
- package/dist/types/physics/bounds.d.ts +29 -84
- package/dist/types/renderable/container.d.ts +0 -11
- package/dist/types/renderable/renderable.d.ts +43 -31
- package/dist/types/renderable/sprite.d.ts +3 -3
- package/dist/types/renderable/ui/uitextbutton.d.ts +0 -1
- package/dist/types/state/state.d.ts +1 -1
- package/dist/types/system/pooling.d.ts +2 -2
- package/dist/types/text/text.d.ts +6 -20
- package/dist/types/text/textstyle.d.ts +1 -1
- package/dist/types/video/canvas/canvas_renderer.d.ts +0 -5
- package/dist/types/video/renderer.d.ts +1 -5
- package/dist/types/video/webgl/buffer/vertex.d.ts +3 -3
- package/dist/types/video/webgl/compositors/compositor.d.ts +107 -0
- package/dist/types/video/webgl/compositors/primitive_compositor.d.ts +22 -0
- package/dist/types/video/webgl/compositors/quad_compositor.d.ts +72 -0
- package/dist/types/video/webgl/compositors/webgl_compositor.d.ts +86 -0
- package/dist/types/video/webgl/webgl_compositor.d.ts +2 -3
- package/dist/types/video/webgl/webgl_renderer.d.ts +34 -28
- package/package.json +18 -18
- package/src/audio/audio.js +4 -6
- package/src/entity/entity.js +42 -8
- package/src/geometries/ellipse.js +1 -2
- package/src/geometries/path2d.js +19 -43
- package/src/geometries/point.js +0 -5
- package/src/geometries/poly.js +1 -4
- package/src/geometries/rectangle.js +12 -8
- package/src/index.js +7 -3
- package/src/input/gamepad.js +9 -15
- package/src/input/pointerevent.js +1 -15
- package/src/level/level.js +2 -2
- package/src/level/tiled/TMXLayer.js +0 -7
- package/src/level/tiled/TMXTileMap.js +7 -3
- package/src/level/tiled/TMXTileset.js +4 -4
- package/src/loader/cache.js +16 -0
- package/src/loader/loader.js +339 -711
- package/src/loader/loadingscreen.js +3 -3
- package/src/loader/parser.js +279 -0
- package/src/loader/settings.js +85 -0
- package/src/math/color.js +8 -7
- package/src/math/matrix2.js +6 -8
- package/src/math/matrix3.js +17 -20
- package/src/math/observable_vector2.js +2 -2
- package/src/math/observable_vector3.js +2 -3
- package/src/math/vector2.js +2 -2
- package/src/math/vector3.js +2 -3
- package/src/particles/emitter.js +2 -2
- package/src/physics/body.js +17 -13
- package/src/physics/bounds.js +17 -69
- package/src/polyfill/index.js +0 -2
- package/src/renderable/container.js +24 -18
- package/src/renderable/imagelayer.js +6 -0
- package/src/renderable/renderable.js +147 -104
- package/src/renderable/sprite.js +32 -53
- package/src/renderable/ui/uitextbutton.js +0 -2
- package/src/state/state.js +1 -1
- package/src/system/device.js +1 -1
- package/src/system/pooling.js +7 -17
- package/src/text/bitmaptext.js +65 -7
- package/src/text/text.js +55 -85
- package/src/text/textstyle.js +3 -5
- package/src/utils/string.js +1 -1
- package/src/utils/utils.js +1 -3
- package/src/video/canvas/canvas_renderer.js +5 -9
- package/src/video/renderer.js +0 -11
- package/src/video/texture/atlas.js +11 -16
- package/src/video/texture/cache.js +2 -2
- package/src/video/video.js +1 -1
- package/src/video/webgl/buffer/vertex.js +20 -16
- package/src/video/webgl/compositors/compositor.js +226 -0
- package/src/video/webgl/compositors/primitive_compositor.js +68 -0
- package/src/video/webgl/compositors/quad_compositor.js +240 -0
- package/src/video/webgl/shaders/primitive.vert +2 -5
- package/src/video/webgl/shaders/quad.vert +3 -1
- package/src/video/webgl/webgl_renderer.js +137 -147
- package/dist/melonjs.mjs/_virtual/make-built-in.js +0 -10
- package/dist/melonjs.mjs/_virtual/object-define-property.js +0 -10
- package/dist/melonjs.mjs/_virtual/object-get-own-property-descriptor.js +0 -10
- package/dist/melonjs.mjs/_virtual/object-get-own-property-names.js +0 -10
- package/dist/melonjs.mjs/_virtual/object-get-own-property-symbols.js +0 -10
- package/dist/melonjs.mjs/_virtual/object-property-is-enumerable.js +0 -10
- package/dist/melonjs.mjs/_virtual/shared.js +0 -10
- package/dist/melonjs.mjs/game.js +0 -29
- package/dist/melonjs.mjs/polyfill/console.js +0 -18
- package/dist/melonjs.mjs/polyfill/performance.js +0 -27
- package/dist/melonjs.mjs/polyfill/requestAnimationFrame.js +0 -46
- package/dist/melonjs.mjs/polyfill/roundrect.js +0 -242
- package/dist/melonjs.mjs/renderable/re_container.js +0 -1016
- package/dist/melonjs.mjs/video/utils/resize.js +0 -116
- package/src/polyfill/performance.js +0 -20
- package/src/polyfill/requestAnimationFrame.js +0 -39
- package/src/video/webgl/webgl_compositor.js +0 -486
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* enable the nocache mechanism
|
|
3
|
+
* @ignore
|
|
4
|
+
*/
|
|
5
|
+
export function setNocache(enable?: boolean): void;
|
|
6
|
+
/**
|
|
7
|
+
* change the default baseURL for the given asset type.<br>
|
|
8
|
+
* (this will prepend the asset URL and must finish with a '/')
|
|
9
|
+
* @name setBaseURL
|
|
10
|
+
* @memberof loader
|
|
11
|
+
* @public
|
|
12
|
+
* @param {string} type - "*", "audio", binary", "image", "json", "js", "tmx", "tsx"
|
|
13
|
+
* @param {string} [url="./"] - default base URL
|
|
14
|
+
* @example
|
|
15
|
+
* // change the base URL relative address for audio assets
|
|
16
|
+
* me.loader.setBaseURL("audio", "data/audio/");
|
|
17
|
+
* // change the base URL absolute address for all object types
|
|
18
|
+
* me.loader.setBaseURL("*", "http://myurl.com/")
|
|
19
|
+
*/
|
|
20
|
+
export function setBaseURL(type: string, url?: string | undefined): void;
|
|
21
|
+
export let nocache: string;
|
|
22
|
+
export let baseURL: {};
|
|
23
|
+
/**
|
|
24
|
+
* crossOrigin attribute to configure the CORS requests for Image data element.
|
|
25
|
+
* By default (that is, when the attribute is not specified), CORS is not used at all.
|
|
26
|
+
* The "anonymous" keyword means that there will be no exchange of user credentials via cookies,
|
|
27
|
+
* client-side SSL certificates or HTTP authentication as described in the Terminology section of the CORS specification.<br>
|
|
28
|
+
* @type {string}
|
|
29
|
+
* @name crossOrigin
|
|
30
|
+
* @default undefined
|
|
31
|
+
* @memberof loader
|
|
32
|
+
* @see https://developer.mozilla.org/en-US/docs/Web/HTML/CORS_settings_attributes
|
|
33
|
+
* @example
|
|
34
|
+
* // allow for cross-origin texture loading in WebGL
|
|
35
|
+
* me.loader.crossOrigin = "anonymous";
|
|
36
|
+
*
|
|
37
|
+
* // set all ressources to be loaded
|
|
38
|
+
* me.loader.preload(game.resources, this.loaded.bind(this));
|
|
39
|
+
*/
|
|
40
|
+
export let crossOrigin: string;
|
|
41
|
+
/**
|
|
42
|
+
* indicates whether or not cross-site Access-Control requests should be made using credentials such as cookies,
|
|
43
|
+
* authorization headers or TLS client certificates. Setting withCredentials has no effect on same-site requests.
|
|
44
|
+
* @public
|
|
45
|
+
* @type {boolean}
|
|
46
|
+
* @name withCredentials
|
|
47
|
+
* @default false
|
|
48
|
+
* @memberof loader
|
|
49
|
+
* @see https://developer.mozilla.org/en-US/docs/Web/API/XMLHttpRequest/withCredentials
|
|
50
|
+
* @example
|
|
51
|
+
* // enable withCredentials
|
|
52
|
+
* me.loader.withCredentials = true;
|
|
53
|
+
*
|
|
54
|
+
* // set all ressources to be loaded
|
|
55
|
+
* me.loader.preload(game.resources, this.loaded.bind(this));
|
|
56
|
+
*/
|
|
57
|
+
export let withCredentials: boolean;
|
|
@@ -168,18 +168,18 @@ export default class ParticleEmitter extends Container {
|
|
|
168
168
|
isRunning(): boolean;
|
|
169
169
|
/**
|
|
170
170
|
* Launch particles from emitter constantly (e.g. for stream)
|
|
171
|
-
* @param {number} duration -
|
|
171
|
+
* @param {number} [duration] - time that the emitter releases particles in ms
|
|
172
172
|
*/
|
|
173
|
-
streamParticles(duration
|
|
173
|
+
streamParticles(duration?: number | undefined): void;
|
|
174
174
|
/**
|
|
175
175
|
* Stop the emitter from generating new particles (used only if emitter is Stream)
|
|
176
176
|
*/
|
|
177
177
|
stopStream(): void;
|
|
178
178
|
/**
|
|
179
179
|
* Launch all particles from emitter and stop (e.g. for explosion)
|
|
180
|
-
* @param {number} total -
|
|
180
|
+
* @param {number} [total] - number of particles to launch
|
|
181
181
|
*/
|
|
182
|
-
burstParticles(total
|
|
182
|
+
burstParticles(total?: number | undefined): void;
|
|
183
183
|
/**
|
|
184
184
|
* @ignore
|
|
185
185
|
*/
|
|
@@ -4,9 +4,9 @@
|
|
|
4
4
|
*/
|
|
5
5
|
export default class Bounds {
|
|
6
6
|
/**
|
|
7
|
-
* @param {Vector2d[]} [vertices] - an array of
|
|
7
|
+
* @param {Vector2d[]|Point[]} [vertices] - an array of Vector2d or Point
|
|
8
8
|
*/
|
|
9
|
-
constructor(vertices?: Vector2d[] | undefined);
|
|
9
|
+
constructor(vertices?: Vector2d[] | Point[] | undefined);
|
|
10
10
|
_center: Vector2d;
|
|
11
11
|
/**
|
|
12
12
|
* @ignore
|
|
@@ -22,147 +22,106 @@ export default class Bounds {
|
|
|
22
22
|
} | undefined;
|
|
23
23
|
/**
|
|
24
24
|
* reset the bound
|
|
25
|
-
* @name clear
|
|
26
|
-
* @memberof Bounds
|
|
27
25
|
*/
|
|
28
26
|
clear(): void;
|
|
29
27
|
/**
|
|
30
28
|
* sets the bounds to the given min and max value
|
|
31
|
-
* @name setMinMax
|
|
32
|
-
* @memberof Bounds
|
|
33
29
|
* @param {number} minX
|
|
34
30
|
* @param {number} minY
|
|
35
31
|
* @param {number} maxX
|
|
36
32
|
* @param {number} maxY
|
|
37
33
|
*/
|
|
38
34
|
setMinMax(minX: number, minY: number, maxX: number, maxY: number): void;
|
|
39
|
-
|
|
35
|
+
set x(arg: number);
|
|
40
36
|
/**
|
|
41
37
|
* x position of the bound
|
|
42
|
-
* @public
|
|
43
38
|
* @type {number}
|
|
44
|
-
* @name x
|
|
45
|
-
* @memberof Bounds
|
|
46
39
|
*/
|
|
47
|
-
|
|
48
|
-
|
|
40
|
+
get x(): number;
|
|
41
|
+
set y(arg: number);
|
|
49
42
|
/**
|
|
50
43
|
* y position of the bounds
|
|
51
|
-
* @public
|
|
52
44
|
* @type {number}
|
|
53
|
-
* @name y
|
|
54
|
-
* @memberof Bounds
|
|
55
45
|
*/
|
|
56
|
-
|
|
57
|
-
|
|
46
|
+
get y(): number;
|
|
47
|
+
set width(arg: number);
|
|
58
48
|
/**
|
|
59
49
|
* width of the bounds
|
|
60
|
-
* @public
|
|
61
50
|
* @type {number}
|
|
62
|
-
* @name width
|
|
63
|
-
* @memberof Bounds
|
|
64
51
|
*/
|
|
65
|
-
|
|
66
|
-
|
|
52
|
+
get width(): number;
|
|
53
|
+
set height(arg: number);
|
|
67
54
|
/**
|
|
68
55
|
* width of the bounds
|
|
69
|
-
* @public
|
|
70
56
|
* @type {number}
|
|
71
|
-
* @name width
|
|
72
|
-
* @memberof Bounds
|
|
73
57
|
*/
|
|
74
|
-
|
|
58
|
+
get height(): number;
|
|
75
59
|
/**
|
|
76
60
|
* left coordinate of the bound
|
|
77
|
-
* @public
|
|
78
61
|
* @type {number}
|
|
79
|
-
* @name left
|
|
80
|
-
* @memberof Bounds
|
|
81
62
|
*/
|
|
82
|
-
|
|
63
|
+
get left(): number;
|
|
83
64
|
/**
|
|
84
65
|
* right coordinate of the bound
|
|
85
|
-
* @public
|
|
86
66
|
* @type {number}
|
|
87
|
-
* @name right
|
|
88
|
-
* @memberof Bounds
|
|
89
67
|
*/
|
|
90
|
-
|
|
68
|
+
get right(): number;
|
|
91
69
|
/**
|
|
92
70
|
* top coordinate of the bound
|
|
93
|
-
* @public
|
|
94
71
|
* @type {number}
|
|
95
|
-
* @name top
|
|
96
|
-
* @memberof Bounds
|
|
97
72
|
*/
|
|
98
|
-
|
|
73
|
+
get top(): number;
|
|
99
74
|
/**
|
|
100
75
|
* bottom coordinate of the bound
|
|
101
|
-
* @public
|
|
102
76
|
* @type {number}
|
|
103
|
-
* @name bottom
|
|
104
|
-
* @memberof Bounds
|
|
105
77
|
*/
|
|
106
|
-
|
|
78
|
+
get bottom(): number;
|
|
107
79
|
/**
|
|
108
80
|
* center position of the bound on the x axis
|
|
109
|
-
* @public
|
|
110
81
|
* @type {number}
|
|
111
|
-
* @name centerX
|
|
112
|
-
* @memberof Bounds
|
|
113
82
|
*/
|
|
114
|
-
|
|
83
|
+
get centerX(): number;
|
|
115
84
|
/**
|
|
116
85
|
* center position of the bound on the y axis
|
|
117
|
-
* @public
|
|
118
86
|
* @type {number}
|
|
119
|
-
* @name centerY
|
|
120
|
-
* @memberof Bounds
|
|
121
87
|
*/
|
|
122
|
-
|
|
88
|
+
get centerY(): number;
|
|
123
89
|
/**
|
|
124
90
|
* return the center position of the bound
|
|
125
|
-
* @public
|
|
126
91
|
* @type {Vector2d}
|
|
127
|
-
* @name center
|
|
128
|
-
* @memberof Bounds
|
|
129
92
|
*/
|
|
130
|
-
|
|
93
|
+
get center(): Vector2d;
|
|
94
|
+
/**
|
|
95
|
+
* center the bounds position around the given coordinates
|
|
96
|
+
* @param {number} x - the x coordinate around which to center this bounds
|
|
97
|
+
* @param {number} y - the y coordinate around which to center this bounds
|
|
98
|
+
*/
|
|
99
|
+
centerOn(x: number, y: number): Bounds;
|
|
131
100
|
/**
|
|
132
101
|
* Updates bounds using the given vertices
|
|
133
|
-
* @
|
|
134
|
-
* @memberof Bounds
|
|
135
|
-
* @param {Vector2d[]} vertices - an array of me.Vector2d points
|
|
102
|
+
* @param {Vector2d[]|Point[]} vertices - an array of Vector2d or Point
|
|
136
103
|
*/
|
|
137
|
-
update(vertices: Vector2d[]): void;
|
|
104
|
+
update(vertices: Vector2d[] | Point[]): void;
|
|
138
105
|
/**
|
|
139
106
|
* add the given vertices to the bounds definition.
|
|
140
|
-
* @
|
|
141
|
-
* @memberof Bounds
|
|
142
|
-
* @param {Vector2d[]} vertices - an array of me.Vector2d points
|
|
107
|
+
* @param {Vector2d[]|Point[]} vertices - an array of Vector2d or Point
|
|
143
108
|
* @param {boolean} [clear=false] - either to reset the bounds before adding the new vertices
|
|
144
109
|
*/
|
|
145
|
-
add(vertices: Vector2d[], clear?: boolean | undefined): void;
|
|
110
|
+
add(vertices: Vector2d[] | Point[], clear?: boolean | undefined): void;
|
|
146
111
|
/**
|
|
147
112
|
* add the given bounds to the bounds definition.
|
|
148
|
-
* @name addBounds
|
|
149
|
-
* @memberof Bounds
|
|
150
113
|
* @param {Bounds} bounds
|
|
151
114
|
* @param {boolean} [clear=false] - either to reset the bounds before adding the new vertices
|
|
152
115
|
*/
|
|
153
116
|
addBounds(bounds: Bounds, clear?: boolean | undefined): void;
|
|
154
117
|
/**
|
|
155
118
|
* add the given point to the bounds definition.
|
|
156
|
-
* @
|
|
157
|
-
* @
|
|
158
|
-
* @param {Vector2d|Point} point - the point to be added to the bounds
|
|
159
|
-
* @param {Matrix2d} [m] - an optional transform to apply to the given point (only if the given point is a vector)
|
|
119
|
+
* @param {Vector2d|Point} point - the vector or point to be added to the bounds
|
|
120
|
+
* @param {Matrix2d} [m] - an optional transform to apply to the given point (if the given point is a Vector2d)
|
|
160
121
|
*/
|
|
161
122
|
addPoint(point: Vector2d | Point, m?: any): void;
|
|
162
123
|
/**
|
|
163
124
|
* add the given quad coordinates to this bound definition, multiplied by the given matrix
|
|
164
|
-
* @name addFrame
|
|
165
|
-
* @memberof Bounds
|
|
166
125
|
* @param {number} x0 - left X coordinates of the quad
|
|
167
126
|
* @param {number} y0 - top Y coordinates of the quad
|
|
168
127
|
* @param {number} x1 - right X coordinates of the quad
|
|
@@ -180,8 +139,6 @@ export default class Bounds {
|
|
|
180
139
|
*/
|
|
181
140
|
/**
|
|
182
141
|
* Returns true if the bounds contains the given point.
|
|
183
|
-
* @name contains
|
|
184
|
-
* @memberof Bounds
|
|
185
142
|
* @param {number} x
|
|
186
143
|
* @param {number} y
|
|
187
144
|
* @returns {boolean} True if the bounds contain the point, otherwise false
|
|
@@ -189,16 +146,12 @@ export default class Bounds {
|
|
|
189
146
|
contains(...args: any[]): boolean;
|
|
190
147
|
/**
|
|
191
148
|
* Returns true if the two bounds intersect.
|
|
192
|
-
* @name overlaps
|
|
193
|
-
* @memberof Bounds
|
|
194
149
|
* @param {Bounds|Rect} bounds
|
|
195
150
|
* @returns {boolean} True if the bounds overlap, otherwise false
|
|
196
151
|
*/
|
|
197
152
|
overlaps(bounds: Bounds | Rect): boolean;
|
|
198
153
|
/**
|
|
199
154
|
* determines whether all coordinates of this bounds are finite numbers.
|
|
200
|
-
* @name isFinite
|
|
201
|
-
* @memberof Bounds
|
|
202
155
|
* @returns {boolean} false if all coordinates are positive or negative Infinity or NaN; otherwise, true.
|
|
203
156
|
*/
|
|
204
157
|
isFinite(): boolean;
|
|
@@ -211,8 +164,6 @@ export default class Bounds {
|
|
|
211
164
|
*/
|
|
212
165
|
/**
|
|
213
166
|
* Translates the bounds by x on the x axis, and y on the y axis
|
|
214
|
-
* @name translate
|
|
215
|
-
* @memberof Bounds
|
|
216
167
|
* @param {number} x
|
|
217
168
|
* @param {number} y
|
|
218
169
|
*/
|
|
@@ -226,23 +177,17 @@ export default class Bounds {
|
|
|
226
177
|
*/
|
|
227
178
|
/**
|
|
228
179
|
* Shifts the bounds to the given x, y position.
|
|
229
|
-
* @name shift
|
|
230
|
-
* @memberof Bounds
|
|
231
180
|
* @param {number} x
|
|
232
181
|
* @param {number} y
|
|
233
182
|
*/
|
|
234
183
|
shift(...args: any[]): void;
|
|
235
184
|
/**
|
|
236
185
|
* clone this bounds
|
|
237
|
-
* @name clone
|
|
238
|
-
* @memberof Bounds
|
|
239
186
|
* @returns {Bounds}
|
|
240
187
|
*/
|
|
241
188
|
clone(): Bounds;
|
|
242
189
|
/**
|
|
243
190
|
* Returns a polygon whose edges are the same as this bounds.
|
|
244
|
-
* @name toPolygon
|
|
245
|
-
* @memberof Bounds
|
|
246
191
|
* @returns {Polygon} a new Polygon that represents this bounds.
|
|
247
192
|
*/
|
|
248
193
|
toPolygon(): Polygon;
|
|
@@ -206,23 +206,12 @@ export default class Container extends Renderable {
|
|
|
206
206
|
* @returns {Renderable[]} an array of renderable object
|
|
207
207
|
*/
|
|
208
208
|
getChildren(): Renderable[];
|
|
209
|
-
/**
|
|
210
|
-
* update the bounding box for this shape.
|
|
211
|
-
* @ignore
|
|
212
|
-
* @returns {Bounds} this shape bounding box Rectangle object
|
|
213
|
-
*/
|
|
214
|
-
updateBounds(forceUpdateChildBounds?: boolean): Bounds;
|
|
215
209
|
/**
|
|
216
210
|
* Checks if this container is root or if it's attached to the root container.
|
|
217
211
|
* @private
|
|
218
212
|
* @returns {boolean}
|
|
219
213
|
*/
|
|
220
214
|
private isAttachedToRoot;
|
|
221
|
-
/**
|
|
222
|
-
* update the cointainer's bounding rect (private)
|
|
223
|
-
* @ignore
|
|
224
|
-
*/
|
|
225
|
-
updateBoundsPos(newX: any, newY: any): Bounds;
|
|
226
215
|
/**
|
|
227
216
|
* @ignore
|
|
228
217
|
*/
|
|
@@ -5,16 +5,28 @@
|
|
|
5
5
|
*/
|
|
6
6
|
export default class Renderable extends Rect {
|
|
7
7
|
/**
|
|
8
|
-
*
|
|
9
|
-
* @
|
|
8
|
+
* Position of the Renderable relative to its parent container
|
|
9
|
+
* @public
|
|
10
|
+
* @type {ObservableVector3d}
|
|
10
11
|
*/
|
|
11
|
-
|
|
12
|
+
public pos: ObservableVector3d;
|
|
12
13
|
/**
|
|
13
|
-
*
|
|
14
|
-
*
|
|
15
|
-
*
|
|
14
|
+
* The anchor point is used for attachment behavior, and/or when applying transformations.<br>
|
|
15
|
+
* The coordinate system places the origin at the top left corner of the frame (0, 0) and (1, 1) means the bottom-right corner<br>
|
|
16
|
+
* <img src="images/anchor_point.png"/><br>
|
|
17
|
+
* a Renderable's anchor point defaults to (0.5,0.5), which corresponds to the center position.<br>
|
|
18
|
+
* <br>
|
|
19
|
+
* <i><b>Note:</b> Object created through Tiled will have their anchorPoint set to (0, 0) to match Tiled Level editor implementation.
|
|
20
|
+
* To specify a value through Tiled, use a json expression like `json:{"x":0.5,"y":0.5}`. </i>
|
|
21
|
+
* @type {ObservableVector2d}
|
|
22
|
+
* @default <0.5,0.5>
|
|
16
23
|
*/
|
|
17
|
-
|
|
24
|
+
anchorPoint: ObservableVector2d;
|
|
25
|
+
/**
|
|
26
|
+
* the renderable default transformation matrix
|
|
27
|
+
* @type {Matrix2d}
|
|
28
|
+
*/
|
|
29
|
+
currentTransform: Matrix2d;
|
|
18
30
|
/**
|
|
19
31
|
* the renderable physic body
|
|
20
32
|
* @type {Body}
|
|
@@ -51,11 +63,6 @@ export default class Renderable extends Rect {
|
|
|
51
63
|
* }
|
|
52
64
|
*/
|
|
53
65
|
body: Body;
|
|
54
|
-
/**
|
|
55
|
-
* the renderable default transformation matrix
|
|
56
|
-
* @type {Matrix2d}
|
|
57
|
-
*/
|
|
58
|
-
currentTransform: Matrix2d;
|
|
59
66
|
/**
|
|
60
67
|
* (G)ame (U)nique (Id)entifier" <br>
|
|
61
68
|
* a GUID will be allocated for any renderable object added <br>
|
|
@@ -100,18 +107,6 @@ export default class Renderable extends Rect {
|
|
|
100
107
|
* @default false
|
|
101
108
|
*/
|
|
102
109
|
floating: boolean;
|
|
103
|
-
/**
|
|
104
|
-
* The anchor point is used for attachment behavior, and/or when applying transformations.<br>
|
|
105
|
-
* The coordinate system places the origin at the top left corner of the frame (0, 0) and (1, 1) means the bottom-right corner<br>
|
|
106
|
-
* <img src="images/anchor_point.png"/><br>
|
|
107
|
-
* a Renderable's anchor point defaults to (0.5,0.5), which corresponds to the center position.<br>
|
|
108
|
-
* <br>
|
|
109
|
-
* <i><b>Note:</b> Object created through Tiled will have their anchorPoint set to (0, 0) to match Tiled Level editor implementation.
|
|
110
|
-
* To specify a value through Tiled, use a json expression like `json:{"x":0.5,"y":0.5}`. </i>
|
|
111
|
-
* @type {ObservableVector2d}
|
|
112
|
-
* @default <0.5,0.5>
|
|
113
|
-
*/
|
|
114
|
-
anchorPoint: ObservableVector2d;
|
|
115
110
|
/**
|
|
116
111
|
* When enabled, an object container will automatically apply
|
|
117
112
|
* any defined transformation before calling the child draw method.
|
|
@@ -167,6 +162,12 @@ export default class Renderable extends Rect {
|
|
|
167
162
|
* ]);
|
|
168
163
|
*/
|
|
169
164
|
mask: Rect | RoundRect | Polygon | Line | Ellipse;
|
|
165
|
+
/**
|
|
166
|
+
* (Experimental) an optional shader, to be used instead of the default built-in one, when drawing this renderable (WebGL only)
|
|
167
|
+
* @type {GLShader}
|
|
168
|
+
* @default undefined
|
|
169
|
+
*/
|
|
170
|
+
shader: GLShader;
|
|
170
171
|
/**
|
|
171
172
|
* the blend mode to be applied to this renderable (see renderer setBlendMode for available blend mode)
|
|
172
173
|
* @type {string}
|
|
@@ -182,15 +183,20 @@ export default class Renderable extends Rect {
|
|
|
182
183
|
*/
|
|
183
184
|
name: string;
|
|
184
185
|
/**
|
|
185
|
-
*
|
|
186
|
-
* @
|
|
187
|
-
* @type {ObservableVector3d}
|
|
186
|
+
* to identify the object as a renderable object
|
|
187
|
+
* @ignore
|
|
188
188
|
*/
|
|
189
|
-
|
|
189
|
+
isRenderable: boolean;
|
|
190
|
+
/**
|
|
191
|
+
* If true then physic collision and input events will not impact this renderable
|
|
192
|
+
* @type {boolean}
|
|
193
|
+
* @default true
|
|
194
|
+
*/
|
|
195
|
+
isKinematic: boolean;
|
|
190
196
|
/**
|
|
191
197
|
* when true the renderable will be redrawn during the next update cycle
|
|
192
198
|
* @type {boolean}
|
|
193
|
-
* @default
|
|
199
|
+
* @default true
|
|
194
200
|
*/
|
|
195
201
|
isDirty: boolean;
|
|
196
202
|
_flip: {
|
|
@@ -317,11 +323,17 @@ export default class Renderable extends Rect {
|
|
|
317
323
|
* @returns {boolean} true if the renderable is dirty
|
|
318
324
|
*/
|
|
319
325
|
update(dt: number): boolean;
|
|
326
|
+
/**
|
|
327
|
+
* update the bounding box for this shape.
|
|
328
|
+
* @param {boolean} [absolute=true] - update the bounds size and position in (world) absolute coordinates
|
|
329
|
+
* @returns {Bounds} this shape bounding box Rectangle object
|
|
330
|
+
*/
|
|
331
|
+
updateBounds(absolute?: boolean | undefined): Bounds;
|
|
320
332
|
/**
|
|
321
333
|
* update the renderable's bounding rect (private)
|
|
322
334
|
* @ignore
|
|
323
335
|
*/
|
|
324
|
-
updateBoundsPos(newX
|
|
336
|
+
updateBoundsPos(newX?: number, newY?: number): void;
|
|
325
337
|
/**
|
|
326
338
|
* return the renderable absolute position in the game world
|
|
327
339
|
* @returns {Vector2d}
|
|
@@ -397,6 +409,6 @@ export default class Renderable extends Rect {
|
|
|
397
409
|
onDestroyEvent(): void;
|
|
398
410
|
}
|
|
399
411
|
import Rect from "./../geometries/rectangle.js";
|
|
400
|
-
import ObservableVector2d from "./../math/observable_vector2.js";
|
|
401
412
|
import ObservableVector3d from "./../math/observable_vector3.js";
|
|
413
|
+
import ObservableVector2d from "./../math/observable_vector2.js";
|
|
402
414
|
import Color from "./../math/color.js";
|
|
@@ -83,7 +83,7 @@ export default class Sprite extends Renderable {
|
|
|
83
83
|
anim: {};
|
|
84
84
|
resetAnim: Function | (() => Sprite) | undefined;
|
|
85
85
|
current: {
|
|
86
|
-
name:
|
|
86
|
+
name: undefined;
|
|
87
87
|
length: number;
|
|
88
88
|
offset: object;
|
|
89
89
|
width: number;
|
|
@@ -234,13 +234,13 @@ export default class Sprite extends Renderable {
|
|
|
234
234
|
* force the current animation frame index.
|
|
235
235
|
* @name setAnimationFrame
|
|
236
236
|
* @memberof Sprite
|
|
237
|
-
* @param {number} [
|
|
237
|
+
* @param {number} [index=0] - animation frame index
|
|
238
238
|
* @returns {Sprite} Reference to this object for method chaining
|
|
239
239
|
* @example
|
|
240
240
|
* // reset the current animation to the first frame
|
|
241
241
|
* this.setAnimationFrame();
|
|
242
242
|
*/
|
|
243
|
-
setAnimationFrame(
|
|
243
|
+
setAnimationFrame(index?: number | undefined): Sprite;
|
|
244
244
|
/**
|
|
245
245
|
* return the current animation frame index.
|
|
246
246
|
* @name getCurrentAnimationFrame
|
|
@@ -18,7 +18,6 @@ export default class UITextButton extends UIBaseElement {
|
|
|
18
18
|
* @param {string} [settings.backgroundColor] - The css value of a background color
|
|
19
19
|
* @param {string} [settings.hoverColor] - The css value of a color to be used if the pointer hovers over the button
|
|
20
20
|
* @param {string} [settings.borderStrokeColor] - The css value of a color to be used to draw the border
|
|
21
|
-
* @param {boolean} [settings.offScreenCanvas] - Weather to use an offScreen canvas or not
|
|
22
21
|
* @param {string} [settings.fillStyle] - The css value of a tint color to be used to tint the text
|
|
23
22
|
* @param {number} [settings.borderWidth] - Width of the button
|
|
24
23
|
* @param {number} [settings.borderHeight] - Height of the button
|
|
@@ -135,7 +135,7 @@ declare namespace state {
|
|
|
135
135
|
*/
|
|
136
136
|
function transition(effect: string, color: any, duration?: number | undefined): void;
|
|
137
137
|
/**
|
|
138
|
-
* enable/disable transition
|
|
138
|
+
* enable/disable the transition to a particular state (by default enabled for all)
|
|
139
139
|
* @name setTransition
|
|
140
140
|
* @memberof state
|
|
141
141
|
* @public
|
|
@@ -26,14 +26,14 @@ declare class ObjectPool {
|
|
|
26
26
|
* @param {boolean} [recycling=false] - enables object recycling for the specified class
|
|
27
27
|
* @example
|
|
28
28
|
* // implement CherryEntity
|
|
29
|
-
* class
|
|
29
|
+
* class Cherry extends Sprite {
|
|
30
30
|
* onResetEvent() {
|
|
31
31
|
* // reset object mutable properties
|
|
32
32
|
* this.lifeBar = 100;
|
|
33
33
|
* }
|
|
34
34
|
* };
|
|
35
35
|
* // add our users defined entities in the object pool and enable object recycling
|
|
36
|
-
* me.pool.register("
|
|
36
|
+
* me.pool.register("cherrysprite", Cherry, true);
|
|
37
37
|
*/
|
|
38
38
|
register(className: string, classObj: object, recycling?: boolean | undefined): void;
|
|
39
39
|
/**
|
|
@@ -12,12 +12,11 @@ export default class Text extends Renderable {
|
|
|
12
12
|
* @param {number|string} settings.size - size, or size + suffix (px, em, pt)
|
|
13
13
|
* @param {Color|string} [settings.fillStyle="#000000"] - a CSS color value
|
|
14
14
|
* @param {Color|string} [settings.strokeStyle="#000000"] - a CSS color value
|
|
15
|
-
* @param {number} [settings.lineWidth=
|
|
15
|
+
* @param {number} [settings.lineWidth=0] - line width, in pixels, when drawing stroke
|
|
16
16
|
* @param {string} [settings.textAlign="left"] - horizontal text alignment
|
|
17
17
|
* @param {string} [settings.textBaseline="top"] - the text baseline
|
|
18
18
|
* @param {number} [settings.lineHeight=1.0] - line spacing height
|
|
19
19
|
* @param {Vector2d} [settings.anchorPoint={x:0.0, y:0.0}] - anchor point to draw the text at
|
|
20
|
-
* @param {boolean} [settings.offScreenCanvas=false] - whether to draw the font to an individual "cache" texture first
|
|
21
20
|
* @param {number} [settings.wordWrapWidth] - the maximum length in CSS pixel for a single segment of text
|
|
22
21
|
* @param {(string|string[])} [settings.text=""] - a string, or an array of strings
|
|
23
22
|
* @example
|
|
@@ -33,7 +32,6 @@ export default class Text extends Renderable {
|
|
|
33
32
|
textBaseline?: string | undefined;
|
|
34
33
|
lineHeight?: number | undefined;
|
|
35
34
|
anchorPoint?: any;
|
|
36
|
-
offScreenCanvas?: boolean | undefined;
|
|
37
35
|
wordWrapWidth?: number | undefined;
|
|
38
36
|
text?: string | string[] | undefined;
|
|
39
37
|
});
|
|
@@ -45,7 +43,7 @@ export default class Text extends Renderable {
|
|
|
45
43
|
* sets the current line width, in pixels, when drawing stroke
|
|
46
44
|
* @public
|
|
47
45
|
* @type {number}
|
|
48
|
-
* @default
|
|
46
|
+
* @default 0
|
|
49
47
|
*/
|
|
50
48
|
public lineWidth: number | undefined;
|
|
51
49
|
/**
|
|
@@ -72,15 +70,6 @@ export default class Text extends Renderable {
|
|
|
72
70
|
* @default 1.0
|
|
73
71
|
*/
|
|
74
72
|
public lineHeight: number | undefined;
|
|
75
|
-
/**
|
|
76
|
-
* whether to draw the font to a indidividual offscreen canvas texture first <br>
|
|
77
|
-
* Note: this will improve performances when using WebGL, but will impact
|
|
78
|
-
* memory consumption as every text element will have its own canvas texture
|
|
79
|
-
* @public
|
|
80
|
-
* @type {boolean}
|
|
81
|
-
* @default false
|
|
82
|
-
*/
|
|
83
|
-
public offScreenCanvas: boolean | undefined;
|
|
84
73
|
/**
|
|
85
74
|
* the maximum length in CSS pixel for a single segment of text.
|
|
86
75
|
* (use -1 to disable word wrapping)
|
|
@@ -144,13 +133,11 @@ export default class Text extends Renderable {
|
|
|
144
133
|
* @param {string} [text]
|
|
145
134
|
* @param {number} [x]
|
|
146
135
|
* @param {number} [y]
|
|
147
|
-
* @param {boolean} [stroke=false] - draw stroke the the text if true
|
|
148
136
|
*/
|
|
149
|
-
draw(renderer: CanvasRenderer | WebGLRenderer, text?: string | undefined, x?: number | undefined, y?: number | undefined
|
|
137
|
+
draw(renderer: CanvasRenderer | WebGLRenderer, text?: string | undefined, x?: number | undefined, y?: number | undefined): void;
|
|
150
138
|
/**
|
|
151
|
-
* draw a stroke text at the specified coord, as defined
|
|
152
|
-
*
|
|
153
|
-
* Note : using drawStroke is not recommended for performance reasons
|
|
139
|
+
* draw a stroke text at the specified coord, as defined by the `lineWidth` and `fillStroke` properties.
|
|
140
|
+
* @deprecated since 15.0.0
|
|
154
141
|
* @param {CanvasRenderer|WebGLRenderer} renderer - Reference to the destination renderer instance
|
|
155
142
|
* @param {string} text
|
|
156
143
|
* @param {number} x
|
|
@@ -160,7 +147,7 @@ export default class Text extends Renderable {
|
|
|
160
147
|
/**
|
|
161
148
|
* @ignore
|
|
162
149
|
*/
|
|
163
|
-
_drawFont(context: any, text: any, x: any, y: any
|
|
150
|
+
_drawFont(context: any, text: any, x: any, y: any): TextMetrics | undefined;
|
|
164
151
|
/**
|
|
165
152
|
* Destroy function
|
|
166
153
|
* @ignore
|
|
@@ -169,5 +156,4 @@ export default class Text extends Renderable {
|
|
|
169
156
|
}
|
|
170
157
|
import Renderable from "./../renderable/renderable.js";
|
|
171
158
|
import TextMetrics from "./textmetrics.js";
|
|
172
|
-
import WebGLRenderer from "./../video/webgl/webgl_renderer.js";
|
|
173
159
|
import Color from "./../math/color.js";
|
|
@@ -263,11 +263,6 @@ export default class CanvasRenderer extends Renderer {
|
|
|
263
263
|
* @param {number} height
|
|
264
264
|
*/
|
|
265
265
|
fillPoint(x: number, y: number): void;
|
|
266
|
-
/**
|
|
267
|
-
* return a reference to the font 2d Context
|
|
268
|
-
* @ignore
|
|
269
|
-
*/
|
|
270
|
-
getFontContext(): CanvasRenderingContext2D | WebGLRenderingContext;
|
|
271
266
|
/**
|
|
272
267
|
* save the canvas context
|
|
273
268
|
* @name save
|
|
@@ -188,7 +188,7 @@ export default class Renderer {
|
|
|
188
188
|
* @param {Rect|RoundRect|Polygon|Line|Ellipse} [mask] - the shape defining the mask to be applied
|
|
189
189
|
* @param {boolean} [invert=false] - either the given shape should define what is visible (default) or the opposite
|
|
190
190
|
*/
|
|
191
|
-
setMask(mask?:
|
|
191
|
+
setMask(mask?: Polygon | Line | Ellipse | Rect | RoundRect | undefined): void;
|
|
192
192
|
/**
|
|
193
193
|
* disable (remove) the rendering mask set through setMask.
|
|
194
194
|
* @see Renderer#setMask
|
|
@@ -205,10 +205,6 @@ export default class Renderer {
|
|
|
205
205
|
* @see Renderer#setTint
|
|
206
206
|
*/
|
|
207
207
|
clearTint(): void;
|
|
208
|
-
/**
|
|
209
|
-
* @ignore
|
|
210
|
-
*/
|
|
211
|
-
drawFont(): void;
|
|
212
208
|
}
|
|
213
209
|
import Vector2d from "../math/vector2.js";
|
|
214
210
|
import Path2D from "./../geometries/path2d.js";
|