melonjs 20.12.0 → 20.13.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +2 -1
- package/build/camera/camera2d.d.ts +2 -0
- package/build/camera/camera2d.d.ts.map +1 -1
- package/build/camera/effects/fade_effect.d.ts.map +1 -1
- package/build/geometries/ellipse.d.ts +3 -0
- package/build/geometries/ellipse.d.ts.map +1 -1
- package/build/geometries/line.d.ts.map +1 -1
- package/build/geometries/polygon.d.ts +2 -1
- package/build/geometries/polygon.d.ts.map +1 -1
- package/build/index.d.ts +13 -2
- package/build/index.d.ts.map +1 -1
- package/build/index.js +5409 -1500
- package/build/index.js.map +4 -4
- package/build/input/gamepad.d.ts.map +1 -1
- package/build/input/pointerevent.d.ts.map +1 -1
- package/build/level/tiled/TMXLayer.d.ts +48 -14
- package/build/level/tiled/TMXLayer.d.ts.map +1 -1
- package/build/level/tiled/TMXTileMap.d.ts +1 -1
- package/build/level/tiled/TMXTileMap.d.ts.map +1 -1
- package/build/level/tiled/TMXTileset.d.ts.map +1 -1
- package/build/level/tiled/TMXUtils.d.ts.map +1 -1
- package/build/level/tiled/renderer/TMXHexagonalRenderer.d.ts.map +1 -1
- package/build/level/tiled/renderer/TMXIsometricRenderer.d.ts.map +1 -1
- package/build/level/tiled/renderer/TMXObliqueRenderer.d.ts.map +1 -1
- package/build/level/tiled/renderer/TMXOrthogonalRenderer.d.ts.map +1 -1
- package/build/level/tiled/renderer/TMXRenderer.d.ts +1 -1
- package/build/level/tiled/renderer/TMXRenderer.d.ts.map +1 -1
- package/build/level/tiled/renderer/TMXStaggeredRenderer.d.ts.map +1 -1
- package/build/loader/loader.d.ts +55 -11
- package/build/loader/loader.d.ts.map +1 -1
- package/build/math/color.d.ts.map +1 -1
- package/build/math/math.d.ts +6 -1
- package/build/math/math.d.ts.map +1 -1
- package/build/math/observableVector2d.d.ts +6 -6
- package/build/math/observableVector2d.d.ts.map +1 -1
- package/build/math/observableVector3d.d.ts +8 -8
- package/build/math/observableVector3d.d.ts.map +1 -1
- package/build/particles/emitter.d.ts +15 -3
- package/build/particles/emitter.d.ts.map +1 -1
- package/build/particles/particle.d.ts +6 -0
- package/build/particles/particle.d.ts.map +1 -1
- package/build/particles/settings.d.ts +22 -5
- package/build/particles/settings.d.ts.map +1 -1
- package/build/physics/builtin/body.d.ts +14 -4
- package/build/physics/builtin/body.d.ts.map +1 -1
- package/build/physics/builtin/raycast.d.ts.map +1 -1
- package/build/physics/world.d.ts.map +1 -1
- package/build/renderable/container.d.ts +40 -6
- package/build/renderable/container.d.ts.map +1 -1
- package/build/renderable/frameAnimation.d.ts.map +1 -1
- package/build/renderable/renderable.d.ts.map +1 -1
- package/build/renderable/sprite.d.ts +4 -2
- package/build/renderable/sprite.d.ts.map +1 -1
- package/build/renderable/text/bitmaptext.d.ts +12 -3
- package/build/renderable/text/bitmaptext.d.ts.map +1 -1
- package/build/renderable/text/text.d.ts +147 -4
- package/build/renderable/text/text.d.ts.map +1 -1
- package/build/renderable/text/textmetrics.d.ts +10 -2
- package/build/renderable/text/textmetrics.d.ts.map +1 -1
- package/build/renderable/text/textstyle.d.ts.map +1 -1
- package/build/renderable/ui/panelpaint.d.ts +5 -1
- package/build/renderable/ui/panelpaint.d.ts.map +1 -1
- package/build/renderable/ui/progressbar.d.ts +267 -95
- package/build/renderable/ui/progressbar.d.ts.map +1 -1
- package/build/renderable/ui/uibaseelement.d.ts +436 -50
- package/build/renderable/ui/uibaseelement.d.ts.map +1 -1
- package/build/renderable/ui/uicheckbox.d.ts +383 -0
- package/build/renderable/ui/uicheckbox.d.ts.map +1 -0
- package/build/renderable/ui/uifocus.d.ts +6 -0
- package/build/renderable/ui/uifocus.d.ts.map +1 -0
- package/build/renderable/ui/uilabel.d.ts +31 -0
- package/build/renderable/ui/uilabel.d.ts.map +1 -0
- package/build/renderable/ui/uipanel.d.ts +589 -116
- package/build/renderable/ui/uipanel.d.ts.map +1 -1
- package/build/renderable/ui/uiskin.d.ts +25 -0
- package/build/renderable/ui/uiskin.d.ts.map +1 -0
- package/build/renderable/ui/uislider.d.ts +518 -0
- package/build/renderable/ui/uislider.d.ts.map +1 -0
- package/build/renderable/ui/uispriteelement.d.ts +161 -85
- package/build/renderable/ui/uispriteelement.d.ts.map +1 -1
- package/build/renderable/ui/uitextbutton.d.ts +369 -63
- package/build/renderable/ui/uitextbutton.d.ts.map +1 -1
- package/build/state/stage.d.ts.map +1 -1
- package/build/system/pool.d.ts.map +1 -1
- package/build/system/save.d.ts +2 -1
- package/build/system/save.d.ts.map +1 -1
- package/build/tweens/tween.d.ts +5 -2
- package/build/tweens/tween.d.ts.map +1 -1
- package/build/utils/fetchdata.d.ts.map +1 -1
- package/build/video/canvas/canvas_renderer.d.ts +0 -5
- package/build/video/canvas/canvas_renderer.d.ts.map +1 -1
- package/build/video/renderer.d.ts +20 -4
- package/build/video/renderer.d.ts.map +1 -1
- package/build/video/renderstate.d.ts +26 -3
- package/build/video/renderstate.d.ts.map +1 -1
- package/build/video/utils/tessellation.d.ts +11 -0
- package/build/video/utils/tessellation.d.ts.map +1 -1
- package/build/video/webgl/webgl_renderer.d.ts +3 -6
- package/build/video/webgl/webgl_renderer.d.ts.map +1 -1
- package/build/video/webgpu/batchers/primitive_batcher.d.ts.map +1 -1
- package/build/video/webgpu/webgpu_renderer.d.ts +3 -6
- package/build/video/webgpu/webgpu_renderer.d.ts.map +1 -1
- package/package.json +1 -1
- package/skills/melonjs/SKILL.md +3 -3
- package/skills/melonjs-audio/SKILL.md +7 -5
- package/skills/melonjs-camera-and-drawing/SKILL.md +41 -1
- package/skills/melonjs-effects-and-shaders/SKILL.md +1 -0
- package/skills/melonjs-events/SKILL.md +3 -1
- package/skills/melonjs-getting-started/SKILL.md +1 -2
- package/skills/melonjs-input/SKILL.md +38 -2
- package/skills/melonjs-loading-assets/SKILL.md +53 -12
- package/skills/melonjs-math/SKILL.md +14 -3
- package/skills/melonjs-particles-and-trails/SKILL.md +72 -8
- package/skills/melonjs-physics/SKILL.md +53 -4
- package/skills/melonjs-plugins/SKILL.md +7 -2
- package/skills/melonjs-renderables/SKILL.md +7 -0
- package/skills/melonjs-scenes-and-state/SKILL.md +15 -0
- package/skills/melonjs-sprites-and-animation/SKILL.md +14 -0
- package/skills/melonjs-tilemaps/SKILL.md +96 -2
- package/skills/melonjs-ui-and-text/SKILL.md +560 -23
|
@@ -45,6 +45,12 @@ export default class Particle extends Renderable {
|
|
|
45
45
|
private _frameIndex;
|
|
46
46
|
/** @ignore */
|
|
47
47
|
private _animateFrames;
|
|
48
|
+
/**
|
|
49
|
+
* whether the image is the emitter's built-in square, the shared white
|
|
50
|
+
* pixel: drawn whole, stretched to the particle's size
|
|
51
|
+
* @ignore
|
|
52
|
+
*/
|
|
53
|
+
private _builtin;
|
|
48
54
|
/**
|
|
49
55
|
* @param emitter - the particle emitter
|
|
50
56
|
*/
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"particle.d.ts","sourceRoot":"","sources":["../../src/particles/particle.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,QAAQ,EAAgB,MAAM,qBAAqB,CAAC;AAE7D,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,sBAAsB,CAAC;AAGnD,OAAO,UAAU,MAAM,6BAA6B,CAAC;
|
|
1
|
+
{"version":3,"file":"particle.d.ts","sourceRoot":"","sources":["../../src/particles/particle.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,QAAQ,EAAgB,MAAM,qBAAqB,CAAC;AAE7D,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,sBAAsB,CAAC;AAGnD,OAAO,UAAU,MAAM,6BAA6B,CAAC;AAKrD,OAAO,eAAe,MAAM,cAAc,CAAC;AAqD3C;;;GAGG;AACH,MAAM,CAAC,OAAO,OAAO,QAAS,SAAQ,UAAU;;IAC/C;;;;;;;;OAQG;IACH,GAAG,EAAE,QAAQ,CAAC;IACd;;;;;;;OAOG;IACH,IAAI,EAAE,MAAM,CAAC;IACb,+EAA+E;IAC/E,OAAO,EAAE,OAAO,CAAC;IACjB,KAAK,EAAE,iBAAiB,GAAG,gBAAgB,CAAC;IAC5C,IAAI,EAAE,MAAM,CAAC;IACb,SAAS,EAAE,MAAM,CAAC;IAClB,UAAU,EAAE,MAAM,CAAC;IACnB,QAAQ,EAAE,MAAM,CAAC;IACjB,OAAO,EAAE,MAAM,CAAC;IAChB,IAAI,EAAE,MAAM,CAAC;IACb,gBAAgB,EAAE,OAAO,CAAC;IAC1B,cAAc,EAAE,OAAO,CAAC;IAqBxB,KAAK,EAAE,OAAO,CAAC;IACf,cAAc;IACd,OAAO,CAAC,OAAO,CAAuD;IAQtE,cAAc;IACd,OAAO,CAAC,WAAW,CAAS;IAC5B,cAAc;IACd,OAAO,CAAC,cAAc,CAAU;IAEhC;;;;OAIG;IACH,OAAO,CAAC,QAAQ,CAAU;IAE1B;;OAEG;gBACS,OAAO,EAAE,eAAe;IAod3B,YAAY,CAAC,QAAQ,UAAO;CA0HrC;AAED,eAAO,MAAM,YAAY,kEAWxB,CAAC"}
|
|
@@ -6,10 +6,12 @@ import type ParticleEmitter from "./emitter.ts";
|
|
|
6
6
|
* to the constructor or {@link ParticleEmitter#reset}.
|
|
7
7
|
* @category Particles
|
|
8
8
|
* @see {@link ParticleEmitter}
|
|
9
|
+
* @see [Particle Editor](https://melonjs.github.io/melonJS/examples/#/particle-editor) — every setting on a slider, with the code or JSON to copy
|
|
9
10
|
*/
|
|
10
11
|
export interface ParticleEmitterSettings {
|
|
11
12
|
/**
|
|
12
|
-
* Width of the particle spawn area.
|
|
13
|
+
* Width of the particle spawn area. The constructor centres the area on
|
|
14
|
+
* the point it is given; `pos` is then its top left corner.
|
|
13
15
|
* @default 1
|
|
14
16
|
*/
|
|
15
17
|
width: number;
|
|
@@ -19,8 +21,23 @@ export interface ParticleEmitterSettings {
|
|
|
19
21
|
*/
|
|
20
22
|
height: number;
|
|
21
23
|
/**
|
|
22
|
-
*
|
|
23
|
-
*
|
|
24
|
+
* Depth of the particle spawn area, along Z: each particle is born at a
|
|
25
|
+
* random depth within it, centered on the emitter. With
|
|
26
|
+
* {@link ParticleEmitterSettings.width} and
|
|
27
|
+
* {@link ParticleEmitterSettings.height} it makes the area a box, so under
|
|
28
|
+
* a {@link Camera3d} rain falls through a volume instead of a sheet facing
|
|
29
|
+
* the viewer. A 2D camera does not show the depth itself; with an order
|
|
30
|
+
* dependent blend mode, the particles are then sorted by it.
|
|
31
|
+
* <br><br>
|
|
32
|
+
* Not {@link Renderable#depth}, the emitter's own position along Z.
|
|
33
|
+
* @default 0
|
|
34
|
+
*/
|
|
35
|
+
depth: number;
|
|
36
|
+
/**
|
|
37
|
+
* Image used for particles texture. Without one, particles are white
|
|
38
|
+
* squares of {@link textureSize} pixels, colored by `tint`: every such
|
|
39
|
+
* emitter draws the renderer's one shared white pixel, stretched, so none
|
|
40
|
+
* makes a texture of its own.
|
|
24
41
|
* @default undefined
|
|
25
42
|
* @see {@link textureSize}
|
|
26
43
|
*/
|
|
@@ -61,8 +78,8 @@ export interface ParticleEmitterSettings {
|
|
|
61
78
|
*/
|
|
62
79
|
randomFrame?: boolean;
|
|
63
80
|
/**
|
|
64
|
-
*
|
|
65
|
-
*
|
|
81
|
+
* Size, in pixels, of the white square particles are drawn as when the
|
|
82
|
+
* emitter has no {@link image}.
|
|
66
83
|
* @default 8
|
|
67
84
|
* @see {@link image}
|
|
68
85
|
*/
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"settings.d.ts","sourceRoot":"","sources":["../../src/particles/settings.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,SAAS,MAAM,4BAA4B,CAAC;AACxD,OAAO,KAAK,eAAe,MAAM,cAAc,CAAC;AAEhD
|
|
1
|
+
{"version":3,"file":"settings.d.ts","sourceRoot":"","sources":["../../src/particles/settings.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,SAAS,MAAM,4BAA4B,CAAC;AACxD,OAAO,KAAK,eAA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"}
|
|
@@ -274,6 +274,10 @@ export default class Body {
|
|
|
274
274
|
* falling state of the body<br>
|
|
275
275
|
* true if the object is falling<br>
|
|
276
276
|
* false if the object is standing on something<br>
|
|
277
|
+
* Set from the velocity by each step, then by the collisions resolved
|
|
278
|
+
* in it: pushed up out of something below while not rising clears it
|
|
279
|
+
* (and `jumping`), pushed down by something above while rising sets
|
|
280
|
+
* it (and clears `jumping`), however far the body was pushed.
|
|
277
281
|
* @readonly
|
|
278
282
|
* @public
|
|
279
283
|
* @type {boolean}
|
|
@@ -320,8 +324,10 @@ export default class Body {
|
|
|
320
324
|
* `force/mass·dt²`, typically ~100× smaller than builtin).
|
|
321
325
|
* @param {number} x - force along the X axis
|
|
322
326
|
* @param {number} y - force along the Y axis
|
|
323
|
-
* @param {number} [pointX] - world X of the application point
|
|
324
|
-
*
|
|
327
|
+
* @param {number} [pointX] - world X of the application point, as on
|
|
328
|
+
* the matter and planck adapters (inside an offset container, that
|
|
329
|
+
* includes the container's position). When present (along with
|
|
330
|
+
* `pointY`) and different from the body centroid,
|
|
325
331
|
* the resulting lever arm generates a torque
|
|
326
332
|
* `τ = (r.x · F.y) − (r.y · F.x)` that bumps {@link Body#angularVelocity}
|
|
327
333
|
* by `τ / pseudoInertia`. Omit both `pointX` and `pointY` for the
|
|
@@ -334,7 +340,9 @@ export default class Body {
|
|
|
334
340
|
*
|
|
335
341
|
* // off-centre push on a crate: the contact point at the top of the
|
|
336
342
|
* // crate is above its centroid, so the same horizontal force now
|
|
337
|
-
* // both translates AND tips the crate forward.
|
|
343
|
+
* // both translates AND tips the crate forward. (`pos` is the top-left
|
|
344
|
+
* // corner here because the crate's anchorPoint is (0, 0), as for a
|
|
345
|
+
* // Tiled object; with the default (0.5, 0.5) anchor, `pos` is its centre.)
|
|
338
346
|
* const topX = crate.pos.x + crate.width / 2;
|
|
339
347
|
* const topY = crate.pos.y;
|
|
340
348
|
* crate.body.applyForce(1.5, 0, topX, topY);
|
|
@@ -387,7 +395,9 @@ export default class Body {
|
|
|
387
395
|
* Set absolute rotation angle (radians). Updates the body's `angle`
|
|
388
396
|
* field and re-syncs the renderable's `currentTransform` immediately
|
|
389
397
|
* so the visual rotation reflects the new value without waiting for
|
|
390
|
-
* the next integration step.
|
|
398
|
+
* the next integration step. The renderable turns about the centre of
|
|
399
|
+
* the body's shapes, whatever its `anchorPoint`; the shapes themselves
|
|
400
|
+
* are not rotated (see {@link Body#rotate} for that).
|
|
391
401
|
* @param {number} rad - target angle in radians
|
|
392
402
|
* @example
|
|
393
403
|
* // turret aims at the player every frame:
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"body.d.ts","sourceRoot":"","sources":["../../../src/physics/builtin/body.js"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"body.d.ts","sourceRoot":"","sources":["../../../src/physics/builtin/body.js"],"names":[],"mappings":"AAgDA;;;;GAIG;AACH;IACC;;;;OAIG;IACH,sBAJW,UAAU,GAAC,SAAS,GAAC,MAAM,GAAC,MAAM,GAAC,eAAe,WAClD,IAAI,GAAC,IAAI,EAAE,GAAC,OAAO,GAAC,OAAO,EAAE,GAAC,IAAI,GAAC,IAAI,EAAE,GAAC,OAAO,GAAC,OAAO,EAAE,GAAC,KAAK,GAAC,KAAK,EAAE,GAAC,MAAM,GAAC,MAAM,EAAE,GAAC,MAAM,2BAyZ1G;IArZA;;;;;;OAMG;IACH,iBAHU,UAAU,GAAC,SAAS,GAAC,MAAM,GAAC,MAAM,GAAC,eAAe,CAGpC;IAGvB;;;;OAIG;IACH,eAFU,MAAM,CAEc;IAI9B;;;;;;;;;OASG;IACH,QAFU,CAAC,OAAO,GAAC,IAAI,GAAC,OAAO,GAAC,KAAK,CAAC,EAAE,CAExB;IAGjB;;;;;;;;;;;;OAYG;IACH,sBAJU,MAAM,CAI+B;IAE/C;;;;;;;;;OASG;IACH,sBAPU,MAAM,CAOiC;IAGhD;;;;;;;OAOG;IACH,YAHU,QAAQ,CAGW;IAK7B;;;;;;;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AAM,GACJ,MAAM,CAIlB;IAED;;;;;;;;;;;;OAYG;IACH,2BARW,MAAM,QAUhB;IAED;;;;;;;OAOG;IACH,uBALW,MAAM,QAmBhB;IAED;;;;OAIG;IACH,6BAHW,cAAc,QA4LxB;IAED;;;;;;;;;;;;;;;;OAgBG;IACH,sCAVW,MAAM,QAwBhB;IAED;;;;;;;;;;;;OAYG;IACH,kBAXc,CAAC,MAAM,GAAC,QAAQ,CAAC,EAAA,GAClB,OAAO,CA+BnB;IAED;;;;;;OAMG;IACH,cAJW,MAAM,MACN,QAAQ,GACN,IAAI,CAgChB;IAED;;;;;OAKG;IACH,kBAJW,MAAM,KACN,MAAM,MACN,MAAM,QAQhB;IAED;;;;;OAKG;IACH,gBAJW,MAAM,MACN,MAAM,MACN,MAAM,QAQhB;IAED;;;;;;;;;;;OAWG;IACH,oBAFa,OAAO,CA4FnB;IAED;;;;OAIG;IACH,gBAqFC;CACD;4BAzqD0B,gCAAgC;2BADjC,+BAA+B;wBADlC,mCAAmC;wBAGnC,4BAA4B;iCACnB,qCAAqC;uBAvBlC,cAAc;wBATZ,6BAA6B;qBAFnC,0BAA0B;wBADpB,6BAA6B;sBAEjC,2BAA2B;yBAOrB,wBAAwB;qBAL1C,+BAA+B;sBALnB,2BAA2B;gCAsC7B,gBAAgB"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"raycast.d.ts","sourceRoot":"","sources":["../../../src/physics/builtin/raycast.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"raycast.d.ts","sourceRoot":"","sources":["../../../src/physics/builtin/raycast.ts"],"names":[],"mappings":"AAQA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,eAAe,CAAC;AAChD,OAAO,KAAK,KAAK,MAAM,aAAa,CAAC;AA8TrC,wBAAgB,YAAY,CAC3B,KAAK,EAAE,KAAK,EACZ,KAAK,EAAE,MAAM,EACb,KAAK,EAAE,MAAM,EACb,GAAG,EAAE,MAAM,EACX,GAAG,EAAE,MAAM,GACT,UAAU,EAAE,CAgGd"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"world.d.ts","sourceRoot":"","sources":["../../src/physics/world.js"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"world.d.ts","sourceRoot":"","sources":["../../src/physics/world.js"],"names":[],"mappings":"AAwDA;;;GAGG;AACH;IACC;;;;;;OAMG;IACH,gBANW,MAAM,MACN,MAAM,UACN,MAAM,WACN,MAAM,YACN,cAAc,EAuIxB;IArHA;;;OAGG;IACH,KAFU,WAAW,CAED;IAEpB;;;;;;;;;;;;;;;;;;;;;;;;;OAyBG;IACH,QANU,MAAM,CAMO;IAEvB;;;;;OAKG;IACH,YAAa;IAEb;;;;;;;OAOG;IACH,WAHU,OAAO,CAGK;IAEtB;;;;;;;;;;;;;;OAcG;IACH,YAHU,OAAO,CAGK;IAEtB;;;;;;OAMG;IACH,SAFU,cAAc,CAEsB;IAG9C;;;;;;;;;;;;;;;OAeG;IACH,YAFU,OAAO,4BAA4B,EAAE,UAAU,CAEjB;IAcxC,0BAMC;IA4CF;;;;;;;;;;;OAWG;IACH,cAFa,GAAG,CAAC,IAAI,CAAC,CAOrB;IASD,eALa,QAAQ,EAOpB;IATD;;;OAGG;IACH,eAFa,QAAQ,CAIpB;IAKD;;;;OAIG;IACH,gBAFa,QAAQ,GAAG,SAAS,CAIhC;IA8CD;;;;;;;OAOG;IACH,cAHW,IAAI,GACF,KAAK,CASjB;IAED;;;;;OAKG;IACH,iBAHW,IAAI,GACF,KAAK,CASjB;IAED;;;;;OAKG;IACH,yBAIC;IAuBD;;;OAGG;IACH,SAFW,MAAM,QAWhB;CACD;sBApZqB,4BAA4B;6BAatB,iCAAiC;oCAI1B,cAAc;sBAH5B,mBAAmB;8BAEX,qBAAqB;0BADzB,uBAAuB"}
|
|
@@ -89,9 +89,13 @@ export default class Container extends Renderable {
|
|
|
89
89
|
*/
|
|
90
90
|
onChildChange: () => void;
|
|
91
91
|
/**
|
|
92
|
-
* Re-measure this container's bounds from its children
|
|
93
|
-
*
|
|
94
|
-
*
|
|
92
|
+
* Re-measure this container's bounds from its children, so they follow
|
|
93
|
+
* the children as they move: on every update (after the children have
|
|
94
|
+
* been updated), whenever a child is added or removed, and, while the
|
|
95
|
+
* container is culled, before each visibility check, so a group whose
|
|
96
|
+
* members come back into view is drawn again. Expensive — every
|
|
97
|
+
* update walks the whole child list — and off by default, because a
|
|
98
|
+
* parent almost never needs it.
|
|
95
99
|
*
|
|
96
100
|
* Enable it for a group whose extent genuinely IS its members' union
|
|
97
101
|
* and moves as they do: a flock of birds, a squad of enemies. A
|
|
@@ -154,6 +158,8 @@ export default class Container extends Renderable {
|
|
|
154
158
|
get sortOn(): "x" | "y" | "z" | "depth";
|
|
155
159
|
/**
|
|
156
160
|
* reset the container, removing all children, and resetting transforms.
|
|
161
|
+
* Persistent children ({@link Renderable#isPersistent}) are kept, and a
|
|
162
|
+
* sort still pending for them still happens.
|
|
157
163
|
*/
|
|
158
164
|
reset(): void;
|
|
159
165
|
/**
|
|
@@ -165,7 +171,15 @@ export default class Container extends Renderable {
|
|
|
165
171
|
* original container. Then when the World container reset() method is called the renderable
|
|
166
172
|
* will not be in any container. <br>
|
|
167
173
|
* if the given child implements an onActivateEvent method, that method will be called
|
|
168
|
-
* once the child is added to this container
|
|
174
|
+
* once the child is added to this container, when this container is in the
|
|
175
|
+
* world (or as soon as it is added to it). Each `onActivateEvent` is matched
|
|
176
|
+
* by exactly one `onDeactivateEvent` when the child leaves the world again. <br>
|
|
177
|
+
* Once this container is in the world, the physics body of the child
|
|
178
|
+
* (its `bodyDef`, or a pre-built `Body`) is registered with the world's
|
|
179
|
+
* physics adapter, and so is the body of every renderable below it if it is
|
|
180
|
+
* a container, at any depth. They are taken out again when the child leaves
|
|
181
|
+
* the world, so moving a whole group from one container to another keeps
|
|
182
|
+
* its bodies simulated, once each.
|
|
169
183
|
* @param {Renderable|Entity|Sprite|Collectable|Trigger|Draggable|DropTarget|NineSliceSprite|ImageLayer|ColorLayer|Light2d|UIBaseElement|UISpriteElement|UITextButton|Text|BitmapText} child - Child to be added
|
|
170
184
|
* @param {number} [z] - forces the z index of the child to the specified
|
|
171
185
|
* value. This depth is scoped to THIS container: it orders the child among
|
|
@@ -253,7 +267,7 @@ export default class Container extends Renderable {
|
|
|
253
267
|
* let allCoins = container.getChildByProp("name", /coin/i);
|
|
254
268
|
*
|
|
255
269
|
* // searching for numbers or other data types :
|
|
256
|
-
* let
|
|
270
|
+
* let depth10 = container.getChildByProp("depth", 10);
|
|
257
271
|
* let inViewport = container.getChildByProp("inViewport", true);
|
|
258
272
|
*/
|
|
259
273
|
getChildByProp(prop: string, value: string | RegExp | number | boolean, objList?: any[]): Renderable[];
|
|
@@ -297,7 +311,8 @@ export default class Container extends Renderable {
|
|
|
297
311
|
getRootAncestor(): Container;
|
|
298
312
|
/**
|
|
299
313
|
* Invokes the removeChildNow in a defer, to ensure the child is removed safely after the update & draw stack has completed. <br>
|
|
300
|
-
* if the given child implements an onDeactivateEvent() method, that method will be called once the child is removed from this container
|
|
314
|
+
* if the given child implements an onDeactivateEvent() method, that method will be called once the child is removed from this container
|
|
315
|
+
* (exactly once, for a child that had its `onActivateEvent`: the children of a removed container are told once, however deep they sit).
|
|
301
316
|
* @param {Renderable|Sprite|Collectable|Trigger|Draggable|DropTarget|NineSliceSprite|ImageLayer|ColorLayer|Light2d|UIBaseElement|UISpriteElement|UITextButton|Text|BitmapText} child - Child to be removed
|
|
302
317
|
* @param {boolean} [keepalive=false] - true to prevent calling child.destroy()
|
|
303
318
|
*/
|
|
@@ -305,6 +320,12 @@ export default class Container extends Renderable {
|
|
|
305
320
|
/**
|
|
306
321
|
* Removes (and optionally destroys) a child from the container.<br>
|
|
307
322
|
* (removal is immediate and unconditional)<br>
|
|
323
|
+
* A child that had its `onActivateEvent` gets one `onDeactivateEvent`, and
|
|
324
|
+
* so does each child below it if it is a container — once, even though the
|
|
325
|
+
* container's own `onDeactivateEvent` and its `destroy()` both reach them.<br>
|
|
326
|
+
* The physics bodies of the child and of everything below it are taken out
|
|
327
|
+
* of the simulation, at any depth and with or without `keepalive`; a child
|
|
328
|
+
* kept alive and added back gets them registered again.<br>
|
|
308
329
|
* Never use keepalive=true with objects from {@link pool}. Doing so will create a memory leak.
|
|
309
330
|
* @param {Renderable|Entity|Sprite|Collectable|Trigger|Draggable|DropTarget|NineSliceSprite|ImageLayer|ColorLayer|Light2d|UIBaseElement|UISpriteElement|UITextButton|Text|BitmapText} child - Child to be removed
|
|
310
331
|
* @param {boolean} [keepalive=False] - True to prevent calling child.destroy()
|
|
@@ -364,6 +385,19 @@ export default class Container extends Renderable {
|
|
|
364
385
|
* @param {boolean} [recursive=false] - recursively sort sub-containers
|
|
365
386
|
*/
|
|
366
387
|
sortNow(recursive?: boolean): void;
|
|
388
|
+
/**
|
|
389
|
+
* Whether this container shows its children at a point.
|
|
390
|
+
*
|
|
391
|
+
* Always true unless {@link Container#clipping} is on, in which case only
|
|
392
|
+
* its own rectangle is shown. The pointer asks every container above a
|
|
393
|
+
* region before letting it answer, so a child cropped out of view cannot
|
|
394
|
+
* be clicked where it is not drawn.
|
|
395
|
+
* @param {number} x - the point, in the same coordinates as the bounds of
|
|
396
|
+
* this container (screen pixels for a floating one)
|
|
397
|
+
* @param {number} y - the point
|
|
398
|
+
* @returns {boolean} false where the children are clipped away
|
|
399
|
+
*/
|
|
400
|
+
clipContains(x: number, y: number): boolean;
|
|
367
401
|
/**
|
|
368
402
|
* draw this renderable (automatically called by melonJS)
|
|
369
403
|
* @param {Renderer} renderer - a renderer instance
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"container.d.ts","sourceRoot":"","sources":["../../src/renderable/container.js"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"container.d.ts","sourceRoot":"","sources":["../../src/renderable/container.js"],"names":[],"mappings":"AAuXA;;;;;;;;;;;;;;;;;;;;;;;;GAwBG;AAEH;;;;;;;;;GASG;A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BACpB,aAAa;6BACR,kBAAkB;yBACtB,cAAc;+BACR,gBAAgB;gCACf,gBAAgB;iCACf,sBAAsB;4BAC3B,iBAAiB;4BACjB,iBAAiB;yBACpB,wBAAwB;+BAClB,uBAAuB;iCACrB,yBAAyB;8BAC5B,sBAAsB;sBAC9B,gBAAgB;4BACV,sBAAsB;0BAMxB,sBAAsB;0BADtB,uBAAuB"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"frameAnimation.d.ts","sourceRoot":"","sources":["../../src/renderable/frameAnimation.js"],"names":[],"mappings":"AAGA;;;;GAIG;AAEH;;;;;;;;;;;;;;;;;;;;;;;GAuBG;AACH;IACC;;;;;;;;;;;OAWG;IACH,kBAXW,MAAM,cAMN,CAAC,MAAM,EAAE,MAAM,KAAK,IAAI,EA0FlC;IApFA;;;;;OAKG;IACH,MAJU,MAAM,CAIA;IAEhB;;;;;OAKG;IACH,aAJU,CAAC,MAAM,EAAE,MAAM,KAAK,IAAI,CAIL;IAE7B,qDAAqD;IACrD,MAD2C,MAAM,CACnC;IAEd;;;;OAIG;IACH,oGAA0B;IAE1B;;;;OAIG;IACH,kDAAwB;IAExB,wCAAwC;IACxC,SAD8B,MAAM,CAiBnC;IAED,kEAAkE;IAClE,IADwD,MAAM,CACnD;IAEX,qEAAqE;IACrE,gBAD2D,MAAM,CACxC;IAEzB,6DAA6D;IAC7D,gBADkD,OAAO,CAC9B;IAE3B;;;;OAIG;IACH,mBAAmB;IAEnB;;;;OAIG;IACH,mBAAsB;IAEtB;;;;;;;OAOG;IACH,0BAA6B;IAG9B;;;;;;OAMG;IACH,mBALW,MAAM,SACN,MAAM,EAAE,GAAC,MAAM,EAAE,GAAC,MAAM,EAAE,mBAC1B,MAAM,GACJ,MAAM,
|
|
1
|
+
{"version":3,"file":"frameAnimation.d.ts","sourceRoot":"","sources":["../../src/renderable/frameAnimation.js"],"names":[],"mappings":"AAGA;;;;GAIG;AAEH;;;;;;;;;;;;;;;;;;;;;;;GA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OAGG;IACH,eAKC;IAED;;;;;;;;OAQG;IACH,WAHW,MAAM,GACJ,OAAO,CA6FnB;IAED;;;;;;;OAOG;IACH,eAFa,OAAO,CAOnB;IAED;;;OAGG;IACH,gBAOC;CACD"}
|
|
@@ -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":"AA8pDA;;;;;;;;;;;;;;;;;GAiBG;AACH,iDAJW,UAAU,QAiCpB;AAvpDD;;;GAGG;AACH;IAkBG,iBAAmB;IAGpB;;;;;;;;;;;;;;;;;;;;;;;;;OAyBG;IACH,aAHU,eAAe,CAMvB;IAGD;;;;;;;OAOG;IACH,kBAFU,QAAQ,CAEoB;IAIvC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;OAwCG;IACH,MAlCU,WAAW,CAkCA;IAErB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;OA+CG;IACH,SAxBU,MAAM,GAAC,SAAS,CAwBF;IAExB;;;;;OAKG;IACH,MAFU,MAAM,CAEK;IAErB;;;;;;;;;;OAUG;IACH,6BAAmC;IAEnC;;;;;OAKG;IACH,aAJU,MAAM,CAII;IAEpB;;;;OAIG;IACH,cAHU,OAAO,CAGQ;IAEzB;;;;;;;;OAQG;IACH,kBAHU,OAAO,CAGY;IAE7B;;;;OAIG;IACH,cAHU,OAAO,CAGQ;IAEzB;;;;;OAKG;IACH,UAHU,OAAO,CAGI;IAErB;;;;;;;;OAQG;IACH,qBAHU,OAAO,CAGe;IAEhC;;;;;;;;;;;;;;;;;;;;;;;;;;;OA2BG;IACH,iBATU,MAAM,CASQ;IAExB;;;;;;;;;;;;;;;;OAgBG;IACH,eAdU,OAAO,CAcQ;IAEzB;;;;;;;;;;;;;;;;;;;;OAoBG;IACH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B,sBAAsB;0BAStB,sBAAsB;0BARtB,uBAAuB"}
|
|
@@ -244,13 +244,15 @@ export default class Sprite extends Renderable {
|
|
|
244
244
|
/**
|
|
245
245
|
* make the object flicker
|
|
246
246
|
* @param {number} duration - expressed in milliseconds
|
|
247
|
-
* @param {Function} [callback] - Function to call when flickering ends
|
|
247
|
+
* @param {Function} [callback] - Function to call when flickering ends,
|
|
248
|
+
* with `this` set to the sprite. The flicker has already stopped when it
|
|
249
|
+
* runs, so the callback can start another one.
|
|
248
250
|
* @returns {Sprite} Reference to this object for method chaining
|
|
249
251
|
* @example
|
|
250
252
|
* // make the object flicker for 1 second
|
|
251
253
|
* // and then remove it
|
|
252
254
|
* this.flicker(1000, function () {
|
|
253
|
-
*
|
|
255
|
+
* this.ancestor.removeChild(this);
|
|
254
256
|
* });
|
|
255
257
|
*/
|
|
256
258
|
flicker(duration: number, callback?: Function): Sprite;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"sprite.d.ts","sourceRoot":"","sources":["../../src/renderable/sprite.js"],"names":[],"mappings":"AAsBA;;;;;;GAMG;AAEH;;;GAGG;AACH;IACC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;OA4CG;IACH,eA5CW,MAAM,KACN,MAAM,YAEd;QAAoH,KAAK,EAAjH,gBAAgB,GAAC,iBAAiB,GAAC,gBAAgB,GAAC,SAAS,GAAC,YAAY,GAAC,eAAe,GAAC,MAAM;QAC/E,IAAI;QACJ,MAAM;QACN,UAAU;QACV,WAAW;QACL,IAAI;QACV,KAAK;QACL,KAAK;QACwB,WAAW;eAAvC,MAAM;eAAG,MAAM;;QACyD,SAAS;QAClF,OAAO;QACP,SAAS;KACnC,EAyaF;IAzXA;;;OAGG;IACH,2BAEE;IAEF;;;;OAIG;IACH,QAHU,QAAQ,CAGkB;IAEpC;;;;OAIG;IACH,SAHU,OAAO,CAGG;IAEpB;;;;OAIG;IAGH;;;OAGG;IACH,QAFU,YAAY,C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;;;;OAIG;IACH,gBA0BC;CACD;uBA7oCsB,iBAAiB;2BADb,qBAAqB;8BAarB,qBAAqB;kCADjB,6BAA6B;qCAG1B,2DAA2D;0BADpE,wBAAwB;sBAhB3B,iCAAiC;sBAHjC,kBAAkB"}
|
|
@@ -77,6 +77,8 @@ export default class BitmapText extends Renderable {
|
|
|
77
77
|
/**
|
|
78
78
|
* Set the text baseline (e.g. the Y-coordinate for the draw operation), <br>
|
|
79
79
|
* possible values are "top", "hanging", "middle", "alphabetic", "ideographic", "bottom"<br>
|
|
80
|
+
* A multi-line text is placed as one block: its top, middle or bottom is at
|
|
81
|
+
* `pos.y` ("alphabetic" and "ideographic" place it like "bottom").
|
|
80
82
|
* @public
|
|
81
83
|
* @type {string}
|
|
82
84
|
* @default "top"
|
|
@@ -93,6 +95,8 @@ export default class BitmapText extends Renderable {
|
|
|
93
95
|
/**
|
|
94
96
|
* the maximum length in CSS pixel for a single segment of text.
|
|
95
97
|
* (use -1 to disable word wrapping)
|
|
98
|
+
* Each `\n`-separated line is wrapped on its own, so explicit line breaks
|
|
99
|
+
* are kept; a word wider than this gets a line of its own.
|
|
96
100
|
* @public
|
|
97
101
|
* @type {number}
|
|
98
102
|
* @default -1
|
|
@@ -246,15 +250,20 @@ export default class BitmapText extends Renderable {
|
|
|
246
250
|
*/
|
|
247
251
|
resize(scale: number): this;
|
|
248
252
|
/**
|
|
249
|
-
* measure the given text size in pixels
|
|
250
|
-
*
|
|
253
|
+
* measure the given text size in pixels.
|
|
254
|
+
*
|
|
255
|
+
* With no argument it measures the label's own text and returns the
|
|
256
|
+
* label's own metrics. Given another text, it measures it in this label's
|
|
257
|
+
* font and scale and returns a new TextMetrics for it, leaving the label's
|
|
258
|
+
* own metrics, bounds and drawing as they were.
|
|
259
|
+
* @param {string|string[]} [text] - the text to be measured, the label's own by default
|
|
251
260
|
* @returns {TextMetrics} a TextMetrics object with two properties: `width` and `height`, defining the output dimensions
|
|
252
261
|
* @example
|
|
253
262
|
* // size a panel around a label, at the label's CURRENT scale
|
|
254
263
|
* const size = label.measureText();
|
|
255
264
|
* panel.resize(size.width + 16, size.height + 16);
|
|
256
265
|
*/
|
|
257
|
-
measureText(text?: string): TextMetrics;
|
|
266
|
+
measureText(text?: string | string[]): TextMetrics;
|
|
258
267
|
/**
|
|
259
268
|
* draw the bitmap font
|
|
260
269
|
* @param {Renderer} renderer - Reference to the destination renderer instance
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"bitmaptext.d.ts","sourceRoot":"","sources":["../../../src/renderable/text/bitmaptext.js"],"names":[],"mappings":"AAQA;;;;;;;;GAQG;AACH;;;;;;;;;GASG;AACH;IACC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;OA+BG;IACH,eA/BW,MAAM,KACN,MAAM,YAEd;QAA+B,IAAI,EAA3B,MAAM,8DAAM;QACM,QAAQ;QACR,IAAI;QACE,SAAS;QACf,SAAS;QACT,YAAY;QACZ,UAAU;QACmB,WAAW;eAAvC,MAAM;eAAG,MAAM;;QAChB,aAAa;QACH,WAAW;QACV,IAAI;KACzC,
|
|
1
|
+
{"version":3,"file":"bitmaptext.d.ts","sourceRoot":"","sources":["../../../src/renderable/text/bitmaptext.js"],"names":[],"mappings":"AAQA;;;;;;;;GAQG;AACH;;;;;;;;;GASG;AACH;IACC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;OA+BG;IACH,eA/BW,MAAM,KACN,MAAM,YAEd;QAA+B,IAAI,EAA3B,MAAM,8DAAM;QACM,QAAQ;QACR,IAAI;QACE,SAAS;QACf,SAAS;QACT,YAAY;QACZ,UAAU;QACmB,WAAW;eAAvC,MAAM;eAAG,MAAM;;QAChB,aAAa;QACH,WAAW;QACV,IAAI;KACzC,EAqJF;IAhIA;;;;;;OAMG;IACH,kBAHU,MAAM,CAG6B;IAE7C;;;;;;;;OAQG;IACH,qBAHU,MAAM,CAGkC;IAElD;;;;;;OAMG;IACH,mBAHU,MAAM,CAG4B;IAE5C;;;;;;;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|
2
2
|
* a Text object: draws a string using a system or web font.
|
|
3
3
|
*
|
|
4
4
|
* The text is rasterised to a cached texture, so it draws as fast as a sprite
|
|
5
|
-
* while staying fully styleable — `fillStyle`, `strokeStyle` + `lineWidth
|
|
5
|
+
* while staying fully styleable — `fillStyle`, `strokeStyle` + `lineWidth`
|
|
6
|
+
* (with the outline behind or over the glyphs by `paintOrder`, and its corners
|
|
7
|
+
* set by `lineJoin` / `miterLimit`), and
|
|
6
8
|
* per-object opacity — with multi-line text (embedded `\n`), optional
|
|
7
9
|
* `wordWrapWidth` word-wrapping, and chainable {@link Text#bold} /
|
|
8
10
|
* {@link Text#italic}. `font` accepts any CSS family, including the generic
|
|
@@ -24,6 +26,9 @@ export default class Text extends Renderable {
|
|
|
24
26
|
* @param {boolean} [settings.gradientPerLine=true] - restart a gradient fill on every line; `false` spans one ramp across the whole block, as a plain canvas does
|
|
25
27
|
* @param {Color|string} [settings.strokeStyle="#000000"] - a CSS color value used for the glyph outline (drawn when `lineWidth` > 0)
|
|
26
28
|
* @param {number} [settings.lineWidth=0] - outline width in pixels (0 = no stroke)
|
|
29
|
+
* @param {"round"|"bevel"|"miter"} [settings.lineJoin="round"] - the shape of the outline's corners: "round", "bevel" or "miter" (pointed, as a plain canvas draws them)
|
|
30
|
+
* @param {number} [settings.miterLimit=10] - with a "miter" join, how far a corner may point, in half line widths, before it is cut flat
|
|
31
|
+
* @param {"stroke"|"fill"} [settings.paintOrder="stroke"] - what is painted first: "stroke" puts the outline behind the glyphs, so it shows only around them; "fill" puts it over them, where its inner half covers the glyph
|
|
27
32
|
* @param {string} [settings.textAlign="left"] - horizontal text alignment ("left", "center", "right")
|
|
28
33
|
* @param {string} [settings.textBaseline="top"] - the text baseline ("top", "hanging", "middle", "alphabetic", "ideographic", "bottom")
|
|
29
34
|
* @param {number} [settings.lineHeight=1.0] - line spacing height
|
|
@@ -66,6 +71,52 @@ export default class Text extends Renderable {
|
|
|
66
71
|
* // gradientPerLine: false, // ...or span ONE ramp across both lines
|
|
67
72
|
* }));
|
|
68
73
|
* @example
|
|
74
|
+
* // outlined text and its corners: the outline is centred on the glyph
|
|
75
|
+
* // edge and drawn behind it (see `paintOrder`), and its corners are set
|
|
76
|
+
* // by `lineJoin`
|
|
77
|
+
* const outline = {
|
|
78
|
+
* font: "sans-serif",
|
|
79
|
+
* size: 48,
|
|
80
|
+
* fillStyle: "#ffffff",
|
|
81
|
+
* strokeStyle: "#1d3557",
|
|
82
|
+
* lineWidth: 6,
|
|
83
|
+
* };
|
|
84
|
+
*
|
|
85
|
+
* // "round" (the default): the outline is the same width all around
|
|
86
|
+
* app.world.addChild(new Text(10, 10, { ...outline, text: "ROUND" }));
|
|
87
|
+
*
|
|
88
|
+
* // "bevel": corners cut flat
|
|
89
|
+
* app.world.addChild(new Text(10, 70, { ...outline, lineJoin: "bevel", text: "BEVEL" }));
|
|
90
|
+
*
|
|
91
|
+
* // "miter": pointed corners, as a plain canvas strokes text. At the
|
|
92
|
+
* // canvas's default limit of 10 a sharp glyph ("A", "V", "M") grows a
|
|
93
|
+
* // long spike...
|
|
94
|
+
* app.world.addChild(new Text(10, 130, { ...outline, lineJoin: "miter", text: "MITER" }));
|
|
95
|
+
*
|
|
96
|
+
* // ...which `miterLimit` caps: a corner that would point further than
|
|
97
|
+
* // this many half line widths is cut flat instead
|
|
98
|
+
* app.world.addChild(new Text(10, 190, { ...outline, lineJoin: "miter", miterLimit: 3, text: "MITER 3" }));
|
|
99
|
+
*
|
|
100
|
+
* // whichever is set, the whole outline is drawn: the label's texture
|
|
101
|
+
* // grows to hold it, while its position and bounds stay the same
|
|
102
|
+
* @example
|
|
103
|
+
* // the outline behind the glyphs, or over them, with `paintOrder`
|
|
104
|
+
* const label = {
|
|
105
|
+
* font: "sans-serif",
|
|
106
|
+
* size: 48,
|
|
107
|
+
* fillStyle: "#ffd23f",
|
|
108
|
+
* strokeStyle: "#1b1b1b",
|
|
109
|
+
* lineWidth: 6,
|
|
110
|
+
* };
|
|
111
|
+
*
|
|
112
|
+
* // "stroke" (the default): the outline is painted first, behind the
|
|
113
|
+
* // glyphs, so they stay whole and it shows only around them
|
|
114
|
+
* app.world.addChild(new Text(10, 10, { ...label, text: "BEHIND" }));
|
|
115
|
+
*
|
|
116
|
+
* // "fill": the glyphs first and the outline over them, centred on their
|
|
117
|
+
* // edge, so its inner half covers them: a thick one hides them
|
|
118
|
+
* app.world.addChild(new Text(10, 70, { ...label, paintOrder: "fill", text: "OVER" }));
|
|
119
|
+
* @example
|
|
69
120
|
* // a web font (loaded via the fontface loader) is used by its family name
|
|
70
121
|
* loader.preload(
|
|
71
122
|
* [{ name: "kenpixel", type: "fontface", src: "data/font/kenvector.woff2" }],
|
|
@@ -83,6 +134,9 @@ export default class Text extends Renderable {
|
|
|
83
134
|
gradientPerLine?: boolean | undefined;
|
|
84
135
|
strokeStyle?: string | Color | undefined;
|
|
85
136
|
lineWidth?: number | undefined;
|
|
137
|
+
lineJoin?: "round" | "bevel" | "miter" | undefined;
|
|
138
|
+
miterLimit?: number | undefined;
|
|
139
|
+
paintOrder?: "fill" | "stroke" | undefined;
|
|
86
140
|
textAlign?: string | undefined;
|
|
87
141
|
textBaseline?: string | undefined;
|
|
88
142
|
lineHeight?: number | undefined;
|
|
@@ -113,6 +167,86 @@ export default class Text extends Renderable {
|
|
|
113
167
|
* @default 0
|
|
114
168
|
*/
|
|
115
169
|
lineWidth: number;
|
|
170
|
+
/**
|
|
171
|
+
* The shape of the outline's corners, where the stroke turns on a
|
|
172
|
+
* glyph: "round", "bevel" (cut flat) or "miter" (pointed). The
|
|
173
|
+
* canvas's own default is "miter", which on a thick outline grows
|
|
174
|
+
* long spikes from sharp glyphs such as "A", "V" or "M"; "round"
|
|
175
|
+
* keeps the outline the same width all around, as most game text
|
|
176
|
+
* outlines are.
|
|
177
|
+
*
|
|
178
|
+
* The text is baked with room for whichever is set, so no corner is
|
|
179
|
+
* cut: "miter" takes more, up to {@link Text#miterLimit} half line
|
|
180
|
+
* widths around the text.
|
|
181
|
+
*
|
|
182
|
+
* Like the other style properties, a change shows from the next
|
|
183
|
+
* {@link Text#setText}.
|
|
184
|
+
* @type {"round"|"bevel"|"miter"}
|
|
185
|
+
* @default "round"
|
|
186
|
+
* @example
|
|
187
|
+
* // sharp, pointed corners, as a plain canvas strokes them
|
|
188
|
+
* const title = new Text(0, 0, {
|
|
189
|
+
* font: "sans-serif",
|
|
190
|
+
* size: 48,
|
|
191
|
+
* fillStyle: "#ffffff",
|
|
192
|
+
* strokeStyle: "#000000",
|
|
193
|
+
* lineWidth: 6,
|
|
194
|
+
* lineJoin: "miter",
|
|
195
|
+
* miterLimit: 3, // and no spike past 3 half widths
|
|
196
|
+
* text: "VICTORY",
|
|
197
|
+
* });
|
|
198
|
+
*/
|
|
199
|
+
lineJoin: "round" | "bevel" | "miter";
|
|
200
|
+
/**
|
|
201
|
+
* With a "miter" {@link Text#lineJoin}: how far a corner of the
|
|
202
|
+
* outline may point, in half line widths, before it is cut flat
|
|
203
|
+
* instead. The canvas's default, 10, lets sharp glyphs grow long
|
|
204
|
+
* spikes; 2 to 4 keeps most corners pointed and the spikes short.
|
|
205
|
+
* Has no effect with "round" or "bevel" joins. A value the canvas
|
|
206
|
+
* would refuse (zero, negative, infinite or NaN) draws with 10.
|
|
207
|
+
*
|
|
208
|
+
* Like the other style properties, a change shows from the next
|
|
209
|
+
* {@link Text#setText}.
|
|
210
|
+
* @type {number}
|
|
211
|
+
* @default 10
|
|
212
|
+
* @example
|
|
213
|
+
* // pointed corners with short spikes
|
|
214
|
+
* label.lineJoin = "miter";
|
|
215
|
+
* label.miterLimit = 2;
|
|
216
|
+
* label.setText("VICTORY"); // re-bakes with the new corners
|
|
217
|
+
*/
|
|
218
|
+
miterLimit: number;
|
|
219
|
+
/**
|
|
220
|
+
* What is painted first, the outline ("stroke") or the glyphs
|
|
221
|
+
* ("fill"), as the CSS and SVG `paint-order` property says it.
|
|
222
|
+
*
|
|
223
|
+
* The outline is centred on the glyph's edge, so half of it lies
|
|
224
|
+
* inside the glyph. With "stroke", the default, the outline is
|
|
225
|
+
* painted first and the glyphs over it: they stay whole, and the
|
|
226
|
+
* outline shows only around them, at half its `lineWidth`. With
|
|
227
|
+
* "fill", the glyphs are painted first and the outline over them,
|
|
228
|
+
* as a plain canvas does with `fillText` then `strokeText`: its inner
|
|
229
|
+
* half covers the glyph, so a thick outline, or a thin face, hides
|
|
230
|
+
* the letters.
|
|
231
|
+
*
|
|
232
|
+
* Either way the outline reaches as far out, and the label's size and
|
|
233
|
+
* bounds are the same. Like the other style properties, a change
|
|
234
|
+
* shows from the next {@link Text#setText}.
|
|
235
|
+
* @type {"stroke"|"fill"}
|
|
236
|
+
* @default "stroke"
|
|
237
|
+
* @example
|
|
238
|
+
* // the outline over the glyphs, as melonJS drew it before 20.13
|
|
239
|
+
* const label = new Text(0, 0, {
|
|
240
|
+
* font: "sans-serif",
|
|
241
|
+
* size: 32,
|
|
242
|
+
* fillStyle: "#ffffff",
|
|
243
|
+
* strokeStyle: "#000000",
|
|
244
|
+
* lineWidth: 2,
|
|
245
|
+
* paintOrder: "fill",
|
|
246
|
+
* text: "SCORE",
|
|
247
|
+
* });
|
|
248
|
+
*/
|
|
249
|
+
paintOrder: "stroke" | "fill";
|
|
116
250
|
/**
|
|
117
251
|
* Set the default text alignment (or justification),<br>
|
|
118
252
|
* possible values are "left", "right", and "center".<br>
|
|
@@ -123,6 +257,8 @@ export default class Text extends Renderable {
|
|
|
123
257
|
/**
|
|
124
258
|
* Set the text baseline (e.g. the Y-coordinate for the draw operation), <br>
|
|
125
259
|
* possible values are "top", "hanging", "middle", "alphabetic", "ideographic", "bottom"<br>
|
|
260
|
+
* A multi-line text is placed as one block: its top, middle or bottom is at
|
|
261
|
+
* `pos.y` ("alphabetic" and "ideographic" place it like "bottom").
|
|
126
262
|
* @type {string}
|
|
127
263
|
* @default "top"
|
|
128
264
|
*/
|
|
@@ -137,6 +273,8 @@ export default class Text extends Renderable {
|
|
|
137
273
|
/**
|
|
138
274
|
* the maximum length in CSS pixel for a single segment of text.
|
|
139
275
|
* (use -1 to disable word wrapping)
|
|
276
|
+
* Each `\n`-separated line is wrapped on its own, so explicit line breaks
|
|
277
|
+
* are kept; a word wider than this gets a line of its own.
|
|
140
278
|
* @type {number}
|
|
141
279
|
* @default -1
|
|
142
280
|
*/
|
|
@@ -242,8 +380,13 @@ export default class Text extends Renderable {
|
|
|
242
380
|
*/
|
|
243
381
|
public get visibleRatio(): number;
|
|
244
382
|
/**
|
|
245
|
-
* measure the given text size in pixels
|
|
246
|
-
*
|
|
383
|
+
* measure the given text size in pixels.
|
|
384
|
+
*
|
|
385
|
+
* With no argument it measures the label's own text and returns the
|
|
386
|
+
* label's own metrics. Given another text, it measures it in this label's
|
|
387
|
+
* style and returns a new TextMetrics for it, leaving the label's own
|
|
388
|
+
* metrics, bounds and drawing as they were.
|
|
389
|
+
* @param {string|string[]} [text] - the text to be measured, the label's own by default
|
|
247
390
|
* @returns {TextMetrics} a TextMetrics object defining the dimensions of the given piece of text
|
|
248
391
|
* @example
|
|
249
392
|
* // size a panel around a label
|
|
@@ -254,7 +397,7 @@ export default class Text extends Renderable {
|
|
|
254
397
|
* // room for the widest state a counter will reach
|
|
255
398
|
* const widest = label.measureText("00:00").width;
|
|
256
399
|
*/
|
|
257
|
-
measureText(text?: string): TextMetrics;
|
|
400
|
+
measureText(text?: string | string[]): TextMetrics;
|
|
258
401
|
/**
|
|
259
402
|
* draw a text at the specified coord
|
|
260
403
|
* @param {Renderer} renderer - Reference to the destination renderer instance
|