melonjs 13.0.0 → 13.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/melonjs.js +360 -188
- package/dist/melonjs.min.js +3 -3
- package/dist/melonjs.module.d.ts +107 -95
- package/dist/melonjs.module.js +358 -192
- package/package.json +7 -7
- package/src/input/pointerevent.js +2 -2
- package/src/lang/deprecated.js +27 -1
- package/src/level/tiled/TMXGroup.js +10 -0
- package/src/level/tiled/TMXLayer.js +9 -0
- package/src/level/tiled/TMXObject.js +13 -2
- package/src/level/tiled/TMXTileMap.js +12 -0
- package/src/level/tiled/TMXTileset.js +8 -0
- package/src/math/color.js +62 -42
- package/src/math/observable_vector2.js +26 -2
- package/src/math/observable_vector3.js +32 -4
- package/src/math/vector2.js +23 -0
- package/src/math/vector3.js +26 -0
- package/src/renderable/nineslicesprite.js +27 -1
- package/src/video/canvas/canvas_renderer.js +27 -63
- package/src/video/renderer.js +22 -29
- package/src/video/texture/canvas_texture.js +4 -2
- package/src/video/video.js +12 -16
- package/src/video/webgl/webgl_compositor.js +2 -2
- package/src/video/webgl/webgl_renderer.js +8 -20
package/dist/melonjs.module.d.ts
CHANGED
|
@@ -1049,7 +1049,6 @@ export class CanvasRenderer extends Renderer {
|
|
|
1049
1049
|
* @param {number} options.width The width of the canvas without scaling
|
|
1050
1050
|
* @param {number} options.height The height of the canvas without scaling
|
|
1051
1051
|
* @param {HTMLCanvasElement} [options.canvas] The html canvas to draw to on screen
|
|
1052
|
-
* @param {boolean} [options.doubleBuffering=false] Whether to enable double buffering
|
|
1053
1052
|
* @param {boolean} [options.antiAlias=false] Whether to enable anti-aliasing
|
|
1054
1053
|
* @param {boolean} [options.transparent=false] Whether to enable transparency on the canvas (performance hit when enabled)
|
|
1055
1054
|
* @param {boolean} [options.subPixel=false] Whether to enable subpixel renderering (performance hit when enabled)
|
|
@@ -1061,7 +1060,6 @@ export class CanvasRenderer extends Renderer {
|
|
|
1061
1060
|
width: number;
|
|
1062
1061
|
height: number;
|
|
1063
1062
|
canvas?: HTMLCanvasElement;
|
|
1064
|
-
doubleBuffering?: boolean;
|
|
1065
1063
|
antiAlias?: boolean;
|
|
1066
1064
|
transparent?: boolean;
|
|
1067
1065
|
subPixel?: boolean;
|
|
@@ -1070,8 +1068,6 @@ export class CanvasRenderer extends Renderer {
|
|
|
1070
1068
|
zoomY?: number;
|
|
1071
1069
|
});
|
|
1072
1070
|
context: CanvasRenderingContext2D;
|
|
1073
|
-
backBufferCanvas: HTMLCanvasElement | OffscreenCanvas;
|
|
1074
|
-
backBufferContext2D: CanvasRenderingContext2D;
|
|
1075
1071
|
cache: TextureCache;
|
|
1076
1072
|
/**
|
|
1077
1073
|
* Reset the canvas transform to identity
|
|
@@ -1097,12 +1093,6 @@ export class CanvasRenderer extends Renderer {
|
|
|
1097
1093
|
* @param {CanvasRenderingContext2D} [context]
|
|
1098
1094
|
*/
|
|
1099
1095
|
setBlendMode(mode?: string, context?: CanvasRenderingContext2D): void;
|
|
1100
|
-
/**
|
|
1101
|
-
* render the main framebuffer on screen
|
|
1102
|
-
* @name flush
|
|
1103
|
-
* @memberof CanvasRenderer
|
|
1104
|
-
*/
|
|
1105
|
-
flush(): void;
|
|
1106
1096
|
/**
|
|
1107
1097
|
* Clears the main framebuffer with the given color
|
|
1108
1098
|
* @name clearColor
|
|
@@ -1295,18 +1285,11 @@ export class CanvasRenderer extends Renderer {
|
|
|
1295
1285
|
* @param {number} radius
|
|
1296
1286
|
*/
|
|
1297
1287
|
fillRoundRect(x: number, y: number, width: number, height: number, radius: number): void;
|
|
1298
|
-
/**
|
|
1299
|
-
* return a reference to the system 2d Context
|
|
1300
|
-
* @name getContext
|
|
1301
|
-
* @memberof CanvasRenderer
|
|
1302
|
-
* @returns {CanvasRenderingContext2D}
|
|
1303
|
-
*/
|
|
1304
|
-
getContext(): CanvasRenderingContext2D;
|
|
1305
1288
|
/**
|
|
1306
1289
|
* return a reference to the font 2d Context
|
|
1307
1290
|
* @ignore
|
|
1308
1291
|
*/
|
|
1309
|
-
getFontContext(): CanvasRenderingContext2D;
|
|
1292
|
+
getFontContext(): CanvasRenderingContext2D | WebGLRenderingContext;
|
|
1310
1293
|
/**
|
|
1311
1294
|
* save the canvas context
|
|
1312
1295
|
* @name save
|
|
@@ -1449,34 +1432,28 @@ export class Color {
|
|
|
1449
1432
|
/**
|
|
1450
1433
|
* Color Red Component [0 .. 255]
|
|
1451
1434
|
* @type {number}
|
|
1452
|
-
* @memberof Color
|
|
1453
1435
|
*/
|
|
1454
1436
|
get r(): number;
|
|
1455
1437
|
set g(arg: number);
|
|
1456
1438
|
/**
|
|
1457
1439
|
* Color Green Component [0 .. 255]
|
|
1458
1440
|
* @type {number}
|
|
1459
|
-
* @memberof Color
|
|
1460
1441
|
*/
|
|
1461
1442
|
get g(): number;
|
|
1462
1443
|
set b(arg: number);
|
|
1463
1444
|
/**
|
|
1464
1445
|
* Color Blue Component [0 .. 255]
|
|
1465
1446
|
* @type {number}
|
|
1466
|
-
* @memberof Color
|
|
1467
1447
|
*/
|
|
1468
1448
|
get b(): number;
|
|
1469
1449
|
set alpha(arg: number);
|
|
1470
1450
|
/**
|
|
1471
1451
|
* Color Alpha Component [0.0 .. 1.0]
|
|
1472
1452
|
* @type {number}
|
|
1473
|
-
* @memberof Color
|
|
1474
1453
|
*/
|
|
1475
1454
|
get alpha(): number;
|
|
1476
1455
|
/**
|
|
1477
1456
|
* Set this color to the specified value.
|
|
1478
|
-
* @name setColor
|
|
1479
|
-
* @memberof Color
|
|
1480
1457
|
* @param {number} r red component [0 .. 255]
|
|
1481
1458
|
* @param {number} g green component [0 .. 255]
|
|
1482
1459
|
* @param {number} b blue component [0 .. 255]
|
|
@@ -1484,41 +1461,47 @@ export class Color {
|
|
|
1484
1461
|
* @returns {Color} Reference to this object for method chaining
|
|
1485
1462
|
*/
|
|
1486
1463
|
setColor(r: number, g: number, b: number, alpha?: number): Color;
|
|
1464
|
+
/**
|
|
1465
|
+
* set this color to the specified HSV value
|
|
1466
|
+
* @param {number} h hue (a value from 0 to 1)
|
|
1467
|
+
* @param {number} s saturation (a value from 0 to 1)
|
|
1468
|
+
* @param {number} v value (a value from 0 to 1)
|
|
1469
|
+
* @returns {Color} Reference to this object for method chaining
|
|
1470
|
+
*/
|
|
1471
|
+
setHSV(h: number, s: number, v: number): Color;
|
|
1472
|
+
/**
|
|
1473
|
+
* set this color to the specified HSL value
|
|
1474
|
+
* @param {number} h hue (a value from 0 to 1)
|
|
1475
|
+
* @param {number} s saturation (a value from 0 to 1)
|
|
1476
|
+
* @param {number} l lightness (a value from 0 to 1)
|
|
1477
|
+
* @returns {Color} Reference to this object for method chaining
|
|
1478
|
+
*/
|
|
1479
|
+
setHSL(h: number, s: number, l: number): Color;
|
|
1487
1480
|
/**
|
|
1488
1481
|
* Create a new copy of this color object.
|
|
1489
|
-
* @name clone
|
|
1490
|
-
* @memberof Color
|
|
1491
1482
|
* @returns {Color} Reference to the newly cloned object
|
|
1492
1483
|
*/
|
|
1493
1484
|
clone(): Color;
|
|
1494
1485
|
/**
|
|
1495
1486
|
* Copy a color object or CSS color into this one.
|
|
1496
|
-
* @name copy
|
|
1497
|
-
* @memberof Color
|
|
1498
1487
|
* @param {Color|string} color
|
|
1499
1488
|
* @returns {Color} Reference to this object for method chaining
|
|
1500
1489
|
*/
|
|
1501
1490
|
copy(color: Color | string): Color;
|
|
1502
1491
|
/**
|
|
1503
1492
|
* Blend this color with the given one using addition.
|
|
1504
|
-
* @name add
|
|
1505
|
-
* @memberof Color
|
|
1506
1493
|
* @param {Color} color
|
|
1507
1494
|
* @returns {Color} Reference to this object for method chaining
|
|
1508
1495
|
*/
|
|
1509
1496
|
add(color: Color): Color;
|
|
1510
1497
|
/**
|
|
1511
1498
|
* Darken this color value by 0..1
|
|
1512
|
-
* @name darken
|
|
1513
|
-
* @memberof Color
|
|
1514
1499
|
* @param {number} scale
|
|
1515
1500
|
* @returns {Color} Reference to this object for method chaining
|
|
1516
1501
|
*/
|
|
1517
1502
|
darken(scale: number): Color;
|
|
1518
1503
|
/**
|
|
1519
1504
|
* Linearly interpolate between this color and the given one.
|
|
1520
|
-
* @name lerp
|
|
1521
|
-
* @memberof Color
|
|
1522
1505
|
* @param {Color} color
|
|
1523
1506
|
* @param {number} alpha with alpha = 0 being this color, and alpha = 1 being the given one.
|
|
1524
1507
|
* @returns {Color} Reference to this object for method chaining
|
|
@@ -1526,16 +1509,12 @@ export class Color {
|
|
|
1526
1509
|
lerp(color: Color, alpha: number): Color;
|
|
1527
1510
|
/**
|
|
1528
1511
|
* Lighten this color value by 0..1
|
|
1529
|
-
* @name lighten
|
|
1530
|
-
* @memberof Color
|
|
1531
1512
|
* @param {number} scale
|
|
1532
1513
|
* @returns {Color} Reference to this object for method chaining
|
|
1533
1514
|
*/
|
|
1534
1515
|
lighten(scale: number): Color;
|
|
1535
1516
|
/**
|
|
1536
1517
|
* Generate random r,g,b values for this color object
|
|
1537
|
-
* @name random
|
|
1538
|
-
* @memberof Color
|
|
1539
1518
|
* @param {number} [min=0] minimum value for the random range
|
|
1540
1519
|
* @param {number} [max=255] maxmium value for the random range
|
|
1541
1520
|
* @returns {Color} Reference to this object for method chaining
|
|
@@ -1544,8 +1523,6 @@ export class Color {
|
|
|
1544
1523
|
/**
|
|
1545
1524
|
* Return true if the r,g,b,a values of this color are equal with the
|
|
1546
1525
|
* given one.
|
|
1547
|
-
* @name equals
|
|
1548
|
-
* @memberof Color
|
|
1549
1526
|
* @param {Color} color
|
|
1550
1527
|
* @returns {boolean}
|
|
1551
1528
|
*/
|
|
@@ -1553,16 +1530,12 @@ export class Color {
|
|
|
1553
1530
|
/**
|
|
1554
1531
|
* Parse a CSS color string and set this color to the corresponding
|
|
1555
1532
|
* r,g,b values
|
|
1556
|
-
* @name parseCSS
|
|
1557
|
-
* @memberof Color
|
|
1558
1533
|
* @param {string} cssColor
|
|
1559
1534
|
* @returns {Color} Reference to this object for method chaining
|
|
1560
1535
|
*/
|
|
1561
1536
|
parseCSS(cssColor: string): Color;
|
|
1562
1537
|
/**
|
|
1563
1538
|
* Parse an RGB or RGBA CSS color string
|
|
1564
|
-
* @name parseRGB
|
|
1565
|
-
* @memberof Color
|
|
1566
1539
|
* @param {string} rgbColor
|
|
1567
1540
|
* @returns {Color} Reference to this object for method chaining
|
|
1568
1541
|
*/
|
|
@@ -1570,8 +1543,6 @@ export class Color {
|
|
|
1570
1543
|
/**
|
|
1571
1544
|
* Parse a Hex color ("#RGB", "#RGBA" or "#RRGGBB", "#RRGGBBAA" format) and set this color to
|
|
1572
1545
|
* the corresponding r,g,b,a values
|
|
1573
|
-
* @name parseHex
|
|
1574
|
-
* @memberof Color
|
|
1575
1546
|
* @param {string} hexColor
|
|
1576
1547
|
* @param {boolean} [argb = false] true if format is #ARGB, or #AARRGGBB (as opposed to #RGBA or #RGGBBAA)
|
|
1577
1548
|
* @returns {Color} Reference to this object for method chaining
|
|
@@ -1579,44 +1550,32 @@ export class Color {
|
|
|
1579
1550
|
parseHex(hexColor: string, argb?: boolean): Color;
|
|
1580
1551
|
/**
|
|
1581
1552
|
* Pack this color into a Uint32 ARGB representation
|
|
1582
|
-
* @name toUint32
|
|
1583
|
-
* @memberof Color
|
|
1584
1553
|
* @param {number} [alpha=1.0] alpha value [0.0 .. 1.0]
|
|
1585
1554
|
* @returns {number}
|
|
1586
1555
|
*/
|
|
1587
1556
|
toUint32(alpha?: number): number;
|
|
1588
1557
|
/**
|
|
1589
1558
|
* return an array representation of this object
|
|
1590
|
-
* @name toArray
|
|
1591
|
-
* @memberof Color
|
|
1592
1559
|
* @returns {Float32Array}
|
|
1593
1560
|
*/
|
|
1594
1561
|
toArray(): Float32Array;
|
|
1595
1562
|
/**
|
|
1596
|
-
*
|
|
1597
|
-
* @name toHex
|
|
1598
|
-
* @memberof Color
|
|
1563
|
+
* return the color in "#RRGGBB" format
|
|
1599
1564
|
* @returns {string}
|
|
1600
1565
|
*/
|
|
1601
1566
|
toHex(): string;
|
|
1602
1567
|
/**
|
|
1603
1568
|
* Get the color in "#RRGGBBAA" format
|
|
1604
|
-
* @name toHex8
|
|
1605
|
-
* @memberof Color
|
|
1606
1569
|
* @returns {string}
|
|
1607
1570
|
*/
|
|
1608
1571
|
toHex8(alpha?: number): string;
|
|
1609
1572
|
/**
|
|
1610
1573
|
* Get the color in "rgb(R,G,B)" format
|
|
1611
|
-
* @name toRGB
|
|
1612
|
-
* @memberof Color
|
|
1613
1574
|
* @returns {string}
|
|
1614
1575
|
*/
|
|
1615
1576
|
toRGB(): string;
|
|
1616
1577
|
/**
|
|
1617
1578
|
* Get the color in "rgba(R,G,B,A)" format
|
|
1618
|
-
* @name toRGBA
|
|
1619
|
-
* @memberof Color
|
|
1620
1579
|
* @param {number} [alpha=1.0] alpha value [0.0 .. 1.0]
|
|
1621
1580
|
* @returns {string}
|
|
1622
1581
|
*/
|
|
@@ -3617,6 +3576,15 @@ export class ObservableVector2d extends Vector2d {
|
|
|
3617
3576
|
* @returns {ObservableVector2d} Reference to this object for method chaining
|
|
3618
3577
|
*/
|
|
3619
3578
|
lerp(v: Vector2d | ObservableVector2d, alpha: number): ObservableVector2d;
|
|
3579
|
+
/**
|
|
3580
|
+
* interpolate the position of this vector towards the given one while nsure that the distance never exceeds the given step.
|
|
3581
|
+
* @name moveTowards
|
|
3582
|
+
* @memberof ObservableVector2d
|
|
3583
|
+
* @param {Vector2d|ObservableVector2d} target
|
|
3584
|
+
* @param {number} step the maximum step per iteration (Negative values will push the vector away from the target)
|
|
3585
|
+
* @returns {ObservableVector2d} Reference to this object for method chaining
|
|
3586
|
+
*/
|
|
3587
|
+
moveTowards(target: Vector2d | ObservableVector2d, step: number): ObservableVector2d;
|
|
3620
3588
|
/**
|
|
3621
3589
|
* return the distance between this vector and the passed one
|
|
3622
3590
|
* @name distance
|
|
@@ -3900,6 +3868,15 @@ export class ObservableVector3d extends Vector3d {
|
|
|
3900
3868
|
* @returns {ObservableVector3d} Reference to this object for method chaining
|
|
3901
3869
|
*/
|
|
3902
3870
|
lerp(v: Vector3d | ObservableVector3d, alpha: number): ObservableVector3d;
|
|
3871
|
+
/**
|
|
3872
|
+
* interpolate the position of this vector on the x and y axis towards the given one while ensure that the distance never exceeds the given step.
|
|
3873
|
+
* @name moveTowards
|
|
3874
|
+
* @memberof ObservableVector3d
|
|
3875
|
+
* @param {Vector2d|ObservableVector2d|Vector3d|ObservableVector3d} target
|
|
3876
|
+
* @param {number} step the maximum step per iteration (Negative values will push the vector away from the target)
|
|
3877
|
+
* @returns {ObservableVector3d} Reference to this object for method chaining
|
|
3878
|
+
*/
|
|
3879
|
+
moveTowards(target: Vector2d | ObservableVector2d | Vector3d | ObservableVector3d, step: number): ObservableVector3d;
|
|
3903
3880
|
/**
|
|
3904
3881
|
* return the distance between this vector and the passed one
|
|
3905
3882
|
* @name distance
|
|
@@ -6152,7 +6129,6 @@ export class Renderer {
|
|
|
6152
6129
|
* @param {number} options.width The width of the canvas without scaling
|
|
6153
6130
|
* @param {number} options.height The height of the canvas without scaling
|
|
6154
6131
|
* @param {HTMLCanvasElement} [options.canvas] The html canvas to draw to on screen
|
|
6155
|
-
* @param {boolean} [options.doubleBuffering=false] Whether to enable double buffering (not applicable when using the WebGL Renderer)
|
|
6156
6132
|
* @param {boolean} [options.antiAlias=false] Whether to enable anti-aliasing, use false (default) for a pixelated effect.
|
|
6157
6133
|
* @param {boolean} [options.failIfMajorPerformanceCaveat=true] If true, the renderer will switch to CANVAS mode if the performances of a WebGL context would be dramatically lower than that of a native application making equivalent OpenGL calls.
|
|
6158
6134
|
* @param {boolean} [options.transparent=false] Whether to enable transparency on the canvas (performance hit when enabled)
|
|
@@ -6166,7 +6142,6 @@ export class Renderer {
|
|
|
6166
6142
|
width: number;
|
|
6167
6143
|
height: number;
|
|
6168
6144
|
canvas?: HTMLCanvasElement;
|
|
6169
|
-
doubleBuffering?: boolean;
|
|
6170
6145
|
antiAlias?: boolean;
|
|
6171
6146
|
failIfMajorPerformanceCaveat?: boolean;
|
|
6172
6147
|
transparent?: boolean;
|
|
@@ -6212,8 +6187,6 @@ export class Renderer {
|
|
|
6212
6187
|
*/
|
|
6213
6188
|
currentBlendMode: string;
|
|
6214
6189
|
canvas: any;
|
|
6215
|
-
backBufferCanvas: any;
|
|
6216
|
-
context: any;
|
|
6217
6190
|
currentColor: Color;
|
|
6218
6191
|
currentTint: Color;
|
|
6219
6192
|
projectionMatrix: Matrix3d;
|
|
@@ -6224,6 +6197,12 @@ export class Renderer {
|
|
|
6224
6197
|
* @memberof Renderer
|
|
6225
6198
|
*/
|
|
6226
6199
|
clear(): void;
|
|
6200
|
+
/**
|
|
6201
|
+
* render the main framebuffer on screen
|
|
6202
|
+
* @name flush
|
|
6203
|
+
* @memberof Renderer
|
|
6204
|
+
*/
|
|
6205
|
+
flush(): void;
|
|
6227
6206
|
/**
|
|
6228
6207
|
* Reset context state
|
|
6229
6208
|
* @name reset
|
|
@@ -6231,27 +6210,19 @@ export class Renderer {
|
|
|
6231
6210
|
*/
|
|
6232
6211
|
reset(): void;
|
|
6233
6212
|
/**
|
|
6234
|
-
* return a reference to the
|
|
6213
|
+
* return a reference to the canvas which this renderer draws to
|
|
6235
6214
|
* @name getCanvas
|
|
6236
6215
|
* @memberof Renderer
|
|
6237
6216
|
* @returns {HTMLCanvasElement}
|
|
6238
6217
|
*/
|
|
6239
6218
|
getCanvas(): HTMLCanvasElement;
|
|
6240
6219
|
/**
|
|
6241
|
-
* return a reference to
|
|
6242
|
-
* @name
|
|
6243
|
-
* @memberof Renderer
|
|
6244
|
-
* @returns {HTMLCanvasElement}
|
|
6245
|
-
*/
|
|
6246
|
-
getScreenCanvas(): HTMLCanvasElement;
|
|
6247
|
-
/**
|
|
6248
|
-
* return a reference to the screen canvas corresponding 2d Context<br>
|
|
6249
|
-
* (will return buffered context if double buffering is enabled, or a reference to the Screen Context)
|
|
6250
|
-
* @name getScreenContext
|
|
6220
|
+
* return a reference to this renderer canvas corresponding Context
|
|
6221
|
+
* @name getContext
|
|
6251
6222
|
* @memberof Renderer
|
|
6252
|
-
* @returns {CanvasRenderingContext2D}
|
|
6223
|
+
* @returns {CanvasRenderingContext2D|WebGLRenderingContext}
|
|
6253
6224
|
*/
|
|
6254
|
-
|
|
6225
|
+
getContext(): CanvasRenderingContext2D | WebGLRenderingContext;
|
|
6255
6226
|
/**
|
|
6256
6227
|
* returns the current blend mode for this renderer
|
|
6257
6228
|
* @name getBlendMode
|
|
@@ -6390,6 +6361,25 @@ export class Renderer {
|
|
|
6390
6361
|
*/
|
|
6391
6362
|
drawFont(): void;
|
|
6392
6363
|
get Texture(): typeof TextureAtlas;
|
|
6364
|
+
/**
|
|
6365
|
+
* return a reference to the screen canvas
|
|
6366
|
+
* @name getScreenCanvas
|
|
6367
|
+
* @memberof Renderer
|
|
6368
|
+
* @returns {HTMLCanvasElement}
|
|
6369
|
+
* @deprecated since 13.1.0
|
|
6370
|
+
* @see getCanvas();
|
|
6371
|
+
*/
|
|
6372
|
+
getScreenCanvas(): HTMLCanvasElement;
|
|
6373
|
+
/**
|
|
6374
|
+
* return a reference to the screen canvas corresponding 2d Context<br>
|
|
6375
|
+
* (will return buffered context if double buffering is enabled, or a reference to the Screen Context)
|
|
6376
|
+
* @name getScreenContext
|
|
6377
|
+
* @memberof Renderer
|
|
6378
|
+
* @returns {CanvasRenderingContext2D}
|
|
6379
|
+
* @deprecated since 13.1.0
|
|
6380
|
+
* @see getContext();
|
|
6381
|
+
*/
|
|
6382
|
+
getScreenContext(): CanvasRenderingContext2D;
|
|
6393
6383
|
}
|
|
6394
6384
|
/**
|
|
6395
6385
|
* @classdesc
|
|
@@ -6997,6 +6987,14 @@ export class TMXLayer extends Renderable {
|
|
|
6997
6987
|
* @name TMXLayer#renderorder
|
|
6998
6988
|
*/
|
|
6999
6989
|
public renderorder: string;
|
|
6990
|
+
/**
|
|
6991
|
+
* the layer class
|
|
6992
|
+
* @public
|
|
6993
|
+
* @type {string}
|
|
6994
|
+
* @name class
|
|
6995
|
+
* @name TMXLayer#class
|
|
6996
|
+
*/
|
|
6997
|
+
public class: string;
|
|
7000
6998
|
name: any;
|
|
7001
6999
|
cols: number;
|
|
7002
7000
|
rows: number;
|
|
@@ -7328,6 +7326,13 @@ export class TMXTileMap {
|
|
|
7328
7326
|
* @name TMXTileMap#tiledversion
|
|
7329
7327
|
*/
|
|
7330
7328
|
public tiledversion: string;
|
|
7329
|
+
/**
|
|
7330
|
+
* The map class.
|
|
7331
|
+
* @public
|
|
7332
|
+
* @type {string}
|
|
7333
|
+
* @name TMXTileMap#class
|
|
7334
|
+
*/
|
|
7335
|
+
public class: string;
|
|
7331
7336
|
tilesets: TMXTilesetGroup;
|
|
7332
7337
|
layers: any[];
|
|
7333
7338
|
objectGroups: any[];
|
|
@@ -7433,6 +7438,13 @@ export class TMXTileset {
|
|
|
7433
7438
|
* @name TMXTileset#isCollection
|
|
7434
7439
|
*/
|
|
7435
7440
|
public isCollection: boolean;
|
|
7441
|
+
/**
|
|
7442
|
+
* the tileset class
|
|
7443
|
+
* @public
|
|
7444
|
+
* @type {boolean}
|
|
7445
|
+
* @name TMXTileset#class
|
|
7446
|
+
*/
|
|
7447
|
+
public class: boolean;
|
|
7436
7448
|
/**
|
|
7437
7449
|
* Tileset animations
|
|
7438
7450
|
* @private
|
|
@@ -8463,6 +8475,15 @@ export class Vector2d {
|
|
|
8463
8475
|
* @returns {Vector2d} Reference to this object for method chaining
|
|
8464
8476
|
*/
|
|
8465
8477
|
lerp(v: Vector2d, alpha: number): Vector2d;
|
|
8478
|
+
/**
|
|
8479
|
+
* interpolate the position of this vector towards the given one by the given maximum step.
|
|
8480
|
+
* @name moveTowards
|
|
8481
|
+
* @memberof Vector2d
|
|
8482
|
+
* @param {Vector2d} target
|
|
8483
|
+
* @param {number} step the maximum step per iteration (Negative values will push the vector away from the target)
|
|
8484
|
+
* @returns {Vector2d} Reference to this object for method chaining
|
|
8485
|
+
*/
|
|
8486
|
+
moveTowards(target: Vector2d, step: number): Vector2d;
|
|
8466
8487
|
/**
|
|
8467
8488
|
* return the distance between this vector and the passed one
|
|
8468
8489
|
* @name distance
|
|
@@ -8786,6 +8807,15 @@ export class Vector3d {
|
|
|
8786
8807
|
* @returns {Vector3d} Reference to this object for method chaining
|
|
8787
8808
|
*/
|
|
8788
8809
|
lerp(v: Vector3d, alpha: number): Vector3d;
|
|
8810
|
+
/**
|
|
8811
|
+
* interpolate the position of this vector on the x and y axis towards the given one by the given maximum step.
|
|
8812
|
+
* @name moveTowards
|
|
8813
|
+
* @memberof Vector3d
|
|
8814
|
+
* @param {Vector2d|Vector3d} target
|
|
8815
|
+
* @param {number} step the maximum step per iteration (Negative values will push the vector away from the target)
|
|
8816
|
+
* @returns {Vector3d} Reference to this object for method chaining
|
|
8817
|
+
*/
|
|
8818
|
+
moveTowards(target: Vector2d | Vector3d, step: number): Vector3d;
|
|
8789
8819
|
/**
|
|
8790
8820
|
* return the distance between this vector and the passed one
|
|
8791
8821
|
* @name distance
|
|
@@ -9049,7 +9079,6 @@ export class WebGLRenderer extends Renderer {
|
|
|
9049
9079
|
* @param {number} options.width The width of the canvas without scaling
|
|
9050
9080
|
* @param {number} options.height The height of the canvas without scaling
|
|
9051
9081
|
* @param {HTMLCanvasElement} [options.canvas] The html canvas to draw to on screen
|
|
9052
|
-
* @param {boolean} [options.doubleBuffering=false] Whether to enable double buffering (not applicable when using the WebGL Renderer)
|
|
9053
9082
|
* @param {boolean} [options.antiAlias=false] Whether to enable anti-aliasing
|
|
9054
9083
|
* @param {boolean} [options.failIfMajorPerformanceCaveat=true] If true, the renderer will switch to CANVAS mode if the performances of a WebGL context would be dramatically lower than that of a native application making equivalent OpenGL calls.
|
|
9055
9084
|
* @param {boolean} [options.transparent=false] Whether to enable transparency on the canvas (performance hit when enabled)
|
|
@@ -9064,7 +9093,6 @@ export class WebGLRenderer extends Renderer {
|
|
|
9064
9093
|
width: number;
|
|
9065
9094
|
height: number;
|
|
9066
9095
|
canvas?: HTMLCanvasElement;
|
|
9067
|
-
doubleBuffering?: boolean;
|
|
9068
9096
|
antiAlias?: boolean;
|
|
9069
9097
|
failIfMajorPerformanceCaveat?: boolean;
|
|
9070
9098
|
transparent?: boolean;
|
|
@@ -9196,12 +9224,6 @@ export class WebGLRenderer extends Renderer {
|
|
|
9196
9224
|
* var basic = renderer.createPattern(image, "no-repeat");
|
|
9197
9225
|
*/
|
|
9198
9226
|
createPattern(image: new (width?: number, height?: number) => HTMLImageElement, repeat: string): TextureAtlas;
|
|
9199
|
-
/**
|
|
9200
|
-
* Flush the compositor to the frame buffer
|
|
9201
|
-
* @name flush
|
|
9202
|
-
* @memberof WebGLRenderer
|
|
9203
|
-
*/
|
|
9204
|
-
flush(): void;
|
|
9205
9227
|
/**
|
|
9206
9228
|
* Clears the gl context with the given color.
|
|
9207
9229
|
* @name clearColor
|
|
@@ -9258,13 +9280,6 @@ export class WebGLRenderer extends Renderer {
|
|
|
9258
9280
|
* @see WebGLRenderer#createPattern
|
|
9259
9281
|
*/
|
|
9260
9282
|
drawPattern(pattern: TextureAtlas, x: number, y: number, width: number, height: number): void;
|
|
9261
|
-
/**
|
|
9262
|
-
* return a reference to the screen canvas corresponding WebGL Context
|
|
9263
|
-
* @name getScreenContext
|
|
9264
|
-
* @memberof WebGLRenderer
|
|
9265
|
-
* @returns {WebGLRenderingContext}
|
|
9266
|
-
*/
|
|
9267
|
-
getScreenContext(): WebGLRenderingContext;
|
|
9268
9283
|
/**
|
|
9269
9284
|
* Returns the WebGL Context object of the given Canvas
|
|
9270
9285
|
* @name getContextGL
|
|
@@ -12535,7 +12550,6 @@ declare var fnUtils: Readonly<{
|
|
|
12535
12550
|
* @param {object} [options] The optional video/renderer parameters.<br> (see Renderer(s) documentation for further specific options)
|
|
12536
12551
|
* @param {string|HTMLElement} [options.parent=document.body] the DOM parent element to hold the canvas in the HTML file
|
|
12537
12552
|
* @param {number} [options.renderer=video.AUTO] renderer to use (me.video.CANVAS, me.video.WEBGL, me.video.AUTO)
|
|
12538
|
-
* @param {boolean} [options.doubleBuffering=false] enable/disable double buffering
|
|
12539
12553
|
* @param {number|string} [options.scale=1.0] enable scaling of the canvas ('auto' for automatic scaling)
|
|
12540
12554
|
* @param {string} [options.scaleMethod="fit"] screen scaling modes ('fit','fill-min','fill-max','flex','flex-width','flex-height','stretch')
|
|
12541
12555
|
* @param {boolean} [options.preferWebGL1=false] if true the renderer will only use WebGL 1
|
|
@@ -12550,14 +12564,12 @@ declare var fnUtils: Readonly<{
|
|
|
12550
12564
|
* parent : "screen",
|
|
12551
12565
|
* renderer : me.video.AUTO,
|
|
12552
12566
|
* scale : "auto",
|
|
12553
|
-
* scaleMethod : "fit"
|
|
12554
|
-
* doubleBuffering : true
|
|
12567
|
+
* scaleMethod : "fit"
|
|
12555
12568
|
* });
|
|
12556
12569
|
*/
|
|
12557
12570
|
declare function init(width: number, height: number, options?: {
|
|
12558
12571
|
parent?: string | HTMLElement;
|
|
12559
12572
|
renderer?: number;
|
|
12560
|
-
doubleBuffering?: boolean;
|
|
12561
12573
|
scale?: number | string;
|
|
12562
12574
|
scaleMethod?: string;
|
|
12563
12575
|
preferWebGL1?: boolean;
|