melonjs 10.0.2 → 10.2.1
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 +7 -13
- package/dist/melonjs.js +1213 -828
- package/dist/melonjs.min.js +3 -3
- package/dist/melonjs.module.d.ts +581 -454
- package/dist/melonjs.module.js +1182 -823
- package/package.json +6 -6
- package/src/camera/camera2d.js +3 -3
- package/src/game.js +1 -1
- package/src/index.js +4 -0
- package/src/input/pointer.js +22 -21
- package/src/input/pointerevent.js +10 -12
- package/src/level/tiled/TMXLayer.js +1 -1
- package/src/loader/loader.js +2 -2
- package/src/loader/loadingscreen.js +40 -72
- package/src/math/color.js +22 -4
- package/src/physics/body.js +1 -7
- package/src/physics/bounds.js +2 -2
- package/src/physics/detector.js +0 -1
- package/src/physics/world.js +2 -1
- package/src/renderable/container.js +1 -0
- package/src/renderable/imagelayer.js +2 -0
- package/src/renderable/nineslicesprite.js +211 -0
- package/src/renderable/renderable.js +3 -3
- package/src/renderable/sprite.js +2 -2
- package/src/state/stage.js +2 -2
- package/src/state/state.js +2 -2
- package/src/system/device.js +15 -1
- package/src/text/text.js +82 -21
- package/src/video/renderer.js +5 -3
- package/src/video/texture.js +17 -7
- package/src/video/texture_cache.js +11 -0
- package/src/video/video.js +3 -3
- package/src/video/webgl/buffer/vertex.js +130 -0
- package/src/video/webgl/shaders/quad.vert +1 -1
- package/src/video/webgl/webgl_compositor.js +104 -167
- package/src/video/webgl/webgl_renderer.js +25 -20
package/dist/melonjs.module.d.ts
CHANGED
|
@@ -132,7 +132,7 @@ export class BitmapText {
|
|
|
132
132
|
* @param {me.Rect} [ret] a object in which to store the text metrics
|
|
133
133
|
* @returns {TextMetrics} a TextMetrics object with two properties: `width` and `height`, defining the output dimensions
|
|
134
134
|
*/
|
|
135
|
-
measureText(text?: string, ret?:
|
|
135
|
+
measureText(text?: string, ret?: me.Rect): TextMetrics;
|
|
136
136
|
/**
|
|
137
137
|
* @ignore
|
|
138
138
|
*/
|
|
@@ -147,7 +147,7 @@ export class BitmapText {
|
|
|
147
147
|
* @param {Number} [x]
|
|
148
148
|
* @param {Number} [y]
|
|
149
149
|
*/
|
|
150
|
-
draw(renderer:
|
|
150
|
+
draw(renderer: me.CanvasRenderer | me.WebGLRenderer, text?: string, x?: number, y?: number): void;
|
|
151
151
|
/**
|
|
152
152
|
* Destroy function
|
|
153
153
|
* @ignore
|
|
@@ -192,13 +192,7 @@ export class BitmapTextData {
|
|
|
192
192
|
parse(fontData: string): void;
|
|
193
193
|
}
|
|
194
194
|
/**
|
|
195
|
-
* a Generic Body Object with some physic properties and behavior functionality
|
|
196
|
-
The body object is attached as a member of a Renderable. The Body object can handle movements of the parent with
|
|
197
|
-
the body.update call. It is important to know that when body.update is called there are several things that happen related to
|
|
198
|
-
the movement and positioning of the parent renderable object. 1) The force/gravity/friction parameters are used
|
|
199
|
-
to calculate a new velocity and 2) the parent position is updated by adding this to the parent.pos (position me.Vector2d)
|
|
200
|
-
value. Thus Affecting the movement of the parent. Look at the source code for /src/physics/body.js:update (me.Body.update) for
|
|
201
|
-
a better understanding.
|
|
195
|
+
* a Generic Physic Body Object with some physic properties and behavior functionality, to as a member of a Renderable.
|
|
202
196
|
* @class Body
|
|
203
197
|
* @memberOf me
|
|
204
198
|
* @constructor
|
|
@@ -216,7 +210,7 @@ export class Body {
|
|
|
216
210
|
* @default undefined
|
|
217
211
|
* @name me.Body#ancestor
|
|
218
212
|
*/
|
|
219
|
-
public ancestor:
|
|
213
|
+
public ancestor: me.Renderable;
|
|
220
214
|
bounds: Bounds$1;
|
|
221
215
|
shapes: any[];
|
|
222
216
|
/**
|
|
@@ -345,7 +339,7 @@ export class Body {
|
|
|
345
339
|
* // add a shape from a JSON object
|
|
346
340
|
* this.body.addShape(me.loader.getJSON("shapesdef").banana);
|
|
347
341
|
*/
|
|
348
|
-
public addShape(shape:
|
|
342
|
+
public addShape(shape: me.Rect | me.Polygon | me.Line | me.Ellipse | me.Bounds | any): number;
|
|
349
343
|
/**
|
|
350
344
|
* set the body vertices to the given one
|
|
351
345
|
* @name setVertices
|
|
@@ -356,7 +350,7 @@ export class Body {
|
|
|
356
350
|
* @param {Number} [index=0] the shape object for which to set the vertices
|
|
357
351
|
* @param {boolean} [clear=true] either to reset the body definition before adding the new vertices
|
|
358
352
|
*/
|
|
359
|
-
public setVertices(vertices:
|
|
353
|
+
public setVertices(vertices: me.Vector2d[], index?: number, clear?: boolean): void;
|
|
360
354
|
/**
|
|
361
355
|
* add the given vertices to the body shape
|
|
362
356
|
* @name addVertices
|
|
@@ -366,7 +360,7 @@ export class Body {
|
|
|
366
360
|
* @param {me.Vector2d[]} vertices an array of me.Vector2d points defining a convex hull
|
|
367
361
|
* @param {Number} [index=0] the shape object for which to set the vertices
|
|
368
362
|
*/
|
|
369
|
-
public addVertices(vertices:
|
|
363
|
+
public addVertices(vertices: me.Vector2d[], index?: number): void;
|
|
370
364
|
/**
|
|
371
365
|
* add collision mesh based on a JSON object
|
|
372
366
|
* (this will also apply any physic properties defined in the given JSON file)
|
|
@@ -394,7 +388,7 @@ export class Body {
|
|
|
394
388
|
* @param {Number} [index=0] the shape object at the specified index
|
|
395
389
|
* @return {me.Polygon|me.Line|me.Ellipse} shape a shape object if defined
|
|
396
390
|
*/
|
|
397
|
-
public getShape(index?: number):
|
|
391
|
+
public getShape(index?: number): me.Polygon | me.Line | me.Ellipse;
|
|
398
392
|
/**
|
|
399
393
|
* returns the AABB bounding box for this body
|
|
400
394
|
* @name getBounds
|
|
@@ -402,7 +396,7 @@ export class Body {
|
|
|
402
396
|
* @function
|
|
403
397
|
* @return {me.Bounds} bounding box Rectangle object
|
|
404
398
|
*/
|
|
405
|
-
getBounds():
|
|
399
|
+
getBounds(): me.Bounds;
|
|
406
400
|
/**
|
|
407
401
|
* remove the specified shape from the body shape list
|
|
408
402
|
* @name removeShape
|
|
@@ -412,7 +406,7 @@ export class Body {
|
|
|
412
406
|
* @param {me.Polygon|me.Line|me.Ellipse} shape a shape object
|
|
413
407
|
* @return {Number} the shape array length
|
|
414
408
|
*/
|
|
415
|
-
public removeShape(shape:
|
|
409
|
+
public removeShape(shape: me.Polygon | me.Line | me.Ellipse): number;
|
|
416
410
|
/**
|
|
417
411
|
* remove the shape at the given index from the body shape list
|
|
418
412
|
* @name removeShapeAt
|
|
@@ -462,7 +456,7 @@ export class Body {
|
|
|
462
456
|
* @function
|
|
463
457
|
* @param {me.collision.ResponseObject} response the collision response object
|
|
464
458
|
*/
|
|
465
|
-
protected respondToCollision(response:
|
|
459
|
+
protected respondToCollision(response: me.collision.ResponseObject): void;
|
|
466
460
|
/**
|
|
467
461
|
* The forEach() method executes a provided function once per body shape element. <br>
|
|
468
462
|
* the callback function is invoked with three arguments: <br>
|
|
@@ -512,7 +506,7 @@ export class Body {
|
|
|
512
506
|
* @param {me.Vector2d|me.ObservableVector2d} [v=me.Body.getBounds().center] an optional point to rotate around
|
|
513
507
|
* @return {me.Body} Reference to this object for method chaining
|
|
514
508
|
*/
|
|
515
|
-
rotate(angle: number, v?:
|
|
509
|
+
rotate(angle: number, v?: me.Vector2d | me.ObservableVector2d): me.Body;
|
|
516
510
|
/**
|
|
517
511
|
* cap the body velocity (body.maxVel property) to the specified value<br>
|
|
518
512
|
* @name setMaxVelocity
|
|
@@ -696,7 +690,7 @@ declare class Bounds$1 {
|
|
|
696
690
|
* @name center
|
|
697
691
|
* @memberOf me.Bounds
|
|
698
692
|
*/
|
|
699
|
-
public get center():
|
|
693
|
+
public get center(): me.Vector2d;
|
|
700
694
|
/**
|
|
701
695
|
* Updates bounds using the given vertices
|
|
702
696
|
* @name update
|
|
@@ -704,7 +698,7 @@ declare class Bounds$1 {
|
|
|
704
698
|
* @function
|
|
705
699
|
* @param {me.Vector2d[]} vertices an array of me.Vector2d points
|
|
706
700
|
*/
|
|
707
|
-
update(vertices:
|
|
701
|
+
update(vertices: me.Vector2d[]): void;
|
|
708
702
|
/**
|
|
709
703
|
* add the given vertices to the bounds definition.
|
|
710
704
|
* @name add
|
|
@@ -713,7 +707,7 @@ declare class Bounds$1 {
|
|
|
713
707
|
* @param {me.Vector2d[]} vertices an array of me.Vector2d points
|
|
714
708
|
* @param {boolean} [clear=false] either to reset the bounds before adding the new vertices
|
|
715
709
|
*/
|
|
716
|
-
add(vertices:
|
|
710
|
+
add(vertices: me.Vector2d[], clear?: boolean): void;
|
|
717
711
|
/**
|
|
718
712
|
* add the given bounds to the bounds definition.
|
|
719
713
|
* @name addBounds
|
|
@@ -722,7 +716,7 @@ declare class Bounds$1 {
|
|
|
722
716
|
* @param {me.Bounds} bounds
|
|
723
717
|
* @param {boolean} [clear=false] either to reset the bounds before adding the new vertices
|
|
724
718
|
*/
|
|
725
|
-
addBounds(bounds:
|
|
719
|
+
addBounds(bounds: me.Bounds, clear?: boolean): void;
|
|
726
720
|
/**
|
|
727
721
|
* add the given point to the bounds definition.
|
|
728
722
|
* @name addPoint
|
|
@@ -770,7 +764,7 @@ declare class Bounds$1 {
|
|
|
770
764
|
* @param {me.Bounds|me.Rect} bounds
|
|
771
765
|
* @return {boolean} True if the bounds overlap, otherwise false
|
|
772
766
|
*/
|
|
773
|
-
overlaps(bounds:
|
|
767
|
+
overlaps(bounds: me.Bounds | me.Rect): boolean;
|
|
774
768
|
/**
|
|
775
769
|
* determines whether all coordinates of this bounds are finite numbers.
|
|
776
770
|
* @name isFinite
|
|
@@ -818,7 +812,7 @@ declare class Bounds$1 {
|
|
|
818
812
|
* @function
|
|
819
813
|
* @return {me.Bounds}
|
|
820
814
|
*/
|
|
821
|
-
clone():
|
|
815
|
+
clone(): me.Bounds;
|
|
822
816
|
/**
|
|
823
817
|
* Returns a polygon whose edges are the same as this bounds.
|
|
824
818
|
* @name toPolygon
|
|
@@ -826,7 +820,7 @@ declare class Bounds$1 {
|
|
|
826
820
|
* @function
|
|
827
821
|
* @return {me.Polygon} a new Polygon that represents this bounds.
|
|
828
822
|
*/
|
|
829
|
-
toPolygon():
|
|
823
|
+
toPolygon(): me.Polygon;
|
|
830
824
|
}
|
|
831
825
|
/**
|
|
832
826
|
* @classdesc
|
|
@@ -870,7 +864,7 @@ export class Camera2d {
|
|
|
870
864
|
* @name bounds
|
|
871
865
|
* @memberOf me.Camera2d
|
|
872
866
|
*/
|
|
873
|
-
public bounds:
|
|
867
|
+
public bounds: me.Bounds;
|
|
874
868
|
/**
|
|
875
869
|
* [IMTERNAL] enable or disable damping
|
|
876
870
|
* @private
|
|
@@ -917,7 +911,7 @@ export class Camera2d {
|
|
|
917
911
|
* @name projectionMatrix
|
|
918
912
|
* @memberOf me.Camera2d
|
|
919
913
|
*/
|
|
920
|
-
public projectionMatrix:
|
|
914
|
+
public projectionMatrix: me.Matrix3d;
|
|
921
915
|
/**
|
|
922
916
|
* the invert camera transform used to unproject points
|
|
923
917
|
* @ignore
|
|
@@ -925,7 +919,7 @@ export class Camera2d {
|
|
|
925
919
|
* @name invCurrentTransform
|
|
926
920
|
* @memberOf me.Camera2d
|
|
927
921
|
*/
|
|
928
|
-
invCurrentTransform:
|
|
922
|
+
invCurrentTransform: me.Matrix2d;
|
|
929
923
|
offset: Vector2d;
|
|
930
924
|
target: any;
|
|
931
925
|
follow_axis: number;
|
|
@@ -982,7 +976,7 @@ export class Camera2d {
|
|
|
982
976
|
* @param {Number} h new height of the camera
|
|
983
977
|
* @return {me.Camera2d} this camera
|
|
984
978
|
*/
|
|
985
|
-
resize(w: number, h: number):
|
|
979
|
+
resize(w: number, h: number): me.Camera2d;
|
|
986
980
|
/**
|
|
987
981
|
* set the camera boundaries (set to the world limit by default).
|
|
988
982
|
* the camera is bound to the given coordinates and cannot move/be scrolled outside of it.
|
|
@@ -1008,7 +1002,7 @@ export class Camera2d {
|
|
|
1008
1002
|
* // set the camera to follow this renderable on both axis, and enable damping
|
|
1009
1003
|
* me.game.viewport.follow(this, me.game.viewport.AXIS.BOTH, 0.1);
|
|
1010
1004
|
*/
|
|
1011
|
-
follow(target:
|
|
1005
|
+
follow(target: me.Renderable | me.Vector2d, axis?: me.Camera2d.AXIS, damping?: number): void;
|
|
1012
1006
|
/**
|
|
1013
1007
|
* unfollow the current target
|
|
1014
1008
|
* @name unfollow
|
|
@@ -1059,7 +1053,7 @@ export class Camera2d {
|
|
|
1059
1053
|
* // shake it baby !
|
|
1060
1054
|
* me.game.viewport.shake(10, 500, me.game.viewport.AXIS.BOTH);
|
|
1061
1055
|
*/
|
|
1062
|
-
shake(intensity: number, duration: number, axis?:
|
|
1056
|
+
shake(intensity: number, duration: number, axis?: me.Camera2d.AXIS, onComplete?: Function, force?: boolean): void;
|
|
1063
1057
|
/**
|
|
1064
1058
|
* fadeOut(flash) effect<p>
|
|
1065
1059
|
* screen is filled with the specified color and slowly goes back to normal
|
|
@@ -1077,7 +1071,7 @@ export class Camera2d {
|
|
|
1077
1071
|
* me.game.viewport.fadeOut("#fff", 150);
|
|
1078
1072
|
* });
|
|
1079
1073
|
*/
|
|
1080
|
-
fadeOut(color:
|
|
1074
|
+
fadeOut(color: me.Color | string, duration?: number, onComplete?: Function): void;
|
|
1081
1075
|
/**
|
|
1082
1076
|
* fadeIn effect <p>
|
|
1083
1077
|
* fade to the specified color
|
|
@@ -1091,7 +1085,7 @@ export class Camera2d {
|
|
|
1091
1085
|
* // flash the camera to white for 75ms
|
|
1092
1086
|
* me.game.viewport.fadeIn("#FFFFFF", 75);
|
|
1093
1087
|
*/
|
|
1094
|
-
fadeIn(color:
|
|
1088
|
+
fadeIn(color: me.Color | string, duration?: number, onComplete?: Function): void;
|
|
1095
1089
|
/**
|
|
1096
1090
|
* return the camera width
|
|
1097
1091
|
* @name getWidth
|
|
@@ -1137,7 +1131,7 @@ export class Camera2d {
|
|
|
1137
1131
|
* converted value
|
|
1138
1132
|
* @return {me.Vector2d}
|
|
1139
1133
|
*/
|
|
1140
|
-
localToWorld(x: number, y: number, v?: number):
|
|
1134
|
+
localToWorld(x: number, y: number, v?: number): me.Vector2d;
|
|
1141
1135
|
/**
|
|
1142
1136
|
* convert the given world coordinates into "local" (screen) coordinates
|
|
1143
1137
|
* @name worldToLocal
|
|
@@ -1149,7 +1143,7 @@ export class Camera2d {
|
|
|
1149
1143
|
* converted value
|
|
1150
1144
|
* @return {me.Vector2d}
|
|
1151
1145
|
*/
|
|
1152
|
-
worldToLocal(x: number, y: number, v?: number):
|
|
1146
|
+
worldToLocal(x: number, y: number, v?: number): me.Vector2d;
|
|
1153
1147
|
/**
|
|
1154
1148
|
* render the camera effects
|
|
1155
1149
|
* @ignore
|
|
@@ -1209,7 +1203,7 @@ export class CanvasRenderer {
|
|
|
1209
1203
|
* @param {String} [mode="normal"] blend mode : "normal", "multiply"
|
|
1210
1204
|
* @param {Context2d} [context]
|
|
1211
1205
|
*/
|
|
1212
|
-
setBlendMode(mode?: string, context?:
|
|
1206
|
+
setBlendMode(mode?: string, context?: Context2d): void;
|
|
1213
1207
|
currentBlendMode: string;
|
|
1214
1208
|
/**
|
|
1215
1209
|
* prepare the framebuffer for drawing a new frame
|
|
@@ -1377,7 +1371,7 @@ export class CanvasRenderer {
|
|
|
1377
1371
|
* @param {me.Polygon} poly the shape to draw
|
|
1378
1372
|
* @param {Boolean} [fill=false] also fill the shape with the current color if true
|
|
1379
1373
|
*/
|
|
1380
|
-
strokePolygon(poly:
|
|
1374
|
+
strokePolygon(poly: me.Polygon, fill?: boolean): void;
|
|
1381
1375
|
/**
|
|
1382
1376
|
* Fill the given me.Polygon on the screen
|
|
1383
1377
|
* @name fillPolygon
|
|
@@ -1385,7 +1379,7 @@ export class CanvasRenderer {
|
|
|
1385
1379
|
* @function
|
|
1386
1380
|
* @param {me.Polygon} poly the shape to draw
|
|
1387
1381
|
*/
|
|
1388
|
-
fillPolygon(poly:
|
|
1382
|
+
fillPolygon(poly: me.Polygon): void;
|
|
1389
1383
|
/**
|
|
1390
1384
|
* Stroke a rectangle at the specified coordinates
|
|
1391
1385
|
* @name strokeRect
|
|
@@ -1486,7 +1480,7 @@ export class CanvasRenderer {
|
|
|
1486
1480
|
* @function
|
|
1487
1481
|
* @param {me.Matrix2d} mat2d Matrix to transform by
|
|
1488
1482
|
*/
|
|
1489
|
-
setTransform(mat2d:
|
|
1483
|
+
setTransform(mat2d: me.Matrix2d): void;
|
|
1490
1484
|
/**
|
|
1491
1485
|
* Multiply given matrix into the renderer tranformation matrix
|
|
1492
1486
|
* @name transform
|
|
@@ -1494,7 +1488,7 @@ export class CanvasRenderer {
|
|
|
1494
1488
|
* @function
|
|
1495
1489
|
* @param {me.Matrix2d} mat2d Matrix to transform by
|
|
1496
1490
|
*/
|
|
1497
|
-
transform(mat2d:
|
|
1491
|
+
transform(mat2d: me.Matrix2d): void;
|
|
1498
1492
|
/**
|
|
1499
1493
|
* Translates the context to the given position
|
|
1500
1494
|
* @name translate
|
|
@@ -1528,7 +1522,7 @@ export class CanvasRenderer {
|
|
|
1528
1522
|
* @function
|
|
1529
1523
|
* @param {me.Rect|me.Polygon|me.Line|me.Ellipse} [mask] the shape defining the mask to be applied
|
|
1530
1524
|
*/
|
|
1531
|
-
setMask(mask?:
|
|
1525
|
+
setMask(mask?: me.Rect | me.Polygon | me.Line | me.Ellipse): void;
|
|
1532
1526
|
/**
|
|
1533
1527
|
* disable (remove) the rendering mask set through setMask.
|
|
1534
1528
|
* @name clearMask
|
|
@@ -1575,14 +1569,14 @@ export class Color {
|
|
|
1575
1569
|
/**
|
|
1576
1570
|
* @ignore
|
|
1577
1571
|
*/
|
|
1578
|
-
onResetEvent(r?: number, g?: number, b?: number, alpha?: number):
|
|
1572
|
+
onResetEvent(r?: number, g?: number, b?: number, alpha?: number): me.Color;
|
|
1579
1573
|
glArray: Float32Array;
|
|
1580
1574
|
/**
|
|
1581
1575
|
* @ignore
|
|
1582
1576
|
*/
|
|
1583
1577
|
set r(arg: number);
|
|
1584
1578
|
/**
|
|
1585
|
-
* Color Red Component
|
|
1579
|
+
* Color Red Component [0 .. 255]
|
|
1586
1580
|
* @type Number
|
|
1587
1581
|
* @name r
|
|
1588
1582
|
* @readonly
|
|
@@ -1597,7 +1591,7 @@ export class Color {
|
|
|
1597
1591
|
*/
|
|
1598
1592
|
set g(arg: number);
|
|
1599
1593
|
/**
|
|
1600
|
-
* Color Green Component
|
|
1594
|
+
* Color Green Component [0 .. 255]
|
|
1601
1595
|
* @type Number
|
|
1602
1596
|
* @name g
|
|
1603
1597
|
* @readonly
|
|
@@ -1612,7 +1606,7 @@ export class Color {
|
|
|
1612
1606
|
*/
|
|
1613
1607
|
set b(arg: number);
|
|
1614
1608
|
/**
|
|
1615
|
-
* Color Blue Component
|
|
1609
|
+
* Color Blue Component [0 .. 255]
|
|
1616
1610
|
* @type Number
|
|
1617
1611
|
* @name b
|
|
1618
1612
|
* @readonly
|
|
@@ -1627,7 +1621,7 @@ export class Color {
|
|
|
1627
1621
|
*/
|
|
1628
1622
|
set alpha(arg: number);
|
|
1629
1623
|
/**
|
|
1630
|
-
* Color Alpha Component
|
|
1624
|
+
* Color Alpha Component [0.0 .. 1.0]
|
|
1631
1625
|
* @type Number
|
|
1632
1626
|
* @name alpha
|
|
1633
1627
|
* @readonly
|
|
@@ -1648,7 +1642,7 @@ export class Color {
|
|
|
1648
1642
|
* @param {Number} [alpha=1.0] alpha value [0.0 .. 1.0]
|
|
1649
1643
|
* @return {me.Color} Reference to this object for method chaining
|
|
1650
1644
|
*/
|
|
1651
|
-
setColor(r: number, g: number, b: number, alpha?: number):
|
|
1645
|
+
setColor(r: number, g: number, b: number, alpha?: number): me.Color;
|
|
1652
1646
|
/**
|
|
1653
1647
|
* Create a new copy of this color object.
|
|
1654
1648
|
* @name clone
|
|
@@ -1656,7 +1650,7 @@ export class Color {
|
|
|
1656
1650
|
* @function
|
|
1657
1651
|
* @return {me.Color} Reference to the newly cloned object
|
|
1658
1652
|
*/
|
|
1659
|
-
clone():
|
|
1653
|
+
clone(): me.Color;
|
|
1660
1654
|
/**
|
|
1661
1655
|
* Copy a color object or CSS color into this one.
|
|
1662
1656
|
* @name copy
|
|
@@ -1665,7 +1659,7 @@ export class Color {
|
|
|
1665
1659
|
* @param {me.Color|String} color
|
|
1666
1660
|
* @return {me.Color} Reference to this object for method chaining
|
|
1667
1661
|
*/
|
|
1668
|
-
copy(color:
|
|
1662
|
+
copy(color: me.Color | string): me.Color;
|
|
1669
1663
|
/**
|
|
1670
1664
|
* Blend this color with the given one using addition.
|
|
1671
1665
|
* @name add
|
|
@@ -1674,7 +1668,7 @@ export class Color {
|
|
|
1674
1668
|
* @param {me.Color} color
|
|
1675
1669
|
* @return {me.Color} Reference to this object for method chaining
|
|
1676
1670
|
*/
|
|
1677
|
-
add(color:
|
|
1671
|
+
add(color: me.Color): me.Color;
|
|
1678
1672
|
/**
|
|
1679
1673
|
* Darken this color value by 0..1
|
|
1680
1674
|
* @name darken
|
|
@@ -1683,7 +1677,7 @@ export class Color {
|
|
|
1683
1677
|
* @param {Number} scale
|
|
1684
1678
|
* @return {me.Color} Reference to this object for method chaining
|
|
1685
1679
|
*/
|
|
1686
|
-
darken(scale: number):
|
|
1680
|
+
darken(scale: number): me.Color;
|
|
1687
1681
|
/**
|
|
1688
1682
|
* Linearly interpolate between this color and the given one.
|
|
1689
1683
|
* @name lerp
|
|
@@ -1693,7 +1687,7 @@ export class Color {
|
|
|
1693
1687
|
* @param {Number} alpha with alpha = 0 being this color, and alpha = 1 being the given one.
|
|
1694
1688
|
* @return {me.Color} Reference to this object for method chaining
|
|
1695
1689
|
*/
|
|
1696
|
-
lerp(color:
|
|
1690
|
+
lerp(color: me.Color, alpha: number): me.Color;
|
|
1697
1691
|
/**
|
|
1698
1692
|
* Lighten this color value by 0..1
|
|
1699
1693
|
* @name lighten
|
|
@@ -1702,7 +1696,7 @@ export class Color {
|
|
|
1702
1696
|
* @param {Number} scale
|
|
1703
1697
|
* @return {me.Color} Reference to this object for method chaining
|
|
1704
1698
|
*/
|
|
1705
|
-
lighten(scale: number):
|
|
1699
|
+
lighten(scale: number): me.Color;
|
|
1706
1700
|
/**
|
|
1707
1701
|
* Generate random r,g,b values for this color object
|
|
1708
1702
|
* @name random
|
|
@@ -1712,7 +1706,7 @@ export class Color {
|
|
|
1712
1706
|
* @param {Number} [max=255] maxmium value for the random range
|
|
1713
1707
|
* @return {me.Color} Reference to this object for method chaining
|
|
1714
1708
|
*/
|
|
1715
|
-
random(min?: number, max?: number):
|
|
1709
|
+
random(min?: number, max?: number): me.Color;
|
|
1716
1710
|
/**
|
|
1717
1711
|
* Return true if the r,g,b,a values of this color are equal with the
|
|
1718
1712
|
* given one.
|
|
@@ -1722,7 +1716,7 @@ export class Color {
|
|
|
1722
1716
|
* @param {me.Color} color
|
|
1723
1717
|
* @return {Boolean}
|
|
1724
1718
|
*/
|
|
1725
|
-
equals(color:
|
|
1719
|
+
equals(color: me.Color): boolean;
|
|
1726
1720
|
/**
|
|
1727
1721
|
* Parse a CSS color string and set this color to the corresponding
|
|
1728
1722
|
* r,g,b values
|
|
@@ -1732,7 +1726,7 @@ export class Color {
|
|
|
1732
1726
|
* @param {String} color
|
|
1733
1727
|
* @return {me.Color} Reference to this object for method chaining
|
|
1734
1728
|
*/
|
|
1735
|
-
parseCSS(cssColor: any):
|
|
1729
|
+
parseCSS(cssColor: any): me.Color;
|
|
1736
1730
|
/**
|
|
1737
1731
|
* Parse an RGB or RGBA CSS color string
|
|
1738
1732
|
* @name parseRGB
|
|
@@ -1741,7 +1735,7 @@ export class Color {
|
|
|
1741
1735
|
* @param {String} color
|
|
1742
1736
|
* @return {me.Color} Reference to this object for method chaining
|
|
1743
1737
|
*/
|
|
1744
|
-
parseRGB(rgbColor: any):
|
|
1738
|
+
parseRGB(rgbColor: any): me.Color;
|
|
1745
1739
|
/**
|
|
1746
1740
|
* Parse a Hex color ("#RGB", "#RGBA" or "#RRGGBB", "#RRGGBBAA" format) and set this color to
|
|
1747
1741
|
* the corresponding r,g,b,a values
|
|
@@ -1752,7 +1746,16 @@ export class Color {
|
|
|
1752
1746
|
* @param {boolean} [argb = false] true if format is #ARGB, or #AARRGGBB (as opposed to #RGBA or #RGGBBAA)
|
|
1753
1747
|
* @return {me.Color} Reference to this object for method chaining
|
|
1754
1748
|
*/
|
|
1755
|
-
parseHex(hexColor: any, argb?: boolean):
|
|
1749
|
+
parseHex(hexColor: any, argb?: boolean): me.Color;
|
|
1750
|
+
/**
|
|
1751
|
+
* Pack this color into a Uint32 ARGB representation
|
|
1752
|
+
* @name toUint32
|
|
1753
|
+
* @memberOf me.Color
|
|
1754
|
+
* @function
|
|
1755
|
+
* @param {Number} [alpha=1.0] alpha value [0.0 .. 1.0]
|
|
1756
|
+
* @return {Uint32}
|
|
1757
|
+
*/
|
|
1758
|
+
toUint32(alpha?: number): Uint32;
|
|
1756
1759
|
/**
|
|
1757
1760
|
* return an array representation of this object
|
|
1758
1761
|
* @name toArray
|
|
@@ -1817,7 +1820,7 @@ export class ColorLayer {
|
|
|
1817
1820
|
* @name color
|
|
1818
1821
|
* @memberOf me.ColorLayer#
|
|
1819
1822
|
*/
|
|
1820
|
-
public color:
|
|
1823
|
+
public color: me.Color;
|
|
1821
1824
|
onResetEvent(name: any, color: any, z?: number): void;
|
|
1822
1825
|
name: any;
|
|
1823
1826
|
floating: boolean;
|
|
@@ -1833,6 +1836,7 @@ export class ColorLayer {
|
|
|
1833
1836
|
destroy(): void;
|
|
1834
1837
|
}
|
|
1835
1838
|
/**
|
|
1839
|
+
* @classdesc
|
|
1836
1840
|
* me.Container represents a collection of child objects
|
|
1837
1841
|
* @class Container
|
|
1838
1842
|
* @extends me.Renderable
|
|
@@ -1952,7 +1956,7 @@ export class Container {
|
|
|
1952
1956
|
* @param {number} [z] forces the z index of the child to the specified value
|
|
1953
1957
|
* @return {me.Renderable} the added child
|
|
1954
1958
|
*/
|
|
1955
|
-
addChild(child:
|
|
1959
|
+
addChild(child: me.Renderable, z?: number): me.Renderable;
|
|
1956
1960
|
/**
|
|
1957
1961
|
* Add a child to the container at the specified index<br>
|
|
1958
1962
|
* (the list won't be sorted after insertion)
|
|
@@ -1963,7 +1967,7 @@ export class Container {
|
|
|
1963
1967
|
* @param {Number} index
|
|
1964
1968
|
* @return {me.Renderable} the added child
|
|
1965
1969
|
*/
|
|
1966
|
-
addChildAt(child:
|
|
1970
|
+
addChildAt(child: me.Renderable, index: number): me.Renderable;
|
|
1967
1971
|
/**
|
|
1968
1972
|
* The forEach() method executes a provided function once per child element. <br>
|
|
1969
1973
|
* the callback function is invoked with three arguments: <br>
|
|
@@ -1994,7 +1998,7 @@ export class Container {
|
|
|
1994
1998
|
* @param {me.Renderable} child
|
|
1995
1999
|
* @param {me.Renderable} child2
|
|
1996
2000
|
*/
|
|
1997
|
-
swapChildren(child:
|
|
2001
|
+
swapChildren(child: me.Renderable, child2: me.Renderable): void;
|
|
1998
2002
|
/**
|
|
1999
2003
|
* Returns the Child at the specified index
|
|
2000
2004
|
* @name getChildAt
|
|
@@ -2002,7 +2006,7 @@ export class Container {
|
|
|
2002
2006
|
* @function
|
|
2003
2007
|
* @param {Number} index
|
|
2004
2008
|
*/
|
|
2005
|
-
getChildAt(index: number):
|
|
2009
|
+
getChildAt(index: number): me.Renderable;
|
|
2006
2010
|
/**
|
|
2007
2011
|
* Returns the index of the given Child
|
|
2008
2012
|
* @name getChildIndex
|
|
@@ -2010,7 +2014,7 @@ export class Container {
|
|
|
2010
2014
|
* @function
|
|
2011
2015
|
* @param {me.Renderable} child
|
|
2012
2016
|
*/
|
|
2013
|
-
getChildIndex(child:
|
|
2017
|
+
getChildIndex(child: me.Renderable): number;
|
|
2014
2018
|
/**
|
|
2015
2019
|
* Returns the next child within the container or undefined if none
|
|
2016
2020
|
* @name getNextChild
|
|
@@ -2018,7 +2022,7 @@ export class Container {
|
|
|
2018
2022
|
* @function
|
|
2019
2023
|
* @param {me.Renderable} child
|
|
2020
2024
|
*/
|
|
2021
|
-
getNextChild(child:
|
|
2025
|
+
getNextChild(child: me.Renderable): any;
|
|
2022
2026
|
/**
|
|
2023
2027
|
* Returns true if contains the specified Child
|
|
2024
2028
|
* @name hasChild
|
|
@@ -2027,7 +2031,7 @@ export class Container {
|
|
|
2027
2031
|
* @param {me.Renderable} child
|
|
2028
2032
|
* @return {Boolean}
|
|
2029
2033
|
*/
|
|
2030
|
-
hasChild(child:
|
|
2034
|
+
hasChild(child: me.Renderable): boolean;
|
|
2031
2035
|
/**
|
|
2032
2036
|
* return the child corresponding to the given property and value.<br>
|
|
2033
2037
|
* note : avoid calling this function every frame since
|
|
@@ -2054,7 +2058,7 @@ export class Container {
|
|
|
2054
2058
|
* var zIndex10 = me.game.world.getChildByProp("z", 10);
|
|
2055
2059
|
* var inViewport = me.game.world.getChildByProp("inViewport", true);
|
|
2056
2060
|
*/
|
|
2057
|
-
public getChildByProp(prop: string, value: string | RegExp | number | boolean):
|
|
2061
|
+
public getChildByProp(prop: string, value: string | RegExp | number | boolean): me.Renderable[];
|
|
2058
2062
|
/**
|
|
2059
2063
|
* returns the list of childs with the specified class type
|
|
2060
2064
|
* @name getChildByType
|
|
@@ -2064,7 +2068,7 @@ export class Container {
|
|
|
2064
2068
|
* @param {Object} class type
|
|
2065
2069
|
* @return {me.Renderable[]} Array of children
|
|
2066
2070
|
*/
|
|
2067
|
-
public getChildByType(_class: any):
|
|
2071
|
+
public getChildByType(_class: any): me.Renderable[];
|
|
2068
2072
|
/**
|
|
2069
2073
|
* returns the list of childs with the specified name<br>
|
|
2070
2074
|
* as defined in Tiled (Name field of the Object Properties)<br>
|
|
@@ -2077,7 +2081,7 @@ export class Container {
|
|
|
2077
2081
|
* @param {String|RegExp|Number|Boolean} name child name
|
|
2078
2082
|
* @return {me.Renderable[]} Array of children
|
|
2079
2083
|
*/
|
|
2080
|
-
public getChildByName(name: string | RegExp | number | boolean):
|
|
2084
|
+
public getChildByName(name: string | RegExp | number | boolean): me.Renderable[];
|
|
2081
2085
|
/**
|
|
2082
2086
|
* return the child corresponding to the specified GUID<br>
|
|
2083
2087
|
* note : avoid calling this function every frame since
|
|
@@ -2089,7 +2093,7 @@ export class Container {
|
|
|
2089
2093
|
* @param {String|RegExp|Number|Boolean} GUID child GUID
|
|
2090
2094
|
* @return {me.Renderable} corresponding child or null
|
|
2091
2095
|
*/
|
|
2092
|
-
public getChildByGUID(guid: any):
|
|
2096
|
+
public getChildByGUID(guid: any): me.Renderable;
|
|
2093
2097
|
/**
|
|
2094
2098
|
* return all child in this container
|
|
2095
2099
|
|
|
@@ -2099,7 +2103,7 @@ export class Container {
|
|
|
2099
2103
|
* @function
|
|
2100
2104
|
* @return {me.Renderable[]} an array of renderable object
|
|
2101
2105
|
*/
|
|
2102
|
-
public getChildren():
|
|
2106
|
+
public getChildren(): me.Renderable[];
|
|
2103
2107
|
/**
|
|
2104
2108
|
* update the bounding box for this shape.
|
|
2105
2109
|
* @ignore
|
|
@@ -2108,7 +2112,7 @@ export class Container {
|
|
|
2108
2112
|
* @function
|
|
2109
2113
|
* @return {me.Bounds} this shape bounding box Rectangle object
|
|
2110
2114
|
*/
|
|
2111
|
-
updateBounds(forceUpdateChildBounds?: boolean):
|
|
2115
|
+
updateBounds(forceUpdateChildBounds?: boolean): me.Bounds;
|
|
2112
2116
|
/**
|
|
2113
2117
|
* Checks if this container is root or if it's attached to the root container.
|
|
2114
2118
|
* @private
|
|
@@ -2139,7 +2143,7 @@ export class Container {
|
|
|
2139
2143
|
* @param {me.Renderable} child
|
|
2140
2144
|
* @param {Boolean} [keepalive=False] True to prevent calling child.destroy()
|
|
2141
2145
|
*/
|
|
2142
|
-
public removeChild(child:
|
|
2146
|
+
public removeChild(child: me.Renderable, keepalive?: boolean): void;
|
|
2143
2147
|
/**
|
|
2144
2148
|
* Removes (and optionally destroys) a child from the container.<br>
|
|
2145
2149
|
* (removal is immediate and unconditional)<br>
|
|
@@ -2150,7 +2154,7 @@ export class Container {
|
|
|
2150
2154
|
* @param {me.Renderable} child
|
|
2151
2155
|
* @param {Boolean} [keepalive=False] True to prevent calling child.destroy()
|
|
2152
2156
|
*/
|
|
2153
|
-
removeChildNow(child:
|
|
2157
|
+
removeChildNow(child: me.Renderable, keepalive?: boolean): void;
|
|
2154
2158
|
/**
|
|
2155
2159
|
* Automatically set the specified property of all childs to the given value
|
|
2156
2160
|
* @name setChildsProperty
|
|
@@ -2168,7 +2172,7 @@ export class Container {
|
|
|
2168
2172
|
* @function
|
|
2169
2173
|
* @param {me.Renderable} child
|
|
2170
2174
|
*/
|
|
2171
|
-
moveUp(child:
|
|
2175
|
+
moveUp(child: me.Renderable): void;
|
|
2172
2176
|
/**
|
|
2173
2177
|
* Move the child in the group one step backward (z depth).
|
|
2174
2178
|
* @name moveDown
|
|
@@ -2176,7 +2180,7 @@ export class Container {
|
|
|
2176
2180
|
* @function
|
|
2177
2181
|
* @param {me.Renderable} child
|
|
2178
2182
|
*/
|
|
2179
|
-
moveDown(child:
|
|
2183
|
+
moveDown(child: me.Renderable): void;
|
|
2180
2184
|
/**
|
|
2181
2185
|
* Move the specified child to the top(z depth).
|
|
2182
2186
|
* @name moveToTop
|
|
@@ -2184,7 +2188,7 @@ export class Container {
|
|
|
2184
2188
|
* @function
|
|
2185
2189
|
* @param {me.Renderable} child
|
|
2186
2190
|
*/
|
|
2187
|
-
moveToTop(child:
|
|
2191
|
+
moveToTop(child: me.Renderable): void;
|
|
2188
2192
|
/**
|
|
2189
2193
|
* Move the specified child the bottom (z depth).
|
|
2190
2194
|
* @name moveToBottom
|
|
@@ -2192,7 +2196,7 @@ export class Container {
|
|
|
2192
2196
|
* @function
|
|
2193
2197
|
* @param {me.Renderable} child
|
|
2194
2198
|
*/
|
|
2195
|
-
moveToBottom(child:
|
|
2199
|
+
moveToBottom(child: me.Renderable): void;
|
|
2196
2200
|
/**
|
|
2197
2201
|
* Manually trigger the sort of all the childs in the container</p>
|
|
2198
2202
|
* @name sort
|
|
@@ -2381,7 +2385,7 @@ export class DroptargetEntity {
|
|
|
2381
2385
|
* @function
|
|
2382
2386
|
* @param {Constant} checkMethod the checkmethod (defaults to CHECKMETHOD_OVERLAP)
|
|
2383
2387
|
*/
|
|
2384
|
-
setCheckMethod(checkMethod:
|
|
2388
|
+
setCheckMethod(checkMethod: Constant): void;
|
|
2385
2389
|
/**
|
|
2386
2390
|
* Checks if a dropped entity is dropped on the current entity
|
|
2387
2391
|
* @name checkOnMe
|
|
@@ -2427,7 +2431,7 @@ export class Ellipse {
|
|
|
2427
2431
|
* @name pos
|
|
2428
2432
|
* @memberOf me.Ellipse#
|
|
2429
2433
|
*/
|
|
2430
|
-
public pos:
|
|
2434
|
+
public pos: me.Vector2d;
|
|
2431
2435
|
/**
|
|
2432
2436
|
* The bounding rectangle for this shape
|
|
2433
2437
|
* @private
|
|
@@ -2451,7 +2455,7 @@ export class Ellipse {
|
|
|
2451
2455
|
* @name radiusV
|
|
2452
2456
|
* @memberOf me.Ellipse#
|
|
2453
2457
|
*/
|
|
2454
|
-
public radiusV:
|
|
2458
|
+
public radiusV: me.Vector2d;
|
|
2455
2459
|
/**
|
|
2456
2460
|
* Radius squared, for pythagorean theorom
|
|
2457
2461
|
* @public
|
|
@@ -2459,7 +2463,7 @@ export class Ellipse {
|
|
|
2459
2463
|
* @name radiusSq
|
|
2460
2464
|
* @memberOf me.Ellipse#
|
|
2461
2465
|
*/
|
|
2462
|
-
public radiusSq:
|
|
2466
|
+
public radiusSq: me.Vector2d;
|
|
2463
2467
|
/**
|
|
2464
2468
|
* x/y scaling ratio for ellipse
|
|
2465
2469
|
* @public
|
|
@@ -2467,7 +2471,7 @@ export class Ellipse {
|
|
|
2467
2471
|
* @name ratio
|
|
2468
2472
|
* @memberOf me.Ellipse#
|
|
2469
2473
|
*/
|
|
2470
|
-
public ratio:
|
|
2474
|
+
public ratio: me.Vector2d;
|
|
2471
2475
|
shapeType: string;
|
|
2472
2476
|
/** @ignore */
|
|
2473
2477
|
onResetEvent(x: any, y: any, w: any, h: any): void;
|
|
@@ -2491,7 +2495,7 @@ export class Ellipse {
|
|
|
2491
2495
|
* @param {me.Vector2d|me.ObservableVector2d} [v] an optional point to rotate around
|
|
2492
2496
|
* @return {me.Ellipse} Reference to this object for method chaining
|
|
2493
2497
|
*/
|
|
2494
|
-
rotate(angle: number, v?:
|
|
2498
|
+
rotate(angle: number, v?: me.Vector2d | me.ObservableVector2d): me.Ellipse;
|
|
2495
2499
|
/**
|
|
2496
2500
|
* Scale this Ellipse by the specified scalar.
|
|
2497
2501
|
* @name scale
|
|
@@ -2501,7 +2505,7 @@ export class Ellipse {
|
|
|
2501
2505
|
* @param {Number} [y=x]
|
|
2502
2506
|
* @return {me.Ellipse} Reference to this object for method chaining
|
|
2503
2507
|
*/
|
|
2504
|
-
scale(x: number, y?: number):
|
|
2508
|
+
scale(x: number, y?: number): me.Ellipse;
|
|
2505
2509
|
/**
|
|
2506
2510
|
* Scale this Ellipse by the specified vector.
|
|
2507
2511
|
* @name scale
|
|
@@ -2510,7 +2514,7 @@ export class Ellipse {
|
|
|
2510
2514
|
* @param {me.Vector2d} v
|
|
2511
2515
|
* @return {me.Ellipse} Reference to this object for method chaining
|
|
2512
2516
|
*/
|
|
2513
|
-
scaleV(v:
|
|
2517
|
+
scaleV(v: me.Vector2d): me.Ellipse;
|
|
2514
2518
|
/**
|
|
2515
2519
|
* apply the given transformation matrix to this ellipse
|
|
2516
2520
|
* @name transform
|
|
@@ -2519,7 +2523,7 @@ export class Ellipse {
|
|
|
2519
2523
|
* @param {me.Matrix2d} matrix the transformation matrix
|
|
2520
2524
|
* @return {me.Polygon} Reference to this object for method chaining
|
|
2521
2525
|
*/
|
|
2522
|
-
transform():
|
|
2526
|
+
transform(): me.Polygon;
|
|
2523
2527
|
/**
|
|
2524
2528
|
* translate the circle/ellipse by the specified offset
|
|
2525
2529
|
* @name translate
|
|
@@ -2537,7 +2541,7 @@ export class Ellipse {
|
|
|
2537
2541
|
* @param {me.Vector2d} v vector offset
|
|
2538
2542
|
* @return {me.Ellipse} this ellipse
|
|
2539
2543
|
*/
|
|
2540
|
-
translate(...args: any[]):
|
|
2544
|
+
translate(...args: any[]): me.Ellipse;
|
|
2541
2545
|
/**
|
|
2542
2546
|
* check if this circle/ellipse contains the specified point
|
|
2543
2547
|
* @name contains
|
|
@@ -2563,7 +2567,7 @@ export class Ellipse {
|
|
|
2563
2567
|
* @function
|
|
2564
2568
|
* @return {me.Bounds} this shape bounding box Rectangle object
|
|
2565
2569
|
*/
|
|
2566
|
-
getBounds():
|
|
2570
|
+
getBounds(): me.Bounds;
|
|
2567
2571
|
/**
|
|
2568
2572
|
* clone this Ellipse
|
|
2569
2573
|
* @name clone
|
|
@@ -2571,7 +2575,7 @@ export class Ellipse {
|
|
|
2571
2575
|
* @function
|
|
2572
2576
|
* @return {me.Ellipse} new Ellipse
|
|
2573
2577
|
*/
|
|
2574
|
-
clone():
|
|
2578
|
+
clone(): me.Ellipse;
|
|
2575
2579
|
}
|
|
2576
2580
|
/**
|
|
2577
2581
|
* a Generic Object Entity
|
|
@@ -2671,7 +2675,7 @@ export class Entity {
|
|
|
2671
2675
|
* @param {me.CanvasRenderer|me.WebGLRenderer} renderer a renderer object
|
|
2672
2676
|
* @param {me.Rect} region to draw
|
|
2673
2677
|
**/
|
|
2674
|
-
protected draw(renderer:
|
|
2678
|
+
protected draw(renderer: me.CanvasRenderer | me.WebGLRenderer, rect: any): void;
|
|
2675
2679
|
/**
|
|
2676
2680
|
* Destroy function<br>
|
|
2677
2681
|
* @ignore
|
|
@@ -3012,7 +3016,7 @@ export class ImageLayer {
|
|
|
3012
3016
|
* @default <1.0,1.0>
|
|
3013
3017
|
* @name me.ImageLayer#ratio
|
|
3014
3018
|
*/
|
|
3015
|
-
public ratio:
|
|
3019
|
+
public ratio: me.Vector2d;
|
|
3016
3020
|
/**
|
|
3017
3021
|
* @ignore
|
|
3018
3022
|
*/
|
|
@@ -3060,6 +3064,7 @@ export class ImageLayer {
|
|
|
3060
3064
|
* @function
|
|
3061
3065
|
*/
|
|
3062
3066
|
updateLayer(vpos: any): void;
|
|
3067
|
+
isDirty: boolean;
|
|
3063
3068
|
preDraw(renderer: any): void;
|
|
3064
3069
|
/**
|
|
3065
3070
|
* draw the image layer
|
|
@@ -3118,7 +3123,7 @@ export class Line {
|
|
|
3118
3123
|
* @function
|
|
3119
3124
|
* @return {me.Line} new Line
|
|
3120
3125
|
*/
|
|
3121
|
-
clone():
|
|
3126
|
+
clone(): me.Line;
|
|
3122
3127
|
}
|
|
3123
3128
|
declare var math: Readonly<{
|
|
3124
3129
|
__proto__: any;
|
|
@@ -3185,7 +3190,7 @@ export class Matrix2d {
|
|
|
3185
3190
|
* @function
|
|
3186
3191
|
* @return {me.Matrix2d} Reference to this object for method chaining
|
|
3187
3192
|
*/
|
|
3188
|
-
identity():
|
|
3193
|
+
identity(): me.Matrix2d;
|
|
3189
3194
|
/**
|
|
3190
3195
|
* set the matrix to the specified value
|
|
3191
3196
|
* @name setTransform
|
|
@@ -3202,7 +3207,7 @@ export class Matrix2d {
|
|
|
3202
3207
|
* @param {Number} [i=1]
|
|
3203
3208
|
* @return {me.Matrix2d} Reference to this object for method chaining
|
|
3204
3209
|
*/
|
|
3205
|
-
setTransform(...args: any[]):
|
|
3210
|
+
setTransform(...args: any[]): me.Matrix2d;
|
|
3206
3211
|
/**
|
|
3207
3212
|
* Copies over the values from another me.Matrix2d.
|
|
3208
3213
|
* @name copy
|
|
@@ -3211,7 +3216,7 @@ export class Matrix2d {
|
|
|
3211
3216
|
* @param {me.Matrix2d} m the matrix object to copy from
|
|
3212
3217
|
* @return {me.Matrix2d} Reference to this object for method chaining
|
|
3213
3218
|
*/
|
|
3214
|
-
copy(b: any):
|
|
3219
|
+
copy(b: any): me.Matrix2d;
|
|
3215
3220
|
/**
|
|
3216
3221
|
* Copies over the upper-left 3x3 values from the given me.Matrix3d
|
|
3217
3222
|
* @name fromMat3d
|
|
@@ -3220,7 +3225,7 @@ export class Matrix2d {
|
|
|
3220
3225
|
* @param {me.Matrix3d} m the matrix object to copy from
|
|
3221
3226
|
* @return {me.Matrix2d} Reference to this object for method chaining
|
|
3222
3227
|
*/
|
|
3223
|
-
fromMat3d(m:
|
|
3228
|
+
fromMat3d(m: me.Matrix3d): me.Matrix2d;
|
|
3224
3229
|
/**
|
|
3225
3230
|
* multiply both matrix
|
|
3226
3231
|
* @name multiply
|
|
@@ -3229,7 +3234,7 @@ export class Matrix2d {
|
|
|
3229
3234
|
* @param {me.Matrix2d} m the other matrix
|
|
3230
3235
|
* @return {me.Matrix2d} Reference to this object for method chaining
|
|
3231
3236
|
*/
|
|
3232
|
-
multiply(m:
|
|
3237
|
+
multiply(m: me.Matrix2d): me.Matrix2d;
|
|
3233
3238
|
/**
|
|
3234
3239
|
* Transpose the value of this matrix.
|
|
3235
3240
|
* @name transpose
|
|
@@ -3237,7 +3242,7 @@ export class Matrix2d {
|
|
|
3237
3242
|
* @function
|
|
3238
3243
|
* @return {me.Matrix2d} Reference to this object for method chaining
|
|
3239
3244
|
*/
|
|
3240
|
-
transpose():
|
|
3245
|
+
transpose(): me.Matrix2d;
|
|
3241
3246
|
/**
|
|
3242
3247
|
* invert this matrix, causing it to apply the opposite transformation.
|
|
3243
3248
|
* @name invert
|
|
@@ -3245,7 +3250,7 @@ export class Matrix2d {
|
|
|
3245
3250
|
* @function
|
|
3246
3251
|
* @return {me.Matrix2d} Reference to this object for method chaining
|
|
3247
3252
|
*/
|
|
3248
|
-
invert():
|
|
3253
|
+
invert(): me.Matrix2d;
|
|
3249
3254
|
/**
|
|
3250
3255
|
* apply the current transform to the given 2d vector
|
|
3251
3256
|
* @name apply
|
|
@@ -3254,7 +3259,7 @@ export class Matrix2d {
|
|
|
3254
3259
|
* @param {me.Vector2d} vector the vector object to be transformed
|
|
3255
3260
|
* @return {me.Vector2d} result vector object.
|
|
3256
3261
|
*/
|
|
3257
|
-
apply(v: any):
|
|
3262
|
+
apply(v: any): me.Vector2d;
|
|
3258
3263
|
/**
|
|
3259
3264
|
* apply the inverted current transform to the given 2d vector
|
|
3260
3265
|
* @name applyInverse
|
|
@@ -3263,7 +3268,7 @@ export class Matrix2d {
|
|
|
3263
3268
|
* @param {me.Vector2d} vector the vector object to be transformed
|
|
3264
3269
|
* @return {me.Vector2d} result vector object.
|
|
3265
3270
|
*/
|
|
3266
|
-
applyInverse(v: any):
|
|
3271
|
+
applyInverse(v: any): me.Vector2d;
|
|
3267
3272
|
/**
|
|
3268
3273
|
* scale the matrix
|
|
3269
3274
|
* @name scale
|
|
@@ -3273,7 +3278,7 @@ export class Matrix2d {
|
|
|
3273
3278
|
* @param {Number} [y=x] a number representing the ordinate of the scaling vector.
|
|
3274
3279
|
* @return {me.Matrix2d} Reference to this object for method chaining
|
|
3275
3280
|
*/
|
|
3276
|
-
scale(x: number, y?: number):
|
|
3281
|
+
scale(x: number, y?: number): me.Matrix2d;
|
|
3277
3282
|
/**
|
|
3278
3283
|
* adds a 2D scaling transformation.
|
|
3279
3284
|
* @name scaleV
|
|
@@ -3282,7 +3287,7 @@ export class Matrix2d {
|
|
|
3282
3287
|
* @param {me.Vector2d} vector scaling vector
|
|
3283
3288
|
* @return {me.Matrix2d} Reference to this object for method chaining
|
|
3284
3289
|
*/
|
|
3285
|
-
scaleV(v: any):
|
|
3290
|
+
scaleV(v: any): me.Matrix2d;
|
|
3286
3291
|
/**
|
|
3287
3292
|
* specifies a 2D scale operation using the [sx, 1] scaling vector
|
|
3288
3293
|
* @name scaleX
|
|
@@ -3291,7 +3296,7 @@ export class Matrix2d {
|
|
|
3291
3296
|
* @param {Number} x x scaling vector
|
|
3292
3297
|
* @return {me.Matrix2d} Reference to this object for method chaining
|
|
3293
3298
|
*/
|
|
3294
|
-
scaleX(x: number):
|
|
3299
|
+
scaleX(x: number): me.Matrix2d;
|
|
3295
3300
|
/**
|
|
3296
3301
|
* specifies a 2D scale operation using the [1,sy] scaling vector
|
|
3297
3302
|
* @name scaleY
|
|
@@ -3300,7 +3305,7 @@ export class Matrix2d {
|
|
|
3300
3305
|
* @param {Number} y y scaling vector
|
|
3301
3306
|
* @return {me.Matrix2d} Reference to this object for method chaining
|
|
3302
3307
|
*/
|
|
3303
|
-
scaleY(y: number):
|
|
3308
|
+
scaleY(y: number): me.Matrix2d;
|
|
3304
3309
|
/**
|
|
3305
3310
|
* rotate the matrix (counter-clockwise) by the specified angle (in radians).
|
|
3306
3311
|
* @name rotate
|
|
@@ -3309,7 +3314,7 @@ export class Matrix2d {
|
|
|
3309
3314
|
* @param {Number} angle Rotation angle in radians.
|
|
3310
3315
|
* @return {me.Matrix2d} Reference to this object for method chaining
|
|
3311
3316
|
*/
|
|
3312
|
-
rotate(angle: number):
|
|
3317
|
+
rotate(angle: number): me.Matrix2d;
|
|
3313
3318
|
/**
|
|
3314
3319
|
* translate the matrix position on the horizontal and vertical axis
|
|
3315
3320
|
* @name translate
|
|
@@ -3327,7 +3332,7 @@ export class Matrix2d {
|
|
|
3327
3332
|
* @param {me.Vector2d} v the vector to translate the matrix by
|
|
3328
3333
|
* @return {me.Matrix2d} Reference to this object for method chaining
|
|
3329
3334
|
*/
|
|
3330
|
-
translate(...args: any[]):
|
|
3335
|
+
translate(...args: any[]): me.Matrix2d;
|
|
3331
3336
|
/**
|
|
3332
3337
|
* returns true if the matrix is an identity matrix.
|
|
3333
3338
|
* @name isIdentity
|
|
@@ -3344,7 +3349,7 @@ export class Matrix2d {
|
|
|
3344
3349
|
* @param {me.Matrix2d} m the other matrix
|
|
3345
3350
|
* @return {Boolean} true if both are equals
|
|
3346
3351
|
*/
|
|
3347
|
-
equals(m:
|
|
3352
|
+
equals(m: me.Matrix2d): boolean;
|
|
3348
3353
|
/**
|
|
3349
3354
|
* Clone the Matrix
|
|
3350
3355
|
* @name clone
|
|
@@ -3352,7 +3357,7 @@ export class Matrix2d {
|
|
|
3352
3357
|
* @function
|
|
3353
3358
|
* @return {me.Matrix2d}
|
|
3354
3359
|
*/
|
|
3355
|
-
clone():
|
|
3360
|
+
clone(): me.Matrix2d;
|
|
3356
3361
|
/**
|
|
3357
3362
|
* return an array representation of this Matrix
|
|
3358
3363
|
* @name toArray
|
|
@@ -3422,7 +3427,7 @@ export class Matrix3d {
|
|
|
3422
3427
|
* @function
|
|
3423
3428
|
* @return {me.Matrix3d} Reference to this object for method chaining
|
|
3424
3429
|
*/
|
|
3425
|
-
identity():
|
|
3430
|
+
identity(): me.Matrix3d;
|
|
3426
3431
|
/**
|
|
3427
3432
|
* set the matrix to the specified value
|
|
3428
3433
|
* @name setTransform
|
|
@@ -3446,7 +3451,7 @@ export class Matrix3d {
|
|
|
3446
3451
|
* @param {Number} m33
|
|
3447
3452
|
* @return {me.Matrix3d} Reference to this object for method chaining
|
|
3448
3453
|
*/
|
|
3449
|
-
setTransform(m00: number, m01: number, m02: number, m03: number, m10: number, m11: number, m12: number, m13: number, m20: number, m21: number, m22: number, m23: number, m30: number, m31: number, m32: number, m33: number):
|
|
3454
|
+
setTransform(m00: number, m01: number, m02: number, m03: number, m10: number, m11: number, m12: number, m13: number, m20: number, m21: number, m22: number, m23: number, m30: number, m31: number, m32: number, m33: number): me.Matrix3d;
|
|
3450
3455
|
/**
|
|
3451
3456
|
* Copies over the values from another me.Matrix3d.
|
|
3452
3457
|
* @name copy
|
|
@@ -3455,7 +3460,7 @@ export class Matrix3d {
|
|
|
3455
3460
|
* @param {me.Matrix3d} m the matrix object to copy from
|
|
3456
3461
|
* @return {me.Matrix3d} Reference to this object for method chaining
|
|
3457
3462
|
*/
|
|
3458
|
-
copy(b: any):
|
|
3463
|
+
copy(b: any): me.Matrix3d;
|
|
3459
3464
|
/**
|
|
3460
3465
|
* Copies over the upper-left 2x2 values from the given me.Matrix2d
|
|
3461
3466
|
* @name fromMat2d
|
|
@@ -3464,7 +3469,7 @@ export class Matrix3d {
|
|
|
3464
3469
|
* @param {me.Matrix2d} m the matrix object to copy from
|
|
3465
3470
|
* @return {me.Matrix2d} Reference to this object for method chaining
|
|
3466
3471
|
*/
|
|
3467
|
-
fromMat2d(m:
|
|
3472
|
+
fromMat2d(m: me.Matrix2d): me.Matrix2d;
|
|
3468
3473
|
/**
|
|
3469
3474
|
* multiply both matrix
|
|
3470
3475
|
* @name multiply
|
|
@@ -3473,7 +3478,7 @@ export class Matrix3d {
|
|
|
3473
3478
|
* @param {me.Matrix3d} m Other matrix
|
|
3474
3479
|
* @return {me.Matrix3d} Reference to this object for method chaining
|
|
3475
3480
|
*/
|
|
3476
|
-
multiply(m:
|
|
3481
|
+
multiply(m: me.Matrix3d): me.Matrix3d;
|
|
3477
3482
|
/**
|
|
3478
3483
|
* Transpose the value of this matrix.
|
|
3479
3484
|
* @name transpose
|
|
@@ -3481,7 +3486,7 @@ export class Matrix3d {
|
|
|
3481
3486
|
* @function
|
|
3482
3487
|
* @return {me.Matrix3d} Reference to this object for method chaining
|
|
3483
3488
|
*/
|
|
3484
|
-
transpose():
|
|
3489
|
+
transpose(): me.Matrix3d;
|
|
3485
3490
|
/**
|
|
3486
3491
|
* invert this matrix, causing it to apply the opposite transformation.
|
|
3487
3492
|
* @name invert
|
|
@@ -3489,7 +3494,7 @@ export class Matrix3d {
|
|
|
3489
3494
|
* @function
|
|
3490
3495
|
* @return {me.Matrix3d} Reference to this object for method chaining
|
|
3491
3496
|
*/
|
|
3492
|
-
invert():
|
|
3497
|
+
invert(): me.Matrix3d;
|
|
3493
3498
|
/**
|
|
3494
3499
|
* apply the current transform to the given 2d or 3d vector
|
|
3495
3500
|
* @name apply
|
|
@@ -3498,7 +3503,7 @@ export class Matrix3d {
|
|
|
3498
3503
|
* @param {me.Vector2d|me.Vector3d} vector the vector object to be transformed
|
|
3499
3504
|
* @return {me.Vector2d|me.Vector3d} result vector object.
|
|
3500
3505
|
*/
|
|
3501
|
-
apply(v: any):
|
|
3506
|
+
apply(v: any): me.Vector2d | me.Vector3d;
|
|
3502
3507
|
/**
|
|
3503
3508
|
* apply the inverted current transform to the given 2d or 3d vector
|
|
3504
3509
|
* @name applyInverse
|
|
@@ -3507,7 +3512,7 @@ export class Matrix3d {
|
|
|
3507
3512
|
* @param {me.Vector2d|me.Vector3d} vector the vector object to be transformed
|
|
3508
3513
|
* @return {me.Vector2d|me.Vector3d} result vector object.
|
|
3509
3514
|
*/
|
|
3510
|
-
applyInverse(v: any):
|
|
3515
|
+
applyInverse(v: any): me.Vector2d | me.Vector3d;
|
|
3511
3516
|
/**
|
|
3512
3517
|
* generate an orthogonal projection matrix, with the result replacing the current matrix
|
|
3513
3518
|
* <img src="images/glOrtho.gif"/><br>
|
|
@@ -3522,7 +3527,7 @@ export class Matrix3d {
|
|
|
3522
3527
|
* @param {Number} far distance to the far clipping plane along the -Z axis
|
|
3523
3528
|
* @return {me.Matrix3d} Reference to this object for method chaining
|
|
3524
3529
|
*/
|
|
3525
|
-
ortho(left: number, right: number, bottom: number, top: number, near: number, far: number):
|
|
3530
|
+
ortho(left: number, right: number, bottom: number, top: number, near: number, far: number): me.Matrix3d;
|
|
3526
3531
|
/**
|
|
3527
3532
|
* scale the matrix
|
|
3528
3533
|
* @name scale
|
|
@@ -3533,7 +3538,7 @@ export class Matrix3d {
|
|
|
3533
3538
|
* @param {Number} [z=0] a number representing the depth vector
|
|
3534
3539
|
* @return {me.Matrix3d} Reference to this object for method chaining
|
|
3535
3540
|
*/
|
|
3536
|
-
scale(x: number, y?: number, z?: number):
|
|
3541
|
+
scale(x: number, y?: number, z?: number): me.Matrix3d;
|
|
3537
3542
|
/**
|
|
3538
3543
|
* adds a 2D scaling transformation.
|
|
3539
3544
|
* @name scaleV
|
|
@@ -3542,7 +3547,7 @@ export class Matrix3d {
|
|
|
3542
3547
|
* @param {me.Vector2d|me.Vector3d} vector scaling vector
|
|
3543
3548
|
* @return {me.Matrix3d} Reference to this object for method chaining
|
|
3544
3549
|
*/
|
|
3545
|
-
scaleV(v: any):
|
|
3550
|
+
scaleV(v: any): me.Matrix3d;
|
|
3546
3551
|
/**
|
|
3547
3552
|
* specifies a 2D scale operation using the [sx, 1] scaling vector
|
|
3548
3553
|
* @name scaleX
|
|
@@ -3551,7 +3556,7 @@ export class Matrix3d {
|
|
|
3551
3556
|
* @param {Number} x x scaling vector
|
|
3552
3557
|
* @return {me.Matrix3d} Reference to this object for method chaining
|
|
3553
3558
|
*/
|
|
3554
|
-
scaleX(x: number):
|
|
3559
|
+
scaleX(x: number): me.Matrix3d;
|
|
3555
3560
|
/**
|
|
3556
3561
|
* specifies a 2D scale operation using the [1,sy] scaling vector
|
|
3557
3562
|
* @name scaleY
|
|
@@ -3560,7 +3565,7 @@ export class Matrix3d {
|
|
|
3560
3565
|
* @param {Number} y y scaling vector
|
|
3561
3566
|
* @return {me.Matrix3d} Reference to this object for method chaining
|
|
3562
3567
|
*/
|
|
3563
|
-
scaleY(y: number):
|
|
3568
|
+
scaleY(y: number): me.Matrix3d;
|
|
3564
3569
|
/**
|
|
3565
3570
|
* rotate this matrix (counter-clockwise) by the specified angle (in radians).
|
|
3566
3571
|
* @name rotate
|
|
@@ -3570,7 +3575,7 @@ export class Matrix3d {
|
|
|
3570
3575
|
* @param {me.Vector3d} axis the axis to rotate around
|
|
3571
3576
|
* @return {me.Matrix3d} Reference to this object for method chaining
|
|
3572
3577
|
*/
|
|
3573
|
-
rotate(angle: number, v: any):
|
|
3578
|
+
rotate(angle: number, v: any): me.Matrix3d;
|
|
3574
3579
|
/**
|
|
3575
3580
|
* translate the matrix position using the given vector
|
|
3576
3581
|
* @name translate
|
|
@@ -3589,7 +3594,7 @@ export class Matrix3d {
|
|
|
3589
3594
|
* @param {me.Vector2d|me.Vector3d} v the vector to translate the matrix by
|
|
3590
3595
|
* @return {me.Matrix3d} Reference to this object for method chaining
|
|
3591
3596
|
*/
|
|
3592
|
-
translate(...args: any[]):
|
|
3597
|
+
translate(...args: any[]): me.Matrix3d;
|
|
3593
3598
|
/**
|
|
3594
3599
|
* returns true if the matrix is an identity matrix.
|
|
3595
3600
|
* @name isIdentity
|
|
@@ -3606,7 +3611,7 @@ export class Matrix3d {
|
|
|
3606
3611
|
* @param {me.Matrix3d} m the other matrix
|
|
3607
3612
|
* @return {Boolean} true if both are equals
|
|
3608
3613
|
*/
|
|
3609
|
-
equals(m:
|
|
3614
|
+
equals(m: me.Matrix3d): boolean;
|
|
3610
3615
|
/**
|
|
3611
3616
|
* Clone the Matrix
|
|
3612
3617
|
* @name clone
|
|
@@ -3614,7 +3619,7 @@ export class Matrix3d {
|
|
|
3614
3619
|
* @function
|
|
3615
3620
|
* @return {me.Matrix3d}
|
|
3616
3621
|
*/
|
|
3617
|
-
clone():
|
|
3622
|
+
clone(): me.Matrix3d;
|
|
3618
3623
|
/**
|
|
3619
3624
|
* return an array representation of this Matrix
|
|
3620
3625
|
* @name toArray
|
|
@@ -3632,6 +3637,50 @@ export class Matrix3d {
|
|
|
3632
3637
|
*/
|
|
3633
3638
|
toString(): string;
|
|
3634
3639
|
}
|
|
3640
|
+
/**
|
|
3641
|
+
* @classdesc
|
|
3642
|
+
* A NineSliceSprite is similar to a Sprite, but it uses 9-slice scaling to strech its inner area to fit the size of the Renderable,
|
|
3643
|
+
* by proportionally scaling a sprite by splitting it in a grid of nine parts (with only parts 1, 3, 7, 9 not being scaled). <br>
|
|
3644
|
+
* <img src="images/9-slice-scaling.png"/><br>
|
|
3645
|
+
* @see https://en.wikipedia.org/wiki/9-slice_scaling
|
|
3646
|
+
* @class NineSliceSprite
|
|
3647
|
+
* @extends me.Sprite
|
|
3648
|
+
* @memberOf me
|
|
3649
|
+
* @constructor
|
|
3650
|
+
* @param {Number} x the x coordinates of the sprite object
|
|
3651
|
+
* @param {Number} y the y coordinates of the sprite object
|
|
3652
|
+
* @param {Object} settings Configuration parameters for the Sprite object
|
|
3653
|
+
* @param {Number} settings.width the width of the Renderable over which the sprite needs to be stretched
|
|
3654
|
+
* @param {Number} settings.height the height of the Renderable over which the sprite needs to be stretched
|
|
3655
|
+
* @param {me.Renderer.Texture|HTMLImageElement|HTMLCanvasElement|String} settings.image reference to a texture, spritesheet image or to a texture atlas
|
|
3656
|
+
* @param {String} [settings.name=""] name of this object
|
|
3657
|
+
* @param {String} [settings.region] region name of a specific region to use when using a texture atlas, see {@link me.Renderer.Texture}
|
|
3658
|
+
* @param {Number} [settings.framewidth] Width of a single frame within the spritesheet
|
|
3659
|
+
* @param {Number} [settings.frameheight] Height of a single frame within the spritesheet
|
|
3660
|
+
* @param {String|me.Color} [settings.tint] a tint to be applied to this sprite
|
|
3661
|
+
* @param {Number} [settings.flipX] flip the sprite on the horizontal axis
|
|
3662
|
+
* @param {Number} [settings.flipY] flip the sprite on the vertical axis
|
|
3663
|
+
* @param {me.Vector2d} [settings.anchorPoint={x:0.5, y:0.5}] Anchor point to draw the frame at (defaults to the center of the frame).
|
|
3664
|
+
* @example
|
|
3665
|
+
* this.panelSprite = new me.NineSliceSprite(0, 0, {
|
|
3666
|
+
* image : game.texture,
|
|
3667
|
+
* region : "grey_panel",
|
|
3668
|
+
* width : this.width,
|
|
3669
|
+
* height : this.height
|
|
3670
|
+
* });
|
|
3671
|
+
*/
|
|
3672
|
+
export class NineSliceSprite {
|
|
3673
|
+
/**
|
|
3674
|
+
* @ignore
|
|
3675
|
+
*/
|
|
3676
|
+
constructor(x: any, y: any, settings: any);
|
|
3677
|
+
width: any;
|
|
3678
|
+
height: any;
|
|
3679
|
+
/**
|
|
3680
|
+
* @ignore
|
|
3681
|
+
*/
|
|
3682
|
+
draw(renderer: any): void;
|
|
3683
|
+
}
|
|
3635
3684
|
/**
|
|
3636
3685
|
* @classdesc
|
|
3637
3686
|
* A Vector2d object that provide notification by executing the given callback when the vector is changed.
|
|
@@ -3694,7 +3743,7 @@ export class ObservableVector2d {
|
|
|
3694
3743
|
* @param {Number} y y value of the vector
|
|
3695
3744
|
* @return {me.ObservableVector2d} Reference to this object for method chaining
|
|
3696
3745
|
*/
|
|
3697
|
-
setMuted(x: number, y: number):
|
|
3746
|
+
setMuted(x: number, y: number): me.ObservableVector2d;
|
|
3698
3747
|
/**
|
|
3699
3748
|
* set the callback to be executed when the vector is changed
|
|
3700
3749
|
* @name setCallback
|
|
@@ -3704,7 +3753,7 @@ export class ObservableVector2d {
|
|
|
3704
3753
|
* @param {function} [scope=null] scope
|
|
3705
3754
|
* @return {me.ObservableVector2d} Reference to this object for method chaining
|
|
3706
3755
|
*/
|
|
3707
|
-
setCallback(fn: any, scope?: Function):
|
|
3756
|
+
setCallback(fn: any, scope?: Function): me.ObservableVector2d;
|
|
3708
3757
|
onUpdate: any;
|
|
3709
3758
|
scope: Function;
|
|
3710
3759
|
/**
|
|
@@ -3715,7 +3764,7 @@ export class ObservableVector2d {
|
|
|
3715
3764
|
* @param {me.ObservableVector2d} v
|
|
3716
3765
|
* @return {me.ObservableVector2d} Reference to this object for method chaining
|
|
3717
3766
|
*/
|
|
3718
|
-
add(v:
|
|
3767
|
+
add(v: me.ObservableVector2d): me.ObservableVector2d;
|
|
3719
3768
|
/**
|
|
3720
3769
|
* Substract the passed vector to this vector
|
|
3721
3770
|
* @name sub
|
|
@@ -3724,7 +3773,7 @@ export class ObservableVector2d {
|
|
|
3724
3773
|
* @param {me.ObservableVector2d} v
|
|
3725
3774
|
* @return {me.ObservableVector2d} Reference to this object for method chaining
|
|
3726
3775
|
*/
|
|
3727
|
-
sub(v:
|
|
3776
|
+
sub(v: me.ObservableVector2d): me.ObservableVector2d;
|
|
3728
3777
|
/**
|
|
3729
3778
|
* Multiply this vector values by the given scalar
|
|
3730
3779
|
* @name scale
|
|
@@ -3734,7 +3783,7 @@ export class ObservableVector2d {
|
|
|
3734
3783
|
* @param {Number} [y=x]
|
|
3735
3784
|
* @return {me.ObservableVector2d} Reference to this object for method chaining
|
|
3736
3785
|
*/
|
|
3737
|
-
scale(x: number, y?: number):
|
|
3786
|
+
scale(x: number, y?: number): me.ObservableVector2d;
|
|
3738
3787
|
/**
|
|
3739
3788
|
* Multiply this vector values by the passed vector
|
|
3740
3789
|
* @name scaleV
|
|
@@ -3743,7 +3792,7 @@ export class ObservableVector2d {
|
|
|
3743
3792
|
* @param {me.ObservableVector2d} v
|
|
3744
3793
|
* @return {me.ObservableVector2d} Reference to this object for method chaining
|
|
3745
3794
|
*/
|
|
3746
|
-
scaleV(v:
|
|
3795
|
+
scaleV(v: me.ObservableVector2d): me.ObservableVector2d;
|
|
3747
3796
|
/**
|
|
3748
3797
|
* Divide this vector values by the passed value
|
|
3749
3798
|
* @name div
|
|
@@ -3752,7 +3801,7 @@ export class ObservableVector2d {
|
|
|
3752
3801
|
* @param {Number} value
|
|
3753
3802
|
* @return {me.ObservableVector2d} Reference to this object for method chaining
|
|
3754
3803
|
*/
|
|
3755
|
-
div(n: any):
|
|
3804
|
+
div(n: any): me.ObservableVector2d;
|
|
3756
3805
|
/**
|
|
3757
3806
|
* Update this vector values to absolute values
|
|
3758
3807
|
* @name abs
|
|
@@ -3760,7 +3809,7 @@ export class ObservableVector2d {
|
|
|
3760
3809
|
* @function
|
|
3761
3810
|
* @return {me.ObservableVector2d} Reference to this object for method chaining
|
|
3762
3811
|
*/
|
|
3763
|
-
abs():
|
|
3812
|
+
abs(): me.ObservableVector2d;
|
|
3764
3813
|
/**
|
|
3765
3814
|
* Clamp the vector value within the specified value range
|
|
3766
3815
|
* @name clamp
|
|
@@ -3770,7 +3819,7 @@ export class ObservableVector2d {
|
|
|
3770
3819
|
* @param {Number} high
|
|
3771
3820
|
* @return {me.ObservableVector2d} new me.ObservableVector2d
|
|
3772
3821
|
*/
|
|
3773
|
-
clamp(low: number, high: number):
|
|
3822
|
+
clamp(low: number, high: number): me.ObservableVector2d;
|
|
3774
3823
|
/**
|
|
3775
3824
|
* Clamp this vector value within the specified value range
|
|
3776
3825
|
* @name clampSelf
|
|
@@ -3780,7 +3829,7 @@ export class ObservableVector2d {
|
|
|
3780
3829
|
* @param {Number} high
|
|
3781
3830
|
* @return {me.ObservableVector2d} Reference to this object for method chaining
|
|
3782
3831
|
*/
|
|
3783
|
-
clampSelf(low: number, high: number):
|
|
3832
|
+
clampSelf(low: number, high: number): me.ObservableVector2d;
|
|
3784
3833
|
/**
|
|
3785
3834
|
* Update this vector with the minimum value between this and the passed vector
|
|
3786
3835
|
* @name minV
|
|
@@ -3789,7 +3838,7 @@ export class ObservableVector2d {
|
|
|
3789
3838
|
* @param {me.ObservableVector2d} v
|
|
3790
3839
|
* @return {me.ObservableVector2d} Reference to this object for method chaining
|
|
3791
3840
|
*/
|
|
3792
|
-
minV(v:
|
|
3841
|
+
minV(v: me.ObservableVector2d): me.ObservableVector2d;
|
|
3793
3842
|
/**
|
|
3794
3843
|
* Update this vector with the maximum value between this and the passed vector
|
|
3795
3844
|
* @name maxV
|
|
@@ -3798,7 +3847,7 @@ export class ObservableVector2d {
|
|
|
3798
3847
|
* @param {me.ObservableVector2d} v
|
|
3799
3848
|
* @return {me.ObservableVector2d} Reference to this object for method chaining
|
|
3800
3849
|
*/
|
|
3801
|
-
maxV(v:
|
|
3850
|
+
maxV(v: me.ObservableVector2d): me.ObservableVector2d;
|
|
3802
3851
|
/**
|
|
3803
3852
|
* Floor the vector values
|
|
3804
3853
|
* @name floor
|
|
@@ -3806,7 +3855,7 @@ export class ObservableVector2d {
|
|
|
3806
3855
|
* @function
|
|
3807
3856
|
* @return {me.ObservableVector2d} new me.ObservableVector2d
|
|
3808
3857
|
*/
|
|
3809
|
-
floor():
|
|
3858
|
+
floor(): me.ObservableVector2d;
|
|
3810
3859
|
/**
|
|
3811
3860
|
* Floor this vector values
|
|
3812
3861
|
* @name floorSelf
|
|
@@ -3814,7 +3863,7 @@ export class ObservableVector2d {
|
|
|
3814
3863
|
* @function
|
|
3815
3864
|
* @return {me.ObservableVector2d} Reference to this object for method chaining
|
|
3816
3865
|
*/
|
|
3817
|
-
floorSelf():
|
|
3866
|
+
floorSelf(): me.ObservableVector2d;
|
|
3818
3867
|
/**
|
|
3819
3868
|
* Ceil the vector values
|
|
3820
3869
|
* @name ceil
|
|
@@ -3822,7 +3871,7 @@ export class ObservableVector2d {
|
|
|
3822
3871
|
* @function
|
|
3823
3872
|
* @return {me.ObservableVector2d} new me.ObservableVector2d
|
|
3824
3873
|
*/
|
|
3825
|
-
ceil():
|
|
3874
|
+
ceil(): me.ObservableVector2d;
|
|
3826
3875
|
/**
|
|
3827
3876
|
* Ceil this vector values
|
|
3828
3877
|
* @name ceilSelf
|
|
@@ -3830,7 +3879,7 @@ export class ObservableVector2d {
|
|
|
3830
3879
|
* @function
|
|
3831
3880
|
* @return {me.ObservableVector2d} Reference to this object for method chaining
|
|
3832
3881
|
*/
|
|
3833
|
-
ceilSelf():
|
|
3882
|
+
ceilSelf(): me.ObservableVector2d;
|
|
3834
3883
|
/**
|
|
3835
3884
|
* Negate the vector values
|
|
3836
3885
|
* @name negate
|
|
@@ -3838,7 +3887,7 @@ export class ObservableVector2d {
|
|
|
3838
3887
|
* @function
|
|
3839
3888
|
* @return {me.ObservableVector2d} new me.ObservableVector2d
|
|
3840
3889
|
*/
|
|
3841
|
-
negate():
|
|
3890
|
+
negate(): me.ObservableVector2d;
|
|
3842
3891
|
/**
|
|
3843
3892
|
* Negate this vector values
|
|
3844
3893
|
* @name negateSelf
|
|
@@ -3846,7 +3895,7 @@ export class ObservableVector2d {
|
|
|
3846
3895
|
* @function
|
|
3847
3896
|
* @return {me.ObservableVector2d} Reference to this object for method chaining
|
|
3848
3897
|
*/
|
|
3849
|
-
negateSelf():
|
|
3898
|
+
negateSelf(): me.ObservableVector2d;
|
|
3850
3899
|
/**
|
|
3851
3900
|
* Copy the x,y values of the passed vector to this one
|
|
3852
3901
|
* @name copy
|
|
@@ -3855,7 +3904,7 @@ export class ObservableVector2d {
|
|
|
3855
3904
|
* @param {me.ObservableVector2d} v
|
|
3856
3905
|
* @return {me.ObservableVector2d} Reference to this object for method chaining
|
|
3857
3906
|
*/
|
|
3858
|
-
copy(v:
|
|
3907
|
+
copy(v: me.ObservableVector2d): me.ObservableVector2d;
|
|
3859
3908
|
/**
|
|
3860
3909
|
* return true if the two vectors are the same
|
|
3861
3910
|
* @name equals
|
|
@@ -3864,7 +3913,7 @@ export class ObservableVector2d {
|
|
|
3864
3913
|
* @param {me.ObservableVector2d} v
|
|
3865
3914
|
* @return {Boolean}
|
|
3866
3915
|
*/
|
|
3867
|
-
equals(v:
|
|
3916
|
+
equals(v: me.ObservableVector2d): boolean;
|
|
3868
3917
|
/**
|
|
3869
3918
|
* change this vector to be perpendicular to what it was before.<br>
|
|
3870
3919
|
* (Effectively rotates it 90 degrees in a clockwise direction)
|
|
@@ -3873,7 +3922,7 @@ export class ObservableVector2d {
|
|
|
3873
3922
|
* @function
|
|
3874
3923
|
* @return {me.ObservableVector2d} Reference to this object for method chaining
|
|
3875
3924
|
*/
|
|
3876
|
-
perp():
|
|
3925
|
+
perp(): me.ObservableVector2d;
|
|
3877
3926
|
/**
|
|
3878
3927
|
* Rotate this vector (counter-clockwise) by the specified angle (in radians).
|
|
3879
3928
|
* @name rotate
|
|
@@ -3883,7 +3932,7 @@ export class ObservableVector2d {
|
|
|
3883
3932
|
* @param {me.Vector2d|me.ObservableVector2d} [v] an optional point to rotate around
|
|
3884
3933
|
* @return {me.ObservableVector2d} Reference to this object for method chaining
|
|
3885
3934
|
*/
|
|
3886
|
-
rotate(angle: number, v?:
|
|
3935
|
+
rotate(angle: number, v?: me.Vector2d | me.ObservableVector2d): me.ObservableVector2d;
|
|
3887
3936
|
/**
|
|
3888
3937
|
* return the dot product of this vector and the passed one
|
|
3889
3938
|
* @name dotProduct
|
|
@@ -3892,7 +3941,7 @@ export class ObservableVector2d {
|
|
|
3892
3941
|
* @param {me.Vector2d|me.ObservableVector2d} v
|
|
3893
3942
|
* @return {Number} The dot product.
|
|
3894
3943
|
*/
|
|
3895
|
-
dotProduct(v:
|
|
3944
|
+
dotProduct(v: me.Vector2d | me.ObservableVector2d): number;
|
|
3896
3945
|
/**
|
|
3897
3946
|
* Linearly interpolate between this vector and the given one.
|
|
3898
3947
|
* @name lerp
|
|
@@ -3902,7 +3951,7 @@ export class ObservableVector2d {
|
|
|
3902
3951
|
* @param {Number} alpha distance along the line (alpha = 0 will be this vector, and alpha = 1 will be the given one).
|
|
3903
3952
|
* @return {me.ObservableVector2d} Reference to this object for method chaining
|
|
3904
3953
|
*/
|
|
3905
|
-
lerp(v:
|
|
3954
|
+
lerp(v: me.Vector2d | me.ObservableVector2d, alpha: number): me.ObservableVector2d;
|
|
3906
3955
|
/**
|
|
3907
3956
|
* return the distance between this vector and the passed one
|
|
3908
3957
|
* @name distance
|
|
@@ -3911,7 +3960,7 @@ export class ObservableVector2d {
|
|
|
3911
3960
|
* @param {me.ObservableVector2d} v
|
|
3912
3961
|
* @return {Number}
|
|
3913
3962
|
*/
|
|
3914
|
-
distance(v:
|
|
3963
|
+
distance(v: me.ObservableVector2d): number;
|
|
3915
3964
|
/**
|
|
3916
3965
|
* return a clone copy of this vector
|
|
3917
3966
|
* @name clone
|
|
@@ -3919,7 +3968,7 @@ export class ObservableVector2d {
|
|
|
3919
3968
|
* @function
|
|
3920
3969
|
* @return {me.ObservableVector2d} new me.ObservableVector2d
|
|
3921
3970
|
*/
|
|
3922
|
-
clone():
|
|
3971
|
+
clone(): me.ObservableVector2d;
|
|
3923
3972
|
/**
|
|
3924
3973
|
* return a `me.Vector2d` copy of this `me.ObservableVector2d` object
|
|
3925
3974
|
* @name toVector2d
|
|
@@ -3927,7 +3976,7 @@ export class ObservableVector2d {
|
|
|
3927
3976
|
* @function
|
|
3928
3977
|
* @return {me.Vector2d} new me.Vector2d
|
|
3929
3978
|
*/
|
|
3930
|
-
toVector2d():
|
|
3979
|
+
toVector2d(): me.Vector2d;
|
|
3931
3980
|
/**
|
|
3932
3981
|
* convert the object to a string representation
|
|
3933
3982
|
* @name toString
|
|
@@ -4018,7 +4067,7 @@ export class ObservableVector3d {
|
|
|
4018
4067
|
* @param {Number} [z=0] z value of the vector
|
|
4019
4068
|
* @return {me.ObservableVector3d} Reference to this object for method chaining
|
|
4020
4069
|
*/
|
|
4021
|
-
setMuted(x: number, y: number, z?: number):
|
|
4070
|
+
setMuted(x: number, y: number, z?: number): me.ObservableVector3d;
|
|
4022
4071
|
/**
|
|
4023
4072
|
* set the callback to be executed when the vector is changed
|
|
4024
4073
|
* @name setCallback
|
|
@@ -4028,7 +4077,7 @@ export class ObservableVector3d {
|
|
|
4028
4077
|
* @param {function} [scope=null] scope
|
|
4029
4078
|
* @return {me.ObservableVector3d} Reference to this object for method chaining
|
|
4030
4079
|
*/
|
|
4031
|
-
setCallback(fn: any, scope?: Function):
|
|
4080
|
+
setCallback(fn: any, scope?: Function): me.ObservableVector3d;
|
|
4032
4081
|
onUpdate: any;
|
|
4033
4082
|
scope: Function;
|
|
4034
4083
|
/**
|
|
@@ -4039,7 +4088,7 @@ export class ObservableVector3d {
|
|
|
4039
4088
|
* @param {me.Vector2d|me.Vector3d|me.ObservableVector2d|me.ObservableVector3d} v
|
|
4040
4089
|
* @return {me.ObservableVector3d} Reference to this object for method chaining
|
|
4041
4090
|
*/
|
|
4042
|
-
add(v:
|
|
4091
|
+
add(v: me.Vector2d | me.Vector3d | me.ObservableVector2d | me.ObservableVector3d): me.ObservableVector3d;
|
|
4043
4092
|
/**
|
|
4044
4093
|
* Substract the passed vector to this vector
|
|
4045
4094
|
* @name sub
|
|
@@ -4048,7 +4097,7 @@ export class ObservableVector3d {
|
|
|
4048
4097
|
* @param {me.Vector2d|me.Vector3d|me.ObservableVector2d|me.ObservableVector3d} v
|
|
4049
4098
|
* @return {me.ObservableVector3d} Reference to this object for method chaining
|
|
4050
4099
|
*/
|
|
4051
|
-
sub(v:
|
|
4100
|
+
sub(v: me.Vector2d | me.Vector3d | me.ObservableVector2d | me.ObservableVector3d): me.ObservableVector3d;
|
|
4052
4101
|
/**
|
|
4053
4102
|
* Multiply this vector values by the given scalar
|
|
4054
4103
|
* @name scale
|
|
@@ -4059,7 +4108,7 @@ export class ObservableVector3d {
|
|
|
4059
4108
|
* @param {Number} [z=1]
|
|
4060
4109
|
* @return {me.ObservableVector3d} Reference to this object for method chaining
|
|
4061
4110
|
*/
|
|
4062
|
-
scale(x: number, y?: number, z?: number):
|
|
4111
|
+
scale(x: number, y?: number, z?: number): me.ObservableVector3d;
|
|
4063
4112
|
/**
|
|
4064
4113
|
* Multiply this vector values by the passed vector
|
|
4065
4114
|
* @name scaleV
|
|
@@ -4068,7 +4117,7 @@ export class ObservableVector3d {
|
|
|
4068
4117
|
* @param {me.Vector2d|me.Vector3d|me.ObservableVector2d|me.ObservableVector3d} v
|
|
4069
4118
|
* @return {me.ObservableVector3d} Reference to this object for method chaining
|
|
4070
4119
|
*/
|
|
4071
|
-
scaleV(v:
|
|
4120
|
+
scaleV(v: me.Vector2d | me.Vector3d | me.ObservableVector2d | me.ObservableVector3d): me.ObservableVector3d;
|
|
4072
4121
|
/**
|
|
4073
4122
|
* Divide this vector values by the passed value
|
|
4074
4123
|
* @name div
|
|
@@ -4077,7 +4126,7 @@ export class ObservableVector3d {
|
|
|
4077
4126
|
* @param {Number} value
|
|
4078
4127
|
* @return {me.ObservableVector3d} Reference to this object for method chaining
|
|
4079
4128
|
*/
|
|
4080
|
-
div(n: any):
|
|
4129
|
+
div(n: any): me.ObservableVector3d;
|
|
4081
4130
|
/**
|
|
4082
4131
|
* Update this vector values to absolute values
|
|
4083
4132
|
* @name abs
|
|
@@ -4085,7 +4134,7 @@ export class ObservableVector3d {
|
|
|
4085
4134
|
* @function
|
|
4086
4135
|
* @return {me.ObservableVector3d} Reference to this object for method chaining
|
|
4087
4136
|
*/
|
|
4088
|
-
abs():
|
|
4137
|
+
abs(): me.ObservableVector3d;
|
|
4089
4138
|
/**
|
|
4090
4139
|
* Clamp the vector value within the specified value range
|
|
4091
4140
|
* @name clamp
|
|
@@ -4095,7 +4144,7 @@ export class ObservableVector3d {
|
|
|
4095
4144
|
* @param {Number} high
|
|
4096
4145
|
* @return {me.ObservableVector3d} new me.ObservableVector3d
|
|
4097
4146
|
*/
|
|
4098
|
-
clamp(low: number, high: number):
|
|
4147
|
+
clamp(low: number, high: number): me.ObservableVector3d;
|
|
4099
4148
|
/**
|
|
4100
4149
|
* Clamp this vector value within the specified value range
|
|
4101
4150
|
* @name clampSelf
|
|
@@ -4105,7 +4154,7 @@ export class ObservableVector3d {
|
|
|
4105
4154
|
* @param {Number} high
|
|
4106
4155
|
* @return {me.ObservableVector3d} Reference to this object for method chaining
|
|
4107
4156
|
*/
|
|
4108
|
-
clampSelf(low: number, high: number):
|
|
4157
|
+
clampSelf(low: number, high: number): me.ObservableVector3d;
|
|
4109
4158
|
/**
|
|
4110
4159
|
* Update this vector with the minimum value between this and the passed vector
|
|
4111
4160
|
* @name minV
|
|
@@ -4114,7 +4163,7 @@ export class ObservableVector3d {
|
|
|
4114
4163
|
* @param {me.Vector2d|me.Vector3d|me.ObservableVector2d|me.ObservableVector3d} v
|
|
4115
4164
|
* @return {me.ObservableVector3d} Reference to this object for method chaining
|
|
4116
4165
|
*/
|
|
4117
|
-
minV(v:
|
|
4166
|
+
minV(v: me.Vector2d | me.Vector3d | me.ObservableVector2d | me.ObservableVector3d): me.ObservableVector3d;
|
|
4118
4167
|
/**
|
|
4119
4168
|
* Update this vector with the maximum value between this and the passed vector
|
|
4120
4169
|
* @name maxV
|
|
@@ -4123,7 +4172,7 @@ export class ObservableVector3d {
|
|
|
4123
4172
|
* @param {me.Vector2d|me.Vector3d|me.ObservableVector2d|me.ObservableVector3d} v
|
|
4124
4173
|
* @return {me.ObservableVector3d} Reference to this object for method chaining
|
|
4125
4174
|
*/
|
|
4126
|
-
maxV(v:
|
|
4175
|
+
maxV(v: me.Vector2d | me.Vector3d | me.ObservableVector2d | me.ObservableVector3d): me.ObservableVector3d;
|
|
4127
4176
|
/**
|
|
4128
4177
|
* Floor the vector values
|
|
4129
4178
|
* @name floor
|
|
@@ -4131,7 +4180,7 @@ export class ObservableVector3d {
|
|
|
4131
4180
|
* @function
|
|
4132
4181
|
* @return {me.ObservableVector3d} new me.ObservableVector3d
|
|
4133
4182
|
*/
|
|
4134
|
-
floor():
|
|
4183
|
+
floor(): me.ObservableVector3d;
|
|
4135
4184
|
/**
|
|
4136
4185
|
* Floor this vector values
|
|
4137
4186
|
* @name floorSelf
|
|
@@ -4139,7 +4188,7 @@ export class ObservableVector3d {
|
|
|
4139
4188
|
* @function
|
|
4140
4189
|
* @return {me.ObservableVector3d} Reference to this object for method chaining
|
|
4141
4190
|
*/
|
|
4142
|
-
floorSelf():
|
|
4191
|
+
floorSelf(): me.ObservableVector3d;
|
|
4143
4192
|
/**
|
|
4144
4193
|
* Ceil the vector values
|
|
4145
4194
|
* @name ceil
|
|
@@ -4147,7 +4196,7 @@ export class ObservableVector3d {
|
|
|
4147
4196
|
* @function
|
|
4148
4197
|
* @return {me.ObservableVector3d} new me.ObservableVector3d
|
|
4149
4198
|
*/
|
|
4150
|
-
ceil():
|
|
4199
|
+
ceil(): me.ObservableVector3d;
|
|
4151
4200
|
/**
|
|
4152
4201
|
* Ceil this vector values
|
|
4153
4202
|
* @name ceilSelf
|
|
@@ -4155,7 +4204,7 @@ export class ObservableVector3d {
|
|
|
4155
4204
|
* @function
|
|
4156
4205
|
* @return {me.ObservableVector3d} Reference to this object for method chaining
|
|
4157
4206
|
*/
|
|
4158
|
-
ceilSelf():
|
|
4207
|
+
ceilSelf(): me.ObservableVector3d;
|
|
4159
4208
|
/**
|
|
4160
4209
|
* Negate the vector values
|
|
4161
4210
|
* @name negate
|
|
@@ -4163,7 +4212,7 @@ export class ObservableVector3d {
|
|
|
4163
4212
|
* @function
|
|
4164
4213
|
* @return {me.ObservableVector3d} new me.ObservableVector3d
|
|
4165
4214
|
*/
|
|
4166
|
-
negate():
|
|
4215
|
+
negate(): me.ObservableVector3d;
|
|
4167
4216
|
/**
|
|
4168
4217
|
* Negate this vector values
|
|
4169
4218
|
* @name negateSelf
|
|
@@ -4171,7 +4220,7 @@ export class ObservableVector3d {
|
|
|
4171
4220
|
* @function
|
|
4172
4221
|
* @return {me.ObservableVector3d} Reference to this object for method chaining
|
|
4173
4222
|
*/
|
|
4174
|
-
negateSelf():
|
|
4223
|
+
negateSelf(): me.ObservableVector3d;
|
|
4175
4224
|
/**
|
|
4176
4225
|
* Copy the components of the given vector into this one
|
|
4177
4226
|
* @name copy
|
|
@@ -4180,7 +4229,7 @@ export class ObservableVector3d {
|
|
|
4180
4229
|
* @param {me.Vector2d|me.Vector3d|me.ObservableVector2d|me.ObservableVector3d} v
|
|
4181
4230
|
* @return {me.ObservableVector3d} Reference to this object for method chaining
|
|
4182
4231
|
*/
|
|
4183
|
-
copy(v:
|
|
4232
|
+
copy(v: me.Vector2d | me.Vector3d | me.ObservableVector2d | me.ObservableVector3d): me.ObservableVector3d;
|
|
4184
4233
|
/**
|
|
4185
4234
|
* return true if the two vectors are the same
|
|
4186
4235
|
* @name equals
|
|
@@ -4189,7 +4238,7 @@ export class ObservableVector3d {
|
|
|
4189
4238
|
* @param {me.Vector2d|me.Vector3d|me.ObservableVector2d|me.ObservableVector3d} v
|
|
4190
4239
|
* @return {Boolean}
|
|
4191
4240
|
*/
|
|
4192
|
-
equals(v:
|
|
4241
|
+
equals(v: me.Vector2d | me.Vector3d | me.ObservableVector2d | me.ObservableVector3d): boolean;
|
|
4193
4242
|
/**
|
|
4194
4243
|
* change this vector to be perpendicular to what it was before.<br>
|
|
4195
4244
|
* (Effectively rotates it 90 degrees in a clockwise direction)
|
|
@@ -4198,7 +4247,7 @@ export class ObservableVector3d {
|
|
|
4198
4247
|
* @function
|
|
4199
4248
|
* @return {me.ObservableVector3d} Reference to this object for method chaining
|
|
4200
4249
|
*/
|
|
4201
|
-
perp():
|
|
4250
|
+
perp(): me.ObservableVector3d;
|
|
4202
4251
|
/**
|
|
4203
4252
|
* Rotate this vector (counter-clockwise) by the specified angle (in radians).
|
|
4204
4253
|
* @name rotate
|
|
@@ -4208,7 +4257,7 @@ export class ObservableVector3d {
|
|
|
4208
4257
|
* @param {me.Vector2d|me.ObservableVector2d} [v] an optional point to rotate around (on the same z axis)
|
|
4209
4258
|
* @return {me.ObservableVector3d} Reference to this object for method chaining
|
|
4210
4259
|
*/
|
|
4211
|
-
rotate(angle: number, v?:
|
|
4260
|
+
rotate(angle: number, v?: me.Vector2d | me.ObservableVector2d): me.ObservableVector3d;
|
|
4212
4261
|
/**
|
|
4213
4262
|
* return the dot product of this vector and the passed one
|
|
4214
4263
|
* @name dotProduct
|
|
@@ -4217,7 +4266,7 @@ export class ObservableVector3d {
|
|
|
4217
4266
|
* @param {me.Vector2d|me.Vector3d|me.ObservableVector2d|me.ObservableVector3d} v
|
|
4218
4267
|
* @return {Number} The dot product.
|
|
4219
4268
|
*/
|
|
4220
|
-
dotProduct(v:
|
|
4269
|
+
dotProduct(v: me.Vector2d | me.Vector3d | me.ObservableVector2d | me.ObservableVector3d): number;
|
|
4221
4270
|
/**
|
|
4222
4271
|
* Linearly interpolate between this vector and the given one.
|
|
4223
4272
|
* @name lerp
|
|
@@ -4227,7 +4276,7 @@ export class ObservableVector3d {
|
|
|
4227
4276
|
* @param {Number} alpha distance along the line (alpha = 0 will be this vector, and alpha = 1 will be the given one).
|
|
4228
4277
|
* @return {me.ObservableVector3d} Reference to this object for method chaining
|
|
4229
4278
|
*/
|
|
4230
|
-
lerp(v:
|
|
4279
|
+
lerp(v: me.Vector3d | me.ObservableVector3d, alpha: number): me.ObservableVector3d;
|
|
4231
4280
|
/**
|
|
4232
4281
|
* return the distance between this vector and the passed one
|
|
4233
4282
|
* @name distance
|
|
@@ -4236,7 +4285,7 @@ export class ObservableVector3d {
|
|
|
4236
4285
|
* @param {me.Vector2d|me.Vector3d|me.ObservableVector2d|me.ObservableVector3d} v
|
|
4237
4286
|
* @return {Number}
|
|
4238
4287
|
*/
|
|
4239
|
-
distance(v:
|
|
4288
|
+
distance(v: me.Vector2d | me.Vector3d | me.ObservableVector2d | me.ObservableVector3d): number;
|
|
4240
4289
|
/**
|
|
4241
4290
|
* return a clone copy of this vector
|
|
4242
4291
|
* @name clone
|
|
@@ -4244,7 +4293,7 @@ export class ObservableVector3d {
|
|
|
4244
4293
|
* @function
|
|
4245
4294
|
* @return {me.ObservableVector3d} new me.ObservableVector3d
|
|
4246
4295
|
*/
|
|
4247
|
-
clone():
|
|
4296
|
+
clone(): me.ObservableVector3d;
|
|
4248
4297
|
/**
|
|
4249
4298
|
* return a `me.Vector3d` copy of this `me.ObservableVector3d` object
|
|
4250
4299
|
* @name toVector3d
|
|
@@ -4252,7 +4301,7 @@ export class ObservableVector3d {
|
|
|
4252
4301
|
* @function
|
|
4253
4302
|
* @return {me.Vector3d} new me.Vector3d
|
|
4254
4303
|
*/
|
|
4255
|
-
toVector3d():
|
|
4304
|
+
toVector3d(): me.Vector3d;
|
|
4256
4305
|
/**
|
|
4257
4306
|
* convert the object to a string representation
|
|
4258
4307
|
* @name toString
|
|
@@ -4469,7 +4518,7 @@ export namespace ParticleEmitterSettings {
|
|
|
4469
4518
|
* @classdesc
|
|
4470
4519
|
* a pointer object, representing a single finger on a touch enabled device.
|
|
4471
4520
|
* @class
|
|
4472
|
-
* @extends me.
|
|
4521
|
+
* @extends me.Bounds
|
|
4473
4522
|
* @memberOf me
|
|
4474
4523
|
* @constructor
|
|
4475
4524
|
*/
|
|
@@ -4701,7 +4750,11 @@ export class Pointer {
|
|
|
4701
4750
|
* @param {Number} [pointedId=1] the Pointer, Touch or Mouse event Id (1)
|
|
4702
4751
|
*/
|
|
4703
4752
|
private setEvent;
|
|
4753
|
+
x: any;
|
|
4754
|
+
y: any;
|
|
4704
4755
|
isNormalized: boolean;
|
|
4756
|
+
width: any;
|
|
4757
|
+
height: any;
|
|
4705
4758
|
}
|
|
4706
4759
|
/**
|
|
4707
4760
|
* @classdesc
|
|
@@ -4727,7 +4780,7 @@ export class Polygon {
|
|
|
4727
4780
|
* @name pos
|
|
4728
4781
|
* @memberof me.Polygon#
|
|
4729
4782
|
*/
|
|
4730
|
-
public pos:
|
|
4783
|
+
public pos: me.Vector2d;
|
|
4731
4784
|
/**
|
|
4732
4785
|
* The bounding rectangle for this shape
|
|
4733
4786
|
* @ignore
|
|
@@ -4735,7 +4788,7 @@ export class Polygon {
|
|
|
4735
4788
|
* @name _bounds
|
|
4736
4789
|
* @memberOf me.Polygon#
|
|
4737
4790
|
*/
|
|
4738
|
-
_bounds:
|
|
4791
|
+
_bounds: me.Bounds;
|
|
4739
4792
|
/**
|
|
4740
4793
|
* Array of points defining the Polygon <br>
|
|
4741
4794
|
* Note: If you manually change `points`, you **must** call `recalc`afterwards so that the changes get applied correctly.
|
|
@@ -4744,7 +4797,7 @@ export class Polygon {
|
|
|
4744
4797
|
* @name points
|
|
4745
4798
|
* @memberOf me.Polygon#
|
|
4746
4799
|
*/
|
|
4747
|
-
public points:
|
|
4800
|
+
public points: me.Vector2d[];
|
|
4748
4801
|
/**
|
|
4749
4802
|
* The edges here are the direction of the `n`th edge of the polygon, relative to
|
|
4750
4803
|
* the `n`th point. If you want to draw a given edge from the edge value, you must
|
|
@@ -4776,7 +4829,7 @@ export class Polygon {
|
|
|
4776
4829
|
* @param {Number} y position of the Polygon
|
|
4777
4830
|
* @param {me.Vector2d[]|Number[]} points array of vector or vertice defining the Polygon
|
|
4778
4831
|
*/
|
|
4779
|
-
setShape(x: number, y: number, points:
|
|
4832
|
+
setShape(x: number, y: number, points: me.Vector2d[] | number[]): Polygon;
|
|
4780
4833
|
/**
|
|
4781
4834
|
* set the vertices defining this Polygon
|
|
4782
4835
|
* @name setVertices
|
|
@@ -4793,7 +4846,7 @@ export class Polygon {
|
|
|
4793
4846
|
* @param {me.Matrix2d} matrix the transformation matrix
|
|
4794
4847
|
* @return {me.Polygon} Reference to this object for method chaining
|
|
4795
4848
|
*/
|
|
4796
|
-
transform(m: any):
|
|
4849
|
+
transform(m: any): me.Polygon;
|
|
4797
4850
|
/**
|
|
4798
4851
|
* apply an isometric projection to this shape
|
|
4799
4852
|
* @name toIso
|
|
@@ -4801,7 +4854,7 @@ export class Polygon {
|
|
|
4801
4854
|
* @function
|
|
4802
4855
|
* @return {me.Polygon} Reference to this object for method chaining
|
|
4803
4856
|
*/
|
|
4804
|
-
toIso():
|
|
4857
|
+
toIso(): me.Polygon;
|
|
4805
4858
|
/**
|
|
4806
4859
|
* apply a 2d projection to this shape
|
|
4807
4860
|
* @name to2d
|
|
@@ -4809,7 +4862,7 @@ export class Polygon {
|
|
|
4809
4862
|
* @function
|
|
4810
4863
|
* @return {me.Polygon} Reference to this object for method chaining
|
|
4811
4864
|
*/
|
|
4812
|
-
to2d():
|
|
4865
|
+
to2d(): me.Polygon;
|
|
4813
4866
|
/**
|
|
4814
4867
|
* Rotate this Polygon (counter-clockwise) by the specified angle (in radians).
|
|
4815
4868
|
* @name rotate
|
|
@@ -4819,7 +4872,7 @@ export class Polygon {
|
|
|
4819
4872
|
* @param {me.Vector2d|me.ObservableVector2d} [v] an optional point to rotate around
|
|
4820
4873
|
* @return {me.Polygon} Reference to this object for method chaining
|
|
4821
4874
|
*/
|
|
4822
|
-
rotate(angle: number, v?:
|
|
4875
|
+
rotate(angle: number, v?: me.Vector2d | me.ObservableVector2d): me.Polygon;
|
|
4823
4876
|
/**
|
|
4824
4877
|
* Scale this Polygon by the given scalar.
|
|
4825
4878
|
* @name scale
|
|
@@ -4829,7 +4882,7 @@ export class Polygon {
|
|
|
4829
4882
|
* @param {Number} [y=x]
|
|
4830
4883
|
* @return {me.Polygon} Reference to this object for method chaining
|
|
4831
4884
|
*/
|
|
4832
|
-
scale(x: number, y?: number):
|
|
4885
|
+
scale(x: number, y?: number): me.Polygon;
|
|
4833
4886
|
/**
|
|
4834
4887
|
* Scale this Polygon by the given vector
|
|
4835
4888
|
* @name scaleV
|
|
@@ -4838,7 +4891,7 @@ export class Polygon {
|
|
|
4838
4891
|
* @param {me.Vector2d} v
|
|
4839
4892
|
* @return {me.Polygon} Reference to this object for method chaining
|
|
4840
4893
|
*/
|
|
4841
|
-
scaleV(v:
|
|
4894
|
+
scaleV(v: me.Vector2d): me.Polygon;
|
|
4842
4895
|
/**
|
|
4843
4896
|
* Computes the calculated collision polygon.
|
|
4844
4897
|
* This **must** be called if the `points` array, `angle`, or `offset` is modified manually.
|
|
@@ -4847,7 +4900,7 @@ export class Polygon {
|
|
|
4847
4900
|
* @function
|
|
4848
4901
|
* @return {me.Polygon} Reference to this object for method chaining
|
|
4849
4902
|
*/
|
|
4850
|
-
recalc():
|
|
4903
|
+
recalc(): me.Polygon;
|
|
4851
4904
|
/**
|
|
4852
4905
|
* returns a list of indices for all triangles defined in this polygon
|
|
4853
4906
|
* @name getIndices
|
|
@@ -4873,7 +4926,7 @@ export class Polygon {
|
|
|
4873
4926
|
* @param {me.Vector2d} v vector offset
|
|
4874
4927
|
* @return {me.Polygon} Reference to this object for method chaining
|
|
4875
4928
|
*/
|
|
4876
|
-
translate(...args: any[]):
|
|
4929
|
+
translate(...args: any[]): me.Polygon;
|
|
4877
4930
|
/**
|
|
4878
4931
|
* Shifts the Polygon to the given position vector.
|
|
4879
4932
|
* @name shift
|
|
@@ -4919,7 +4972,7 @@ export class Polygon {
|
|
|
4919
4972
|
* @function
|
|
4920
4973
|
* @return {me.Bounds} this shape bounding box Rectangle object
|
|
4921
4974
|
*/
|
|
4922
|
-
getBounds():
|
|
4975
|
+
getBounds(): me.Bounds;
|
|
4923
4976
|
/**
|
|
4924
4977
|
* update the bounding box for this shape.
|
|
4925
4978
|
* @ignore
|
|
@@ -4928,7 +4981,7 @@ export class Polygon {
|
|
|
4928
4981
|
* @function
|
|
4929
4982
|
* @return {me.Bounds} this shape bounding box Rectangle object
|
|
4930
4983
|
*/
|
|
4931
|
-
updateBounds():
|
|
4984
|
+
updateBounds(): me.Bounds;
|
|
4932
4985
|
/**
|
|
4933
4986
|
* clone this Polygon
|
|
4934
4987
|
* @name clone
|
|
@@ -4936,7 +4989,7 @@ export class Polygon {
|
|
|
4936
4989
|
* @function
|
|
4937
4990
|
* @return {me.Polygon} new Polygon
|
|
4938
4991
|
*/
|
|
4939
|
-
clone():
|
|
4992
|
+
clone(): me.Polygon;
|
|
4940
4993
|
}
|
|
4941
4994
|
/**
|
|
4942
4995
|
* @classdesc
|
|
@@ -4968,7 +5021,7 @@ export class QuadTree {
|
|
|
4968
5021
|
* @function
|
|
4969
5022
|
* @param {me.Container} container group of objects to be added
|
|
4970
5023
|
*/
|
|
4971
|
-
insertContainer(container:
|
|
5024
|
+
insertContainer(container: me.Container): void;
|
|
4972
5025
|
/**
|
|
4973
5026
|
* Insert the given object into the node. If the node
|
|
4974
5027
|
* exceeds the capacity, it will split and add all
|
|
@@ -5051,7 +5104,7 @@ export class Rect {
|
|
|
5051
5104
|
* @param {Number} [h] height of the rectangle, if a numeral width parameter is specified
|
|
5052
5105
|
* @return {me.Rect} this rectangle
|
|
5053
5106
|
*/
|
|
5054
|
-
setShape(x: number, y: number, w: number | any[], h?: number, ...args: any[]):
|
|
5107
|
+
setShape(x: number, y: number, w: number | any[], h?: number, ...args: any[]): me.Rect;
|
|
5055
5108
|
/**
|
|
5056
5109
|
* left coordinate of the Rectangle
|
|
5057
5110
|
* @public
|
|
@@ -5165,7 +5218,7 @@ export class Rect {
|
|
|
5165
5218
|
* @param {Number} h new height of the rectangle
|
|
5166
5219
|
* @return {me.Rect} this rectangle
|
|
5167
5220
|
*/
|
|
5168
|
-
resize(w: number, h: number):
|
|
5221
|
+
resize(w: number, h: number): me.Rect;
|
|
5169
5222
|
/**
|
|
5170
5223
|
* scale the rectangle
|
|
5171
5224
|
* @name scale
|
|
@@ -5175,7 +5228,7 @@ export class Rect {
|
|
|
5175
5228
|
* @param {Number} [y=x] a number representing the ordinate of the scaling vector.
|
|
5176
5229
|
* @return {me.Rect} this rectangle
|
|
5177
5230
|
*/
|
|
5178
|
-
scale(x: number, y?: number):
|
|
5231
|
+
scale(x: number, y?: number): me.Rect;
|
|
5179
5232
|
/**
|
|
5180
5233
|
* clone this rectangle
|
|
5181
5234
|
* @name clone
|
|
@@ -5183,7 +5236,7 @@ export class Rect {
|
|
|
5183
5236
|
* @function
|
|
5184
5237
|
* @return {me.Rect} new rectangle
|
|
5185
5238
|
*/
|
|
5186
|
-
clone():
|
|
5239
|
+
clone(): me.Rect;
|
|
5187
5240
|
/**
|
|
5188
5241
|
* copy the position and size of the given rectangle into this one
|
|
5189
5242
|
* @name copy
|
|
@@ -5192,7 +5245,7 @@ export class Rect {
|
|
|
5192
5245
|
* @param {me.Rect} rect Source rectangle
|
|
5193
5246
|
* @return {me.Rect} new rectangle
|
|
5194
5247
|
*/
|
|
5195
|
-
copy(rect:
|
|
5248
|
+
copy(rect: me.Rect): me.Rect;
|
|
5196
5249
|
/**
|
|
5197
5250
|
* merge this rectangle with another one
|
|
5198
5251
|
* @name union
|
|
@@ -5201,7 +5254,7 @@ export class Rect {
|
|
|
5201
5254
|
* @param {me.Rect} rect other rectangle to union with
|
|
5202
5255
|
* @return {me.Rect} the union(ed) rectangle
|
|
5203
5256
|
*/
|
|
5204
|
-
union(r: any):
|
|
5257
|
+
union(r: any): me.Rect;
|
|
5205
5258
|
/**
|
|
5206
5259
|
* check if this rectangle is intersecting with the specified one
|
|
5207
5260
|
* @name overlaps
|
|
@@ -5261,7 +5314,7 @@ export class Rect {
|
|
|
5261
5314
|
* @function
|
|
5262
5315
|
* @return {me.Polygon} a new Polygon that represents this rectangle.
|
|
5263
5316
|
*/
|
|
5264
|
-
toPolygon():
|
|
5317
|
+
toPolygon(): me.Polygon;
|
|
5265
5318
|
}
|
|
5266
5319
|
/**
|
|
5267
5320
|
* @classdesc
|
|
@@ -5299,7 +5352,6 @@ export class Renderable {
|
|
|
5299
5352
|
* @public
|
|
5300
5353
|
* @type {me.Body}
|
|
5301
5354
|
* @see me.Body
|
|
5302
|
-
* @see me.collision#check
|
|
5303
5355
|
* @name body
|
|
5304
5356
|
* @memberOf me.Renderable#
|
|
5305
5357
|
* @example
|
|
@@ -5334,7 +5386,7 @@ export class Renderable {
|
|
|
5334
5386
|
*
|
|
5335
5387
|
* }
|
|
5336
5388
|
*/
|
|
5337
|
-
public body:
|
|
5389
|
+
public body: me.Body;
|
|
5338
5390
|
currentTransform: any;
|
|
5339
5391
|
/**
|
|
5340
5392
|
* (G)ame (U)nique (Id)entifier" <br>
|
|
@@ -5438,7 +5490,7 @@ export class Renderable {
|
|
|
5438
5490
|
* @default undefined
|
|
5439
5491
|
* @name me.Renderable#ancestor
|
|
5440
5492
|
*/
|
|
5441
|
-
public ancestor:
|
|
5493
|
+
public ancestor: me.Container | me.Entity;
|
|
5442
5494
|
/**
|
|
5443
5495
|
* A mask limits rendering elements to the shape and position of the given mask object.
|
|
5444
5496
|
* So, if the renderable is larger than the mask, only the intersecting part of the renderable will be visible.
|
|
@@ -5463,7 +5515,7 @@ export class Renderable {
|
|
|
5463
5515
|
* {x: -14, y: 30}
|
|
5464
5516
|
* ]);
|
|
5465
5517
|
*/
|
|
5466
|
-
public mask:
|
|
5518
|
+
public mask: me.Rect | me.Polygon | me.Line | me.Ellipse;
|
|
5467
5519
|
/**
|
|
5468
5520
|
* define a tint for this renderable. a (255, 255, 255) r, g, b value will remove the tint effect.
|
|
5469
5521
|
* @public
|
|
@@ -5477,7 +5529,7 @@ export class Renderable {
|
|
|
5477
5529
|
* // remove the tint
|
|
5478
5530
|
* this.tint.setColor(255, 255, 255);
|
|
5479
5531
|
*/
|
|
5480
|
-
public tint:
|
|
5532
|
+
public tint: me.Color;
|
|
5481
5533
|
/**
|
|
5482
5534
|
* The name of the renderable
|
|
5483
5535
|
* @public
|
|
@@ -5549,7 +5601,7 @@ export class Renderable {
|
|
|
5549
5601
|
* @function
|
|
5550
5602
|
* @return {me.Bounds} bounding box Rectangle object
|
|
5551
5603
|
*/
|
|
5552
|
-
getBounds():
|
|
5604
|
+
getBounds(): me.Bounds;
|
|
5553
5605
|
/**
|
|
5554
5606
|
* get the renderable alpha channel value<br>
|
|
5555
5607
|
* @name getOpacity
|
|
@@ -5575,7 +5627,7 @@ export class Renderable {
|
|
|
5575
5627
|
* @param {Boolean} [flip=true] `true` to flip this renderable.
|
|
5576
5628
|
* @return {me.Renderable} Reference to this object for method chaining
|
|
5577
5629
|
*/
|
|
5578
|
-
flipX(flip?: boolean):
|
|
5630
|
+
flipX(flip?: boolean): me.Renderable;
|
|
5579
5631
|
/**
|
|
5580
5632
|
* flip the renderable on the vertical axis (around the center of the renderable)
|
|
5581
5633
|
* @see me.Matrix2d#scaleY
|
|
@@ -5585,7 +5637,7 @@ export class Renderable {
|
|
|
5585
5637
|
* @param {Boolean} [flip=true] `true` to flip this renderable.
|
|
5586
5638
|
* @return {me.Renderable} Reference to this object for method chaining
|
|
5587
5639
|
*/
|
|
5588
|
-
flipY(flip?: boolean):
|
|
5640
|
+
flipY(flip?: boolean): me.Renderable;
|
|
5589
5641
|
/**
|
|
5590
5642
|
* multiply the renderable currentTransform with the given matrix
|
|
5591
5643
|
* @name transform
|
|
@@ -5595,7 +5647,7 @@ export class Renderable {
|
|
|
5595
5647
|
* @param {me.Matrix2d} matrix the transformation matrix
|
|
5596
5648
|
* @return {me.Renderable} Reference to this object for method chaining
|
|
5597
5649
|
*/
|
|
5598
|
-
transform(m: any):
|
|
5650
|
+
transform(m: any): me.Renderable;
|
|
5599
5651
|
/**
|
|
5600
5652
|
* return the angle to the specified target
|
|
5601
5653
|
* @name angleTo
|
|
@@ -5604,7 +5656,7 @@ export class Renderable {
|
|
|
5604
5656
|
* @param {me.Renderable|me.Vector2d|me.Vector3d} target
|
|
5605
5657
|
* @return {Number} angle in radians
|
|
5606
5658
|
*/
|
|
5607
|
-
angleTo(target:
|
|
5659
|
+
angleTo(target: me.Renderable | me.Vector2d | me.Vector3d): number;
|
|
5608
5660
|
/**
|
|
5609
5661
|
* return the distance to the specified target
|
|
5610
5662
|
* @name distanceTo
|
|
@@ -5613,7 +5665,7 @@ export class Renderable {
|
|
|
5613
5665
|
* @param {me.Renderable|me.Vector2d|me.Vector3d} target
|
|
5614
5666
|
* @return {Number} distance
|
|
5615
5667
|
*/
|
|
5616
|
-
distanceTo(target:
|
|
5668
|
+
distanceTo(target: me.Renderable | me.Vector2d | me.Vector3d): number;
|
|
5617
5669
|
/**
|
|
5618
5670
|
* Rotate this renderable towards the given target.
|
|
5619
5671
|
* @name lookAt
|
|
@@ -5622,7 +5674,7 @@ export class Renderable {
|
|
|
5622
5674
|
* @param {me.Renderable|me.Vector2d|me.Vector3d} target the renderable or position to look at
|
|
5623
5675
|
* @return {me.Renderable} Reference to this object for method chaining
|
|
5624
5676
|
*/
|
|
5625
|
-
lookAt(target:
|
|
5677
|
+
lookAt(target: me.Renderable | me.Vector2d | me.Vector3d): me.Renderable;
|
|
5626
5678
|
/**
|
|
5627
5679
|
* Rotate this renderable by the specified angle (in radians).
|
|
5628
5680
|
* @name rotate
|
|
@@ -5632,7 +5684,7 @@ export class Renderable {
|
|
|
5632
5684
|
* @param {me.Vector2d|me.ObservableVector2d} [v] an optional point to rotate around
|
|
5633
5685
|
* @return {me.Renderable} Reference to this object for method chaining
|
|
5634
5686
|
*/
|
|
5635
|
-
rotate(angle: number):
|
|
5687
|
+
rotate(angle: number): me.Renderable;
|
|
5636
5688
|
/**
|
|
5637
5689
|
* scale the renderable around his anchor point. Scaling actually applies changes
|
|
5638
5690
|
* to the currentTransform member wich is used by the renderer to scale the object
|
|
@@ -5646,7 +5698,7 @@ export class Renderable {
|
|
|
5646
5698
|
* @param {Number} [y=x] a number representing the ordinate of the scaling vector.
|
|
5647
5699
|
* @return {me.Renderable} Reference to this object for method chaining
|
|
5648
5700
|
*/
|
|
5649
|
-
scale(x: number, y?: number):
|
|
5701
|
+
scale(x: number, y?: number): me.Renderable;
|
|
5650
5702
|
/**
|
|
5651
5703
|
* scale the renderable around his anchor point
|
|
5652
5704
|
* @name scaleV
|
|
@@ -5655,7 +5707,7 @@ export class Renderable {
|
|
|
5655
5707
|
* @param {me.Vector2d} vector scaling vector
|
|
5656
5708
|
* @return {me.Renderable} Reference to this object for method chaining
|
|
5657
5709
|
*/
|
|
5658
|
-
scaleV(v: any):
|
|
5710
|
+
scaleV(v: any): me.Renderable;
|
|
5659
5711
|
/**
|
|
5660
5712
|
* update function. <br>
|
|
5661
5713
|
* automatically called by the game manager {@link me.game}
|
|
@@ -5675,7 +5727,7 @@ export class Renderable {
|
|
|
5675
5727
|
* @function
|
|
5676
5728
|
* @return {me.Bounds} this shape bounding box Rectangle object
|
|
5677
5729
|
*/
|
|
5678
|
-
updateBounds():
|
|
5730
|
+
updateBounds(): me.Bounds;
|
|
5679
5731
|
/**
|
|
5680
5732
|
* update the renderable's bounding rect (private)
|
|
5681
5733
|
* @ignore
|
|
@@ -5691,7 +5743,7 @@ export class Renderable {
|
|
|
5691
5743
|
* @function
|
|
5692
5744
|
* @return {me.Vector2d}
|
|
5693
5745
|
*/
|
|
5694
|
-
getAbsolutePosition():
|
|
5746
|
+
getAbsolutePosition(): me.Vector2d;
|
|
5695
5747
|
_absPos: any;
|
|
5696
5748
|
/**
|
|
5697
5749
|
* called when the anchor point value is changed
|
|
@@ -5711,7 +5763,7 @@ export class Renderable {
|
|
|
5711
5763
|
* @protected
|
|
5712
5764
|
* @param {me.CanvasRenderer|me.WebGLRenderer} renderer a renderer object
|
|
5713
5765
|
**/
|
|
5714
|
-
protected preDraw(renderer:
|
|
5766
|
+
protected preDraw(renderer: me.CanvasRenderer | me.WebGLRenderer): void;
|
|
5715
5767
|
/**
|
|
5716
5768
|
* object draw. <br>
|
|
5717
5769
|
* automatically called by the game manager {@link me.game}
|
|
@@ -5731,7 +5783,7 @@ export class Renderable {
|
|
|
5731
5783
|
* @protected
|
|
5732
5784
|
* @param {me.CanvasRenderer|me.WebGLRenderer} renderer a renderer object
|
|
5733
5785
|
**/
|
|
5734
|
-
protected postDraw(renderer:
|
|
5786
|
+
protected postDraw(renderer: me.CanvasRenderer | me.WebGLRenderer): void;
|
|
5735
5787
|
/**
|
|
5736
5788
|
* onCollision callback, triggered in case of collision,
|
|
5737
5789
|
* when this renderable body is colliding with another one
|
|
@@ -5863,7 +5915,7 @@ export class Renderer {
|
|
|
5863
5915
|
* @function
|
|
5864
5916
|
* @return {Context2d}
|
|
5865
5917
|
*/
|
|
5866
|
-
getScreenContext():
|
|
5918
|
+
getScreenContext(): Context2d;
|
|
5867
5919
|
/**
|
|
5868
5920
|
* returns the current blend mode for this renderer
|
|
5869
5921
|
* @name getBlendMode
|
|
@@ -5880,9 +5932,9 @@ export class Renderer {
|
|
|
5880
5932
|
* @function
|
|
5881
5933
|
* @param {HTMLCanvasElement} canvas
|
|
5882
5934
|
* @param {Boolean} [transparent=true] use false to disable transparency
|
|
5883
|
-
* @return {
|
|
5935
|
+
* @return {CanvasRenderingContext2D}
|
|
5884
5936
|
*/
|
|
5885
|
-
getContext2d(c: any, transparent?: boolean):
|
|
5937
|
+
getContext2d(c: any, transparent?: boolean): CanvasRenderingContext2D;
|
|
5886
5938
|
/**
|
|
5887
5939
|
* return the width of the system Canvas
|
|
5888
5940
|
* @name getWidth
|
|
@@ -5923,7 +5975,7 @@ export class Renderer {
|
|
|
5923
5975
|
* @param {me.Rect|me.Bounds} bounds
|
|
5924
5976
|
* @return {boolean} true if overlaps
|
|
5925
5977
|
*/
|
|
5926
|
-
overlaps(bounds:
|
|
5978
|
+
overlaps(bounds: me.Rect | me.Bounds): boolean;
|
|
5927
5979
|
/**
|
|
5928
5980
|
* resizes the system canvas
|
|
5929
5981
|
* @name resize
|
|
@@ -5941,7 +5993,7 @@ export class Renderer {
|
|
|
5941
5993
|
* @param {Context2d} context
|
|
5942
5994
|
* @param {Boolean} [enable=false]
|
|
5943
5995
|
*/
|
|
5944
|
-
setAntiAlias(context:
|
|
5996
|
+
setAntiAlias(context: Context2d, enable?: boolean): void;
|
|
5945
5997
|
/**
|
|
5946
5998
|
* set/change the current projection matrix (WebGL only)
|
|
5947
5999
|
* @name setProjection
|
|
@@ -5949,7 +6001,7 @@ export class Renderer {
|
|
|
5949
6001
|
* @function
|
|
5950
6002
|
* @param {me.Matrix3d} matrix
|
|
5951
6003
|
*/
|
|
5952
|
-
setProjection(matrix:
|
|
6004
|
+
setProjection(matrix: me.Matrix3d): void;
|
|
5953
6005
|
/**
|
|
5954
6006
|
* stroke the given shape
|
|
5955
6007
|
* @name stroke
|
|
@@ -5957,7 +6009,7 @@ export class Renderer {
|
|
|
5957
6009
|
* @function
|
|
5958
6010
|
* @param {me.Rect|me.Polygon|me.Line|me.Ellipse} shape a shape object to stroke
|
|
5959
6011
|
*/
|
|
5960
|
-
stroke(shape:
|
|
6012
|
+
stroke(shape: me.Rect | me.Polygon | me.Line | me.Ellipse, fill: any): void;
|
|
5961
6013
|
/**
|
|
5962
6014
|
* tint the given image or canvas using the given color
|
|
5963
6015
|
* @name tint
|
|
@@ -5968,7 +6020,7 @@ export class Renderer {
|
|
|
5968
6020
|
* @param {String} [mode="multiply"] the composition mode used to tint the image
|
|
5969
6021
|
* @return {HTMLCanvasElement|OffscreenCanvas} a new canvas element representing the tinted image
|
|
5970
6022
|
*/
|
|
5971
|
-
tint(src: any, color:
|
|
6023
|
+
tint(src: any, color: me.Color | string, mode?: string): HTMLCanvasElement | OffscreenCanvas;
|
|
5972
6024
|
/**
|
|
5973
6025
|
* fill the given shape
|
|
5974
6026
|
* @name fill
|
|
@@ -5976,7 +6028,7 @@ export class Renderer {
|
|
|
5976
6028
|
* @function
|
|
5977
6029
|
* @param {me.Rect|me.Polygon|me.Line|me.Ellipse} shape a shape object to fill
|
|
5978
6030
|
*/
|
|
5979
|
-
fill(shape:
|
|
6031
|
+
fill(shape: me.Rect | me.Polygon | me.Line | me.Ellipse): void;
|
|
5980
6032
|
/**
|
|
5981
6033
|
* A mask limits rendering elements to the shape and position of the given mask object.
|
|
5982
6034
|
* So, if the renderable is larger than the mask, only the intersecting part of the renderable will be visible.
|
|
@@ -5986,7 +6038,7 @@ export class Renderer {
|
|
|
5986
6038
|
* @function
|
|
5987
6039
|
* @param {me.Rect|me.Polygon|me.Line|me.Ellipse} [mask] the shape defining the mask to be applied
|
|
5988
6040
|
*/
|
|
5989
|
-
setMask(mask?:
|
|
6041
|
+
setMask(mask?: me.Rect | me.Polygon | me.Line | me.Ellipse): void;
|
|
5990
6042
|
/**
|
|
5991
6043
|
* disable (remove) the rendering mask set through setMask.
|
|
5992
6044
|
* @name clearMask
|
|
@@ -6000,9 +6052,10 @@ export class Renderer {
|
|
|
6000
6052
|
* @name setTint
|
|
6001
6053
|
* @memberOf me.Renderer.prototype
|
|
6002
6054
|
* @function
|
|
6003
|
-
* @param {me.Color}
|
|
6055
|
+
* @param {me.Color} tint the tint color
|
|
6056
|
+
* @param {Number} [alpha] an alpha value to be applied to the tint
|
|
6004
6057
|
*/
|
|
6005
|
-
setTint(tint?:
|
|
6058
|
+
setTint(tint: me.Color, alpha?: number): void;
|
|
6006
6059
|
/**
|
|
6007
6060
|
* clear the rendering tint set through setTint.
|
|
6008
6061
|
* @name clearTint
|
|
@@ -6031,7 +6084,7 @@ export class Renderer {
|
|
|
6031
6084
|
* @param {String} [settings.region] region name of a specific region to use when using a texture atlas, see {@link me.Renderer.Texture}
|
|
6032
6085
|
* @param {Number} [settings.framewidth] Width of a single frame within the spritesheet
|
|
6033
6086
|
* @param {Number} [settings.frameheight] Height of a single frame within the spritesheet
|
|
6034
|
-
* @param {String|Color} [settings.tint] a tint to be applied to this sprite
|
|
6087
|
+
* @param {String|me.Color} [settings.tint] a tint to be applied to this sprite
|
|
6035
6088
|
* @param {Number} [settings.flipX] flip the sprite on the horizontal axis
|
|
6036
6089
|
* @param {Number} [settings.flipY] flip the sprite on the vertical axis
|
|
6037
6090
|
* @param {me.Vector2d} [settings.anchorPoint={x:0.5, y:0.5}] Anchor point to draw the frame at (defaults to the center of the frame).
|
|
@@ -6083,7 +6136,7 @@ export class Sprite {
|
|
|
6083
6136
|
* @name offset
|
|
6084
6137
|
* @memberOf me.Sprite#
|
|
6085
6138
|
*/
|
|
6086
|
-
public offset:
|
|
6139
|
+
public offset: me.Vector2d;
|
|
6087
6140
|
/**
|
|
6088
6141
|
* The source texture object this sprite object is using
|
|
6089
6142
|
* @public
|
|
@@ -6091,7 +6144,7 @@ export class Sprite {
|
|
|
6091
6144
|
* @name source
|
|
6092
6145
|
* @memberOf me.Sprite#
|
|
6093
6146
|
*/
|
|
6094
|
-
public source:
|
|
6147
|
+
public source: me.Renderer.Texture;
|
|
6095
6148
|
anim: {};
|
|
6096
6149
|
resetAnim: any;
|
|
6097
6150
|
current: {
|
|
@@ -6140,7 +6193,7 @@ export class Sprite {
|
|
|
6140
6193
|
* me.game.world.removeChild(this);
|
|
6141
6194
|
* });
|
|
6142
6195
|
*/
|
|
6143
|
-
flicker(duration: number, callback: Function):
|
|
6196
|
+
flicker(duration: number, callback: Function): me.Sprite;
|
|
6144
6197
|
/**
|
|
6145
6198
|
* add an animation <br>
|
|
6146
6199
|
* For fixed-sized cell sprite sheet, the index list must follow the
|
|
@@ -6215,7 +6268,7 @@ export class Sprite {
|
|
|
6215
6268
|
* return false; // do not reset to first frame
|
|
6216
6269
|
* }).bind(this));
|
|
6217
6270
|
**/
|
|
6218
|
-
setCurrentAnimation(name: string, resetAnim: any, _preserve_dt: any):
|
|
6271
|
+
setCurrentAnimation(name: string, resetAnim: any, _preserve_dt: any): me.Sprite;
|
|
6219
6272
|
isDirty: boolean;
|
|
6220
6273
|
/**
|
|
6221
6274
|
* reverse the given or current animation if none is specified
|
|
@@ -6226,7 +6279,7 @@ export class Sprite {
|
|
|
6226
6279
|
* @return {me.Sprite} Reference to this object for method chaining
|
|
6227
6280
|
* @see me.Sprite#animationspeed
|
|
6228
6281
|
*/
|
|
6229
|
-
reverseAnimation(name?: string):
|
|
6282
|
+
reverseAnimation(name?: string): me.Sprite;
|
|
6230
6283
|
/**
|
|
6231
6284
|
* return true if the specified animation is the current one.
|
|
6232
6285
|
* @name isCurrentAnimation
|
|
@@ -6252,7 +6305,7 @@ export class Sprite {
|
|
|
6252
6305
|
* // change the sprite to "shadedDark13.png";
|
|
6253
6306
|
* mySprite.setRegion(game.texture.getRegion("shadedDark13.png"));
|
|
6254
6307
|
*/
|
|
6255
|
-
setRegion(region: any):
|
|
6308
|
+
setRegion(region: any): me.Sprite;
|
|
6256
6309
|
/**
|
|
6257
6310
|
* force the current animation frame index.
|
|
6258
6311
|
* @name setAnimationFrame
|
|
@@ -6264,7 +6317,7 @@ export class Sprite {
|
|
|
6264
6317
|
* // reset the current animation to the first frame
|
|
6265
6318
|
* this.setAnimationFrame();
|
|
6266
6319
|
*/
|
|
6267
|
-
setAnimationFrame(idx: any):
|
|
6320
|
+
setAnimationFrame(idx: any): me.Sprite;
|
|
6268
6321
|
/**
|
|
6269
6322
|
* return the current animation frame index.
|
|
6270
6323
|
* @name getCurrentAnimationFrame
|
|
@@ -6306,7 +6359,7 @@ export class Sprite {
|
|
|
6306
6359
|
* @memberOf me
|
|
6307
6360
|
* @constructor
|
|
6308
6361
|
* @param {Object} [options] The stage` parameters
|
|
6309
|
-
* @param {
|
|
6362
|
+
* @param {me.Camera2d[]} [options.cameras=[new me.Camera2d()]] a list of cameras (experimental)
|
|
6310
6363
|
* @param {Function} [options.onResetEvent] called by the state manager when reseting the object
|
|
6311
6364
|
* @param {Function} [options.onDestroyEvent] called by the state manager before switching to another state
|
|
6312
6365
|
* @see me.state
|
|
@@ -6357,7 +6410,7 @@ export class Stage {
|
|
|
6357
6410
|
* @function
|
|
6358
6411
|
* @param {me.CanvasRenderer|me.WebGLRenderer} renderer a renderer object
|
|
6359
6412
|
*/
|
|
6360
|
-
draw(renderer:
|
|
6413
|
+
draw(renderer: me.CanvasRenderer | me.WebGLRenderer): void;
|
|
6361
6414
|
/**
|
|
6362
6415
|
* destroy function
|
|
6363
6416
|
* @ignore
|
|
@@ -6417,7 +6470,7 @@ export class TMXHexagonalRenderer {
|
|
|
6417
6470
|
* @param {me.TMXLayer} [layer] calculate the bounding rect for a specific layer (will return a new bounds object)
|
|
6418
6471
|
* @return {me.Bounds}
|
|
6419
6472
|
*/
|
|
6420
|
-
public getBounds(layer?:
|
|
6473
|
+
public getBounds(layer?: me.TMXLayer): me.Bounds;
|
|
6421
6474
|
/**
|
|
6422
6475
|
* @ignore
|
|
6423
6476
|
*/
|
|
@@ -6496,7 +6549,7 @@ export class TMXIsometricRenderer {
|
|
|
6496
6549
|
* @param {me.TMXLayer} [layer] calculate the bounding rect for a specific layer (will return a new bounds object)
|
|
6497
6550
|
* @return {me.Bounds}
|
|
6498
6551
|
*/
|
|
6499
|
-
public getBounds(layer?:
|
|
6552
|
+
public getBounds(layer?: me.TMXLayer): me.Bounds;
|
|
6500
6553
|
/**
|
|
6501
6554
|
* return the tile position corresponding to the specified pixel
|
|
6502
6555
|
* @ignore
|
|
@@ -6553,7 +6606,7 @@ export class TMXLayer {
|
|
|
6553
6606
|
* @type me.TMXTilesetGroup
|
|
6554
6607
|
* @name me.TMXLayer#tilesets
|
|
6555
6608
|
*/
|
|
6556
|
-
public tilesets:
|
|
6609
|
+
public tilesets: me.TMXTilesetGroup;
|
|
6557
6610
|
tileset: any;
|
|
6558
6611
|
maxTileSize: {
|
|
6559
6612
|
width: number;
|
|
@@ -6603,8 +6656,8 @@ export class TMXLayer {
|
|
|
6603
6656
|
* var layer = new me.TMXLayer(...);
|
|
6604
6657
|
* layer.setRenderer(map.getRenderer());
|
|
6605
6658
|
*/
|
|
6606
|
-
public setRenderer(renderer:
|
|
6607
|
-
renderer:
|
|
6659
|
+
public setRenderer(renderer: me.TMXRenderer): void;
|
|
6660
|
+
renderer: me.TMXRenderer;
|
|
6608
6661
|
/**
|
|
6609
6662
|
* Return the layer current renderer object
|
|
6610
6663
|
* @name getRenderer
|
|
@@ -6613,7 +6666,7 @@ export class TMXLayer {
|
|
|
6613
6666
|
* @function
|
|
6614
6667
|
* @return {me.TMXRenderer} renderer
|
|
6615
6668
|
*/
|
|
6616
|
-
public getRenderer():
|
|
6669
|
+
public getRenderer(): me.TMXRenderer;
|
|
6617
6670
|
/**
|
|
6618
6671
|
* Return the TileId of the Tile at the specified position
|
|
6619
6672
|
* @name getTileId
|
|
@@ -6638,9 +6691,9 @@ export class TMXLayer {
|
|
|
6638
6691
|
* // get the TMX Map Layer called "Front layer"
|
|
6639
6692
|
* var layer = me.game.world.getChildByName("Front Layer")[0];
|
|
6640
6693
|
* // get the tile object corresponding to the latest pointer position
|
|
6641
|
-
* var tile = layer.getTile(me.input.pointer.
|
|
6694
|
+
* var tile = layer.getTile(me.input.pointer.x, me.input.pointer.y);
|
|
6642
6695
|
*/
|
|
6643
|
-
public getTile(x: number, y: number):
|
|
6696
|
+
public getTile(x: number, y: number): me.Tile;
|
|
6644
6697
|
/**
|
|
6645
6698
|
* assign the given Tile object to the specified position
|
|
6646
6699
|
* @name getTile
|
|
@@ -6652,7 +6705,7 @@ export class TMXLayer {
|
|
|
6652
6705
|
* @param {Number} y Y coordinate (in world/pixels coordinates)
|
|
6653
6706
|
* @return {me.Tile} the tile object
|
|
6654
6707
|
*/
|
|
6655
|
-
public setTile(tile: any, x: number, y: number):
|
|
6708
|
+
public setTile(tile: any, x: number, y: number): me.Tile;
|
|
6656
6709
|
/**
|
|
6657
6710
|
* return a new the Tile object corresponding to the given tile id
|
|
6658
6711
|
* @name setTile
|
|
@@ -6664,7 +6717,7 @@ export class TMXLayer {
|
|
|
6664
6717
|
* @param {Number} y Y coordinate (in world/pixels coordinates)
|
|
6665
6718
|
* @return {me.Tile} the tile object
|
|
6666
6719
|
*/
|
|
6667
|
-
public getTileById(tileId: number, x: number, y: number):
|
|
6720
|
+
public getTileById(tileId: number, x: number, y: number): me.Tile;
|
|
6668
6721
|
/**
|
|
6669
6722
|
* Return the Tile object at the specified tile coordinates
|
|
6670
6723
|
* @name cellAt
|
|
@@ -6679,7 +6732,7 @@ export class TMXLayer {
|
|
|
6679
6732
|
* // return the first tile at offset 0, 0
|
|
6680
6733
|
* var tile = layer.cellAt(0, 0);
|
|
6681
6734
|
*/
|
|
6682
|
-
public cellAt(x: number, y: number, boundsCheck?: number):
|
|
6735
|
+
public cellAt(x: number, y: number, boundsCheck?: number): me.Tile;
|
|
6683
6736
|
/**
|
|
6684
6737
|
* clear the tile at the specified position
|
|
6685
6738
|
* @name clearTile
|
|
@@ -6775,7 +6828,7 @@ export class TMXRenderer {
|
|
|
6775
6828
|
* @param {me.TMXTileMap|me.TMXLayer} component TMX Map or Layer
|
|
6776
6829
|
* @return {boolean}
|
|
6777
6830
|
*/
|
|
6778
|
-
public canRender(component:
|
|
6831
|
+
public canRender(component: me.TMXTileMap | me.TMXLayer): boolean;
|
|
6779
6832
|
/**
|
|
6780
6833
|
* return the bounding rect for this map renderer
|
|
6781
6834
|
* @name me.TMXRenderer#getBounds
|
|
@@ -6784,7 +6837,7 @@ export class TMXRenderer {
|
|
|
6784
6837
|
* @param {me.TMXLayer} [layer] calculate the bounding rect for a specific layer (will return a new bounds object)
|
|
6785
6838
|
* @return {me.Bounds}
|
|
6786
6839
|
*/
|
|
6787
|
-
public getBounds(layer?:
|
|
6840
|
+
public getBounds(layer?: me.TMXLayer): me.Bounds;
|
|
6788
6841
|
/**
|
|
6789
6842
|
* return the tile position corresponding to the specified pixel
|
|
6790
6843
|
* @name me.TMXRenderer#pixelToTileCoords
|
|
@@ -6795,7 +6848,7 @@ export class TMXRenderer {
|
|
|
6795
6848
|
* @param {me.Vector2d} [vector] an optional vector object where to put the return values
|
|
6796
6849
|
* @return {me.Vector2d}
|
|
6797
6850
|
*/
|
|
6798
|
-
public pixelToTileCoords(x: number, y: number, v: any):
|
|
6851
|
+
public pixelToTileCoords(x: number, y: number, v: any): me.Vector2d;
|
|
6799
6852
|
/**
|
|
6800
6853
|
* return the pixel position corresponding of the specified tile
|
|
6801
6854
|
* @name me.TMXRenderer#tileToPixelCoords
|
|
@@ -6806,7 +6859,7 @@ export class TMXRenderer {
|
|
|
6806
6859
|
* @param {me.Vector2d} [vector] an optional vector object where to put the return values
|
|
6807
6860
|
* @return {me.Vector2d}
|
|
6808
6861
|
*/
|
|
6809
|
-
public tileToPixelCoords(x: any, y: any, v: any):
|
|
6862
|
+
public tileToPixelCoords(x: any, y: any, v: any): me.Vector2d;
|
|
6810
6863
|
/**
|
|
6811
6864
|
* draw the given tile at the specified layer
|
|
6812
6865
|
* @name me.TMXRenderer#drawTile
|
|
@@ -6817,7 +6870,7 @@ export class TMXRenderer {
|
|
|
6817
6870
|
* @param {Number} y Y coordinate where to draw the tile
|
|
6818
6871
|
* @param {me.Tile} tile the tile object to draw
|
|
6819
6872
|
*/
|
|
6820
|
-
public drawTile(renderer:
|
|
6873
|
+
public drawTile(renderer: me.CanvasRenderer | me.WebGLRenderer, x: number, y: number, tile: me.Tile): void;
|
|
6821
6874
|
/**
|
|
6822
6875
|
* draw the given TMX Layer for the given area
|
|
6823
6876
|
* @name me.TMXRenderer#drawTileLayer
|
|
@@ -6827,7 +6880,7 @@ export class TMXRenderer {
|
|
|
6827
6880
|
* @param {me.TMXLayer} layer a TMX Layer object
|
|
6828
6881
|
* @param {me.Rect} rect the area of the layer to draw
|
|
6829
6882
|
*/
|
|
6830
|
-
public drawTileLayer(renderer:
|
|
6883
|
+
public drawTileLayer(renderer: me.CanvasRenderer | me.WebGLRenderer, layer: me.TMXLayer, rect: me.Rect): void;
|
|
6831
6884
|
}
|
|
6832
6885
|
/**
|
|
6833
6886
|
* @classdesc
|
|
@@ -6967,7 +7020,7 @@ export class TMXTileMap {
|
|
|
6967
7020
|
* @function
|
|
6968
7021
|
* @return {me.TMXRenderer} a TMX renderer
|
|
6969
7022
|
*/
|
|
6970
|
-
public getRenderer():
|
|
7023
|
+
public getRenderer(): me.TMXRenderer;
|
|
6971
7024
|
renderer: TMXOrthogonalRenderer | TMXIsometricRenderer | TMXHexagonalRenderer | TMXStaggeredRenderer;
|
|
6972
7025
|
/**
|
|
6973
7026
|
* return the map bounding rect
|
|
@@ -6976,7 +7029,7 @@ export class TMXTileMap {
|
|
|
6976
7029
|
* @function
|
|
6977
7030
|
* @return {me.Bounds}
|
|
6978
7031
|
*/
|
|
6979
|
-
public getBounds():
|
|
7032
|
+
public getBounds(): me.Bounds;
|
|
6980
7033
|
/**
|
|
6981
7034
|
* parse the map
|
|
6982
7035
|
* @ignore
|
|
@@ -7007,7 +7060,7 @@ export class TMXTileMap {
|
|
|
7007
7060
|
* when false, a `me.Container` object will be created for each corresponding groups
|
|
7008
7061
|
* @return {me.Renderable[]} Array of Objects
|
|
7009
7062
|
*/
|
|
7010
|
-
public getObjects(flatten?: boolean):
|
|
7063
|
+
public getObjects(flatten?: boolean): me.Renderable[];
|
|
7011
7064
|
/**
|
|
7012
7065
|
* return all the existing layers
|
|
7013
7066
|
* @name me.TMXTileMap#getLayers
|
|
@@ -7015,7 +7068,7 @@ export class TMXTileMap {
|
|
|
7015
7068
|
* @function
|
|
7016
7069
|
* @return {me.TMXLayer[]} Array of Layers
|
|
7017
7070
|
*/
|
|
7018
|
-
public getLayers():
|
|
7071
|
+
public getLayers(): me.TMXLayer[];
|
|
7019
7072
|
/**
|
|
7020
7073
|
* destroy function, clean all allocated objects
|
|
7021
7074
|
* @name me.TMXTileMap#destroy
|
|
@@ -7137,7 +7190,7 @@ export class TMXTilesetGroup {
|
|
|
7137
7190
|
* @function
|
|
7138
7191
|
* @param {me.TMXTileset} tileset
|
|
7139
7192
|
*/
|
|
7140
|
-
public add(tileset:
|
|
7193
|
+
public add(tileset: me.TMXTileset): void;
|
|
7141
7194
|
/**
|
|
7142
7195
|
* return the tileset at the specified index
|
|
7143
7196
|
* @name me.TMXTilesetGroup#getTilesetByIndex
|
|
@@ -7146,7 +7199,7 @@ export class TMXTilesetGroup {
|
|
|
7146
7199
|
* @param {Number} i
|
|
7147
7200
|
* @return {me.TMXTileset} corresponding tileset
|
|
7148
7201
|
*/
|
|
7149
|
-
public getTilesetByIndex(i: number):
|
|
7202
|
+
public getTilesetByIndex(i: number): me.TMXTileset;
|
|
7150
7203
|
/**
|
|
7151
7204
|
* return the tileset corresponding to the specified id <br>
|
|
7152
7205
|
* will throw an exception if no matching tileset is found
|
|
@@ -7156,7 +7209,7 @@ export class TMXTilesetGroup {
|
|
|
7156
7209
|
* @param {Number} gid
|
|
7157
7210
|
* @return {me.TMXTileset} corresponding tileset
|
|
7158
7211
|
*/
|
|
7159
|
-
public getTilesetByGid(gid: number):
|
|
7212
|
+
public getTilesetByGid(gid: number): me.TMXTileset;
|
|
7160
7213
|
}
|
|
7161
7214
|
/**
|
|
7162
7215
|
* @classdesc
|
|
@@ -7177,7 +7230,8 @@ export class TMXTilesetGroup {
|
|
|
7177
7230
|
* @param {String} [settings.textBaseline="top"] the text baseline
|
|
7178
7231
|
* @param {Number} [settings.lineHeight=1.0] line spacing height
|
|
7179
7232
|
* @param {me.Vector2d} [settings.anchorPoint={x:0.0, y:0.0}] anchor point to draw the text at
|
|
7180
|
-
* @param {
|
|
7233
|
+
* @param {Boolean} [settings.offScreenCanvas=false] whether to draw the font to an individual "cache" texture first
|
|
7234
|
+
* @param {(String|String[])} [settings.text=""] a string, or an array of strings
|
|
7181
7235
|
* @example
|
|
7182
7236
|
* var font = new me.Text(0, 0, {font: "Arial", size: 8, fillStyle: this.color});
|
|
7183
7237
|
*/
|
|
@@ -7223,6 +7277,16 @@ export class Text {
|
|
|
7223
7277
|
* @name me.Text#lineHeight
|
|
7224
7278
|
*/
|
|
7225
7279
|
public lineHeight: number;
|
|
7280
|
+
/**
|
|
7281
|
+
* whether to draw the font to a indidividual offscreen canvas texture first <br>
|
|
7282
|
+
* Note: this will improve performances when using WebGL, but will impact
|
|
7283
|
+
* memory consumption as every text element will have its own canvas texture
|
|
7284
|
+
* @public
|
|
7285
|
+
* @type Boolean
|
|
7286
|
+
* @default false
|
|
7287
|
+
* @name me.Text#offScreenCanvas
|
|
7288
|
+
*/
|
|
7289
|
+
public offScreenCanvas: boolean;
|
|
7226
7290
|
/**
|
|
7227
7291
|
* the text to be displayed
|
|
7228
7292
|
* @private
|
|
@@ -7241,6 +7305,10 @@ export class Text {
|
|
|
7241
7305
|
*/
|
|
7242
7306
|
public fontSize: number;
|
|
7243
7307
|
floating: boolean;
|
|
7308
|
+
canvas: any;
|
|
7309
|
+
context: any;
|
|
7310
|
+
/** @ignore */
|
|
7311
|
+
onDeactivateEvent(): void;
|
|
7244
7312
|
/**
|
|
7245
7313
|
* make the font bold
|
|
7246
7314
|
* @name bold
|
|
@@ -7281,18 +7349,18 @@ export class Text {
|
|
|
7281
7349
|
* @param {Number|String|String[]} value a string, or an array of strings
|
|
7282
7350
|
* @return this object for chaining
|
|
7283
7351
|
*/
|
|
7284
|
-
setText(value
|
|
7352
|
+
setText(value?: number | string | string[]): Text;
|
|
7285
7353
|
/**
|
|
7286
7354
|
* measure the given text size in pixels
|
|
7287
7355
|
* @name measureText
|
|
7288
7356
|
* @memberOf me.Text.prototype
|
|
7289
7357
|
* @function
|
|
7290
|
-
* @param {me.CanvasRenderer|me.WebGLRenderer} [renderer] reference
|
|
7358
|
+
* @param {me.CanvasRenderer|me.WebGLRenderer} [renderer] reference to the active renderer
|
|
7291
7359
|
* @param {String} [text] the text to be measured
|
|
7292
7360
|
* @param {me.Rect|me.Bounds} [ret] a object in which to store the text metrics
|
|
7293
7361
|
* @returns {TextMetrics} a TextMetrics object with two properties: `width` and `height`, defining the output dimensions
|
|
7294
7362
|
*/
|
|
7295
|
-
measureText(_renderer: any, text?: string, ret?:
|
|
7363
|
+
measureText(_renderer: any, text?: string, ret?: me.Rect | me.Bounds): TextMetrics;
|
|
7296
7364
|
width: any;
|
|
7297
7365
|
/**
|
|
7298
7366
|
* @ignore
|
|
@@ -7308,7 +7376,7 @@ export class Text {
|
|
|
7308
7376
|
* @param {Number} [x]
|
|
7309
7377
|
* @param {Number} [y]
|
|
7310
7378
|
*/
|
|
7311
|
-
draw(renderer:
|
|
7379
|
+
draw(renderer: me.CanvasRenderer | me.WebGLRenderer, text?: string, x?: number, y?: number, stroke: any): void;
|
|
7312
7380
|
/**
|
|
7313
7381
|
* draw a stroke text at the specified coord, as defined <br>
|
|
7314
7382
|
* by the `lineWidth` and `fillStroke` properties. <br>
|
|
@@ -7321,11 +7389,11 @@ export class Text {
|
|
|
7321
7389
|
* @param {Number} x
|
|
7322
7390
|
* @param {Number} y
|
|
7323
7391
|
*/
|
|
7324
|
-
drawStroke(renderer:
|
|
7392
|
+
drawStroke(renderer: me.CanvasRenderer | me.WebGLRenderer, text: string, x: number, y: number): void;
|
|
7325
7393
|
/**
|
|
7326
7394
|
* @ignore
|
|
7327
7395
|
*/
|
|
7328
|
-
_drawFont(context: any, text: any, x: any, y: any, stroke
|
|
7396
|
+
_drawFont(context: any, text: any, x: any, y: any, stroke?: boolean): any;
|
|
7329
7397
|
/**
|
|
7330
7398
|
* Destroy function
|
|
7331
7399
|
* @ignore
|
|
@@ -7351,7 +7419,7 @@ export class Tile {
|
|
|
7351
7419
|
* @type me.TMXTileset
|
|
7352
7420
|
* @name me.Tile#tileset
|
|
7353
7421
|
*/
|
|
7354
|
-
public tileset:
|
|
7422
|
+
public tileset: me.TMXTileset;
|
|
7355
7423
|
/**
|
|
7356
7424
|
* the tile transformation matrix (if defined)
|
|
7357
7425
|
* @ignore
|
|
@@ -7399,7 +7467,7 @@ export class Tile {
|
|
|
7399
7467
|
* @return {me.Matrix2d) a transformation matrix
|
|
7400
7468
|
* @ignore
|
|
7401
7469
|
*/
|
|
7402
|
-
setTileTransform(transform: any):
|
|
7470
|
+
setTileTransform(transform: any): me.Matrix2d;
|
|
7403
7471
|
/**
|
|
7404
7472
|
* return a renderable object for this Tile object
|
|
7405
7473
|
* @name me.Tile#getRenderable
|
|
@@ -7408,7 +7476,7 @@ export class Tile {
|
|
|
7408
7476
|
* @param {Object} [settings] see {@link me.Sprite}
|
|
7409
7477
|
* @return {me.Renderable} a me.Sprite object
|
|
7410
7478
|
*/
|
|
7411
|
-
public getRenderable(settings?: any):
|
|
7479
|
+
public getRenderable(settings?: any): me.Renderable;
|
|
7412
7480
|
}
|
|
7413
7481
|
/**
|
|
7414
7482
|
* @classdesc
|
|
@@ -7511,8 +7579,8 @@ export class Trigger {
|
|
|
7511
7579
|
* }).onComplete(myFunc);
|
|
7512
7580
|
*/
|
|
7513
7581
|
export class Tween {
|
|
7514
|
-
static get Easing():
|
|
7515
|
-
static get Interpolation():
|
|
7582
|
+
static get Easing(): enum;
|
|
7583
|
+
static get Interpolation(): enum;
|
|
7516
7584
|
constructor(object: any);
|
|
7517
7585
|
/**
|
|
7518
7586
|
* reset the tween object to default value
|
|
@@ -7706,7 +7774,7 @@ export class Vector2d {
|
|
|
7706
7774
|
* @param {Number} y
|
|
7707
7775
|
* @return {me.Vector2d} Reference to this object for method chaining
|
|
7708
7776
|
*/
|
|
7709
|
-
set(x: number, y: number):
|
|
7777
|
+
set(x: number, y: number): me.Vector2d;
|
|
7710
7778
|
/**
|
|
7711
7779
|
* set the Vector x and y properties to 0
|
|
7712
7780
|
* @name setZero
|
|
@@ -7714,7 +7782,7 @@ export class Vector2d {
|
|
|
7714
7782
|
* @function
|
|
7715
7783
|
* @return {me.Vector2d} Reference to this object for method chaining
|
|
7716
7784
|
*/
|
|
7717
|
-
setZero():
|
|
7785
|
+
setZero(): me.Vector2d;
|
|
7718
7786
|
/**
|
|
7719
7787
|
* set the Vector x and y properties using the passed vector
|
|
7720
7788
|
* @name setV
|
|
@@ -7723,7 +7791,7 @@ export class Vector2d {
|
|
|
7723
7791
|
* @param {me.Vector2d} v
|
|
7724
7792
|
* @return {me.Vector2d} Reference to this object for method chaining
|
|
7725
7793
|
*/
|
|
7726
|
-
setV(v:
|
|
7794
|
+
setV(v: me.Vector2d): me.Vector2d;
|
|
7727
7795
|
/**
|
|
7728
7796
|
* Add the passed vector to this vector
|
|
7729
7797
|
* @name add
|
|
@@ -7732,7 +7800,7 @@ export class Vector2d {
|
|
|
7732
7800
|
* @param {me.Vector2d} v
|
|
7733
7801
|
* @return {me.Vector2d} Reference to this object for method chaining
|
|
7734
7802
|
*/
|
|
7735
|
-
add(v:
|
|
7803
|
+
add(v: me.Vector2d): me.Vector2d;
|
|
7736
7804
|
/**
|
|
7737
7805
|
* Substract the passed vector to this vector
|
|
7738
7806
|
* @name sub
|
|
@@ -7741,7 +7809,7 @@ export class Vector2d {
|
|
|
7741
7809
|
* @param {me.Vector2d} v
|
|
7742
7810
|
* @return {me.Vector2d} Reference to this object for method chaining
|
|
7743
7811
|
*/
|
|
7744
|
-
sub(v:
|
|
7812
|
+
sub(v: me.Vector2d): me.Vector2d;
|
|
7745
7813
|
/**
|
|
7746
7814
|
* Multiply this vector values by the given scalar
|
|
7747
7815
|
* @name scale
|
|
@@ -7751,7 +7819,7 @@ export class Vector2d {
|
|
|
7751
7819
|
* @param {Number} [y=x]
|
|
7752
7820
|
* @return {me.Vector2d} Reference to this object for method chaining
|
|
7753
7821
|
*/
|
|
7754
|
-
scale(x: number, y?: number):
|
|
7822
|
+
scale(x: number, y?: number): me.Vector2d;
|
|
7755
7823
|
/**
|
|
7756
7824
|
* Convert this vector into isometric coordinate space
|
|
7757
7825
|
* @name toIso
|
|
@@ -7759,7 +7827,7 @@ export class Vector2d {
|
|
|
7759
7827
|
* @function
|
|
7760
7828
|
* @return {me.Vector2d} Reference to this object for method chaining
|
|
7761
7829
|
*/
|
|
7762
|
-
toIso():
|
|
7830
|
+
toIso(): me.Vector2d;
|
|
7763
7831
|
/**
|
|
7764
7832
|
* Convert this vector into 2d coordinate space
|
|
7765
7833
|
* @name to2d
|
|
@@ -7767,7 +7835,7 @@ export class Vector2d {
|
|
|
7767
7835
|
* @function
|
|
7768
7836
|
* @return {me.Vector2d} Reference to this object for method chaining
|
|
7769
7837
|
*/
|
|
7770
|
-
to2d():
|
|
7838
|
+
to2d(): me.Vector2d;
|
|
7771
7839
|
/**
|
|
7772
7840
|
* Multiply this vector values by the passed vector
|
|
7773
7841
|
* @name scaleV
|
|
@@ -7776,7 +7844,7 @@ export class Vector2d {
|
|
|
7776
7844
|
* @param {me.Vector2d} v
|
|
7777
7845
|
* @return {me.Vector2d} Reference to this object for method chaining
|
|
7778
7846
|
*/
|
|
7779
|
-
scaleV(v:
|
|
7847
|
+
scaleV(v: me.Vector2d): me.Vector2d;
|
|
7780
7848
|
/**
|
|
7781
7849
|
* Divide this vector values by the passed value
|
|
7782
7850
|
* @name div
|
|
@@ -7785,7 +7853,7 @@ export class Vector2d {
|
|
|
7785
7853
|
* @param {Number} value
|
|
7786
7854
|
* @return {me.Vector2d} Reference to this object for method chaining
|
|
7787
7855
|
*/
|
|
7788
|
-
div(n: any):
|
|
7856
|
+
div(n: any): me.Vector2d;
|
|
7789
7857
|
/**
|
|
7790
7858
|
* Update this vector values to absolute values
|
|
7791
7859
|
* @name abs
|
|
@@ -7793,7 +7861,7 @@ export class Vector2d {
|
|
|
7793
7861
|
* @function
|
|
7794
7862
|
* @return {me.Vector2d} Reference to this object for method chaining
|
|
7795
7863
|
*/
|
|
7796
|
-
abs():
|
|
7864
|
+
abs(): me.Vector2d;
|
|
7797
7865
|
/**
|
|
7798
7866
|
* Clamp the vector value within the specified value range
|
|
7799
7867
|
* @name clamp
|
|
@@ -7803,7 +7871,7 @@ export class Vector2d {
|
|
|
7803
7871
|
* @param {Number} high
|
|
7804
7872
|
* @return {me.Vector2d} new me.Vector2d
|
|
7805
7873
|
*/
|
|
7806
|
-
clamp(low: number, high: number):
|
|
7874
|
+
clamp(low: number, high: number): me.Vector2d;
|
|
7807
7875
|
/**
|
|
7808
7876
|
* Clamp this vector value within the specified value range
|
|
7809
7877
|
* @name clampSelf
|
|
@@ -7813,7 +7881,7 @@ export class Vector2d {
|
|
|
7813
7881
|
* @param {Number} high
|
|
7814
7882
|
* @return {me.Vector2d} Reference to this object for method chaining
|
|
7815
7883
|
*/
|
|
7816
|
-
clampSelf(low: number, high: number):
|
|
7884
|
+
clampSelf(low: number, high: number): me.Vector2d;
|
|
7817
7885
|
/**
|
|
7818
7886
|
* Update this vector with the minimum value between this and the passed vector
|
|
7819
7887
|
* @name minV
|
|
@@ -7822,7 +7890,7 @@ export class Vector2d {
|
|
|
7822
7890
|
* @param {me.Vector2d} v
|
|
7823
7891
|
* @return {me.Vector2d} Reference to this object for method chaining
|
|
7824
7892
|
*/
|
|
7825
|
-
minV(v:
|
|
7893
|
+
minV(v: me.Vector2d): me.Vector2d;
|
|
7826
7894
|
/**
|
|
7827
7895
|
* Update this vector with the maximum value between this and the passed vector
|
|
7828
7896
|
* @name maxV
|
|
@@ -7831,7 +7899,7 @@ export class Vector2d {
|
|
|
7831
7899
|
* @param {me.Vector2d} v
|
|
7832
7900
|
* @return {me.Vector2d} Reference to this object for method chaining
|
|
7833
7901
|
*/
|
|
7834
|
-
maxV(v:
|
|
7902
|
+
maxV(v: me.Vector2d): me.Vector2d;
|
|
7835
7903
|
/**
|
|
7836
7904
|
* Floor the vector values
|
|
7837
7905
|
* @name floor
|
|
@@ -7839,7 +7907,7 @@ export class Vector2d {
|
|
|
7839
7907
|
* @function
|
|
7840
7908
|
* @return {me.Vector2d} new me.Vector2d
|
|
7841
7909
|
*/
|
|
7842
|
-
floor():
|
|
7910
|
+
floor(): me.Vector2d;
|
|
7843
7911
|
/**
|
|
7844
7912
|
* Floor this vector values
|
|
7845
7913
|
* @name floorSelf
|
|
@@ -7847,7 +7915,7 @@ export class Vector2d {
|
|
|
7847
7915
|
* @function
|
|
7848
7916
|
* @return {me.Vector2d} Reference to this object for method chaining
|
|
7849
7917
|
*/
|
|
7850
|
-
floorSelf():
|
|
7918
|
+
floorSelf(): me.Vector2d;
|
|
7851
7919
|
/**
|
|
7852
7920
|
* Ceil the vector values
|
|
7853
7921
|
* @name ceil
|
|
@@ -7855,7 +7923,7 @@ export class Vector2d {
|
|
|
7855
7923
|
* @function
|
|
7856
7924
|
* @return {me.Vector2d} new me.Vector2d
|
|
7857
7925
|
*/
|
|
7858
|
-
ceil():
|
|
7926
|
+
ceil(): me.Vector2d;
|
|
7859
7927
|
/**
|
|
7860
7928
|
* Ceil this vector values
|
|
7861
7929
|
* @name ceilSelf
|
|
@@ -7863,7 +7931,7 @@ export class Vector2d {
|
|
|
7863
7931
|
* @function
|
|
7864
7932
|
* @return {me.Vector2d} Reference to this object for method chaining
|
|
7865
7933
|
*/
|
|
7866
|
-
ceilSelf():
|
|
7934
|
+
ceilSelf(): me.Vector2d;
|
|
7867
7935
|
/**
|
|
7868
7936
|
* Negate the vector values
|
|
7869
7937
|
* @name negate
|
|
@@ -7871,7 +7939,7 @@ export class Vector2d {
|
|
|
7871
7939
|
* @function
|
|
7872
7940
|
* @return {me.Vector2d} new me.Vector2d
|
|
7873
7941
|
*/
|
|
7874
|
-
negate():
|
|
7942
|
+
negate(): me.Vector2d;
|
|
7875
7943
|
/**
|
|
7876
7944
|
* Negate this vector values
|
|
7877
7945
|
* @name negateSelf
|
|
@@ -7879,7 +7947,7 @@ export class Vector2d {
|
|
|
7879
7947
|
* @function
|
|
7880
7948
|
* @return {me.Vector2d} Reference to this object for method chaining
|
|
7881
7949
|
*/
|
|
7882
|
-
negateSelf():
|
|
7950
|
+
negateSelf(): me.Vector2d;
|
|
7883
7951
|
/**
|
|
7884
7952
|
* Copy the x,y values of the passed vector to this one
|
|
7885
7953
|
* @name copy
|
|
@@ -7888,7 +7956,7 @@ export class Vector2d {
|
|
|
7888
7956
|
* @param {me.Vector2d} v
|
|
7889
7957
|
* @return {me.Vector2d} Reference to this object for method chaining
|
|
7890
7958
|
*/
|
|
7891
|
-
copy(v:
|
|
7959
|
+
copy(v: me.Vector2d): me.Vector2d;
|
|
7892
7960
|
/**
|
|
7893
7961
|
* return true if the two vectors are the same
|
|
7894
7962
|
* @name equals
|
|
@@ -7914,7 +7982,7 @@ export class Vector2d {
|
|
|
7914
7982
|
* @function
|
|
7915
7983
|
* @return {me.Vector2d} Reference to this object for method chaining
|
|
7916
7984
|
*/
|
|
7917
|
-
normalize():
|
|
7985
|
+
normalize(): me.Vector2d;
|
|
7918
7986
|
/**
|
|
7919
7987
|
* change this vector to be perpendicular to what it was before.<br>
|
|
7920
7988
|
* (Effectively rotates it 90 degrees in a clockwise direction)
|
|
@@ -7923,7 +7991,7 @@ export class Vector2d {
|
|
|
7923
7991
|
* @function
|
|
7924
7992
|
* @return {me.Vector2d} Reference to this object for method chaining
|
|
7925
7993
|
*/
|
|
7926
|
-
perp():
|
|
7994
|
+
perp(): me.Vector2d;
|
|
7927
7995
|
/**
|
|
7928
7996
|
* Rotate this vector (counter-clockwise) by the specified angle (in radians).
|
|
7929
7997
|
* @name rotate
|
|
@@ -7933,7 +8001,7 @@ export class Vector2d {
|
|
|
7933
8001
|
* @param {me.Vector2d|me.ObservableVector2d} [v] an optional point to rotate around
|
|
7934
8002
|
* @return {me.Vector2d} Reference to this object for method chaining
|
|
7935
8003
|
*/
|
|
7936
|
-
rotate(angle: number, v?:
|
|
8004
|
+
rotate(angle: number, v?: me.Vector2d | me.ObservableVector2d): me.Vector2d;
|
|
7937
8005
|
/**
|
|
7938
8006
|
* return the dot product of this vector and the passed one
|
|
7939
8007
|
* @name dotProduct
|
|
@@ -7942,7 +8010,7 @@ export class Vector2d {
|
|
|
7942
8010
|
* @param {me.Vector2d} v
|
|
7943
8011
|
* @return {Number} The dot product.
|
|
7944
8012
|
*/
|
|
7945
|
-
dotProduct(v:
|
|
8013
|
+
dotProduct(v: me.Vector2d): number;
|
|
7946
8014
|
/**
|
|
7947
8015
|
* return the square length of this vector
|
|
7948
8016
|
* @name length2
|
|
@@ -7968,7 +8036,7 @@ export class Vector2d {
|
|
|
7968
8036
|
* @param {Number} alpha distance along the line (alpha = 0 will be this vector, and alpha = 1 will be the given one).
|
|
7969
8037
|
* @return {me.Vector2d} Reference to this object for method chaining
|
|
7970
8038
|
*/
|
|
7971
|
-
lerp(v:
|
|
8039
|
+
lerp(v: me.Vector2d, alpha: number): me.Vector2d;
|
|
7972
8040
|
/**
|
|
7973
8041
|
* return the distance between this vector and the passed one
|
|
7974
8042
|
* @name distance
|
|
@@ -7977,7 +8045,7 @@ export class Vector2d {
|
|
|
7977
8045
|
* @param {me.Vector2d} v
|
|
7978
8046
|
* @return {Number}
|
|
7979
8047
|
*/
|
|
7980
|
-
distance(v:
|
|
8048
|
+
distance(v: me.Vector2d): number;
|
|
7981
8049
|
/**
|
|
7982
8050
|
* return the angle between this vector and the passed one
|
|
7983
8051
|
* @name angle
|
|
@@ -7986,7 +8054,7 @@ export class Vector2d {
|
|
|
7986
8054
|
* @param {me.Vector2d} v
|
|
7987
8055
|
* @return {Number} angle in radians
|
|
7988
8056
|
*/
|
|
7989
|
-
angle(v:
|
|
8057
|
+
angle(v: me.Vector2d): number;
|
|
7990
8058
|
/**
|
|
7991
8059
|
* project this vector on to another vector.
|
|
7992
8060
|
* @name project
|
|
@@ -7995,7 +8063,7 @@ export class Vector2d {
|
|
|
7995
8063
|
* @param {me.Vector2d} v The vector to project onto.
|
|
7996
8064
|
* @return {me.Vector2d} Reference to this object for method chaining
|
|
7997
8065
|
*/
|
|
7998
|
-
project(v:
|
|
8066
|
+
project(v: me.Vector2d): me.Vector2d;
|
|
7999
8067
|
/**
|
|
8000
8068
|
* Project this vector onto a vector of unit length.<br>
|
|
8001
8069
|
* This is slightly more efficient than `project` when dealing with unit vectors.
|
|
@@ -8005,7 +8073,7 @@ export class Vector2d {
|
|
|
8005
8073
|
* @param {me.Vector2d} v The unit vector to project onto.
|
|
8006
8074
|
* @return {me.Vector2d} Reference to this object for method chaining
|
|
8007
8075
|
*/
|
|
8008
|
-
projectN(v:
|
|
8076
|
+
projectN(v: me.Vector2d): me.Vector2d;
|
|
8009
8077
|
/**
|
|
8010
8078
|
* return a clone copy of this vector
|
|
8011
8079
|
* @name clone
|
|
@@ -8013,7 +8081,7 @@ export class Vector2d {
|
|
|
8013
8081
|
* @function
|
|
8014
8082
|
* @return {me.Vector2d} new me.Vector2d
|
|
8015
8083
|
*/
|
|
8016
|
-
clone():
|
|
8084
|
+
clone(): me.Vector2d;
|
|
8017
8085
|
/**
|
|
8018
8086
|
* convert the object to a string representation
|
|
8019
8087
|
* @name toString
|
|
@@ -8055,7 +8123,7 @@ export class Vector3d {
|
|
|
8055
8123
|
* @param {Number} [z=0]
|
|
8056
8124
|
* @return {me.Vector3d} Reference to this object for method chaining
|
|
8057
8125
|
*/
|
|
8058
|
-
set(x: number, y: number, z?: number):
|
|
8126
|
+
set(x: number, y: number, z?: number): me.Vector3d;
|
|
8059
8127
|
/**
|
|
8060
8128
|
* set the Vector x and y properties to 0
|
|
8061
8129
|
* @name setZero
|
|
@@ -8063,7 +8131,7 @@ export class Vector3d {
|
|
|
8063
8131
|
* @function
|
|
8064
8132
|
* @return {me.Vector3d} Reference to this object for method chaining
|
|
8065
8133
|
*/
|
|
8066
|
-
setZero():
|
|
8134
|
+
setZero(): me.Vector3d;
|
|
8067
8135
|
/**
|
|
8068
8136
|
* set the Vector x and y properties using the passed vector
|
|
8069
8137
|
* @name setV
|
|
@@ -8072,7 +8140,7 @@ export class Vector3d {
|
|
|
8072
8140
|
* @param {me.Vector2d|me.Vector3d} v
|
|
8073
8141
|
* @return {me.Vector3d} Reference to this object for method chaining
|
|
8074
8142
|
*/
|
|
8075
|
-
setV(v:
|
|
8143
|
+
setV(v: me.Vector2d | me.Vector3d): me.Vector3d;
|
|
8076
8144
|
/**
|
|
8077
8145
|
* Add the passed vector to this vector
|
|
8078
8146
|
* @name add
|
|
@@ -8081,7 +8149,7 @@ export class Vector3d {
|
|
|
8081
8149
|
* @param {me.Vector2d|me.Vector3d} v
|
|
8082
8150
|
* @return {me.Vector3d} Reference to this object for method chaining
|
|
8083
8151
|
*/
|
|
8084
|
-
add(v:
|
|
8152
|
+
add(v: me.Vector2d | me.Vector3d): me.Vector3d;
|
|
8085
8153
|
/**
|
|
8086
8154
|
* Substract the passed vector to this vector
|
|
8087
8155
|
* @name sub
|
|
@@ -8090,7 +8158,7 @@ export class Vector3d {
|
|
|
8090
8158
|
* @param {me.Vector2d|me.Vector3d} v
|
|
8091
8159
|
* @return {me.Vector3d} Reference to this object for method chaining
|
|
8092
8160
|
*/
|
|
8093
|
-
sub(v:
|
|
8161
|
+
sub(v: me.Vector2d | me.Vector3d): me.Vector3d;
|
|
8094
8162
|
/**
|
|
8095
8163
|
* Multiply this vector values by the given scalar
|
|
8096
8164
|
* @name scale
|
|
@@ -8101,7 +8169,7 @@ export class Vector3d {
|
|
|
8101
8169
|
* @param {Number} [z=1]
|
|
8102
8170
|
* @return {me.Vector3d} Reference to this object for method chaining
|
|
8103
8171
|
*/
|
|
8104
|
-
scale(x: number, y?: number, z?: number):
|
|
8172
|
+
scale(x: number, y?: number, z?: number): me.Vector3d;
|
|
8105
8173
|
/**
|
|
8106
8174
|
* Multiply this vector values by the passed vector
|
|
8107
8175
|
* @name scaleV
|
|
@@ -8110,7 +8178,7 @@ export class Vector3d {
|
|
|
8110
8178
|
* @param {me.Vector2d|me.Vector3d} v
|
|
8111
8179
|
* @return {me.Vector3d} Reference to this object for method chaining
|
|
8112
8180
|
*/
|
|
8113
|
-
scaleV(v:
|
|
8181
|
+
scaleV(v: me.Vector2d | me.Vector3d): me.Vector3d;
|
|
8114
8182
|
/**
|
|
8115
8183
|
* Convert this vector into isometric coordinate space
|
|
8116
8184
|
* @name toIso
|
|
@@ -8118,7 +8186,7 @@ export class Vector3d {
|
|
|
8118
8186
|
* @function
|
|
8119
8187
|
* @return {me.Vector3d} Reference to this object for method chaining
|
|
8120
8188
|
*/
|
|
8121
|
-
toIso():
|
|
8189
|
+
toIso(): me.Vector3d;
|
|
8122
8190
|
/**
|
|
8123
8191
|
* Convert this vector into 2d coordinate space
|
|
8124
8192
|
* @name to2d
|
|
@@ -8126,7 +8194,7 @@ export class Vector3d {
|
|
|
8126
8194
|
* @function
|
|
8127
8195
|
* @return {me.Vector3d} Reference to this object for method chaining
|
|
8128
8196
|
*/
|
|
8129
|
-
to2d():
|
|
8197
|
+
to2d(): me.Vector3d;
|
|
8130
8198
|
/**
|
|
8131
8199
|
* Divide this vector values by the passed value
|
|
8132
8200
|
* @name div
|
|
@@ -8135,7 +8203,7 @@ export class Vector3d {
|
|
|
8135
8203
|
* @param {Number} value
|
|
8136
8204
|
* @return {me.Vector3d} Reference to this object for method chaining
|
|
8137
8205
|
*/
|
|
8138
|
-
div(n: any):
|
|
8206
|
+
div(n: any): me.Vector3d;
|
|
8139
8207
|
/**
|
|
8140
8208
|
* Update this vector values to absolute values
|
|
8141
8209
|
* @name abs
|
|
@@ -8143,7 +8211,7 @@ export class Vector3d {
|
|
|
8143
8211
|
* @function
|
|
8144
8212
|
* @return {me.Vector3d} Reference to this object for method chaining
|
|
8145
8213
|
*/
|
|
8146
|
-
abs():
|
|
8214
|
+
abs(): me.Vector3d;
|
|
8147
8215
|
/**
|
|
8148
8216
|
* Clamp the vector value within the specified value range
|
|
8149
8217
|
* @name clamp
|
|
@@ -8153,7 +8221,7 @@ export class Vector3d {
|
|
|
8153
8221
|
* @param {Number} high
|
|
8154
8222
|
* @return {me.Vector3d} new me.Vector3d
|
|
8155
8223
|
*/
|
|
8156
|
-
clamp(low: number, high: number):
|
|
8224
|
+
clamp(low: number, high: number): me.Vector3d;
|
|
8157
8225
|
/**
|
|
8158
8226
|
* Clamp this vector value within the specified value range
|
|
8159
8227
|
* @name clampSelf
|
|
@@ -8163,7 +8231,7 @@ export class Vector3d {
|
|
|
8163
8231
|
* @param {Number} high
|
|
8164
8232
|
* @return {me.Vector3d} Reference to this object for method chaining
|
|
8165
8233
|
*/
|
|
8166
|
-
clampSelf(low: number, high: number):
|
|
8234
|
+
clampSelf(low: number, high: number): me.Vector3d;
|
|
8167
8235
|
/**
|
|
8168
8236
|
* Update this vector with the minimum value between this and the passed vector
|
|
8169
8237
|
* @name minV
|
|
@@ -8172,7 +8240,7 @@ export class Vector3d {
|
|
|
8172
8240
|
* @param {me.Vector2d|me.Vector3d} v
|
|
8173
8241
|
* @return {me.Vector3d} Reference to this object for method chaining
|
|
8174
8242
|
*/
|
|
8175
|
-
minV(v:
|
|
8243
|
+
minV(v: me.Vector2d | me.Vector3d): me.Vector3d;
|
|
8176
8244
|
/**
|
|
8177
8245
|
* Update this vector with the maximum value between this and the passed vector
|
|
8178
8246
|
* @name maxV
|
|
@@ -8181,7 +8249,7 @@ export class Vector3d {
|
|
|
8181
8249
|
* @param {me.Vector2d|me.Vector3d} v
|
|
8182
8250
|
* @return {me.Vector3d} Reference to this object for method chaining
|
|
8183
8251
|
*/
|
|
8184
|
-
maxV(v:
|
|
8252
|
+
maxV(v: me.Vector2d | me.Vector3d): me.Vector3d;
|
|
8185
8253
|
/**
|
|
8186
8254
|
* Floor the vector values
|
|
8187
8255
|
* @name floor
|
|
@@ -8189,7 +8257,7 @@ export class Vector3d {
|
|
|
8189
8257
|
* @function
|
|
8190
8258
|
* @return {me.Vector3d} new me.Vector3d
|
|
8191
8259
|
*/
|
|
8192
|
-
floor():
|
|
8260
|
+
floor(): me.Vector3d;
|
|
8193
8261
|
/**
|
|
8194
8262
|
* Floor this vector values
|
|
8195
8263
|
* @name floorSelf
|
|
@@ -8197,7 +8265,7 @@ export class Vector3d {
|
|
|
8197
8265
|
* @function
|
|
8198
8266
|
* @return {me.Vector3d} Reference to this object for method chaining
|
|
8199
8267
|
*/
|
|
8200
|
-
floorSelf():
|
|
8268
|
+
floorSelf(): me.Vector3d;
|
|
8201
8269
|
/**
|
|
8202
8270
|
* Ceil the vector values
|
|
8203
8271
|
* @name ceil
|
|
@@ -8205,7 +8273,7 @@ export class Vector3d {
|
|
|
8205
8273
|
* @function
|
|
8206
8274
|
* @return {me.Vector3d} new me.Vector3d
|
|
8207
8275
|
*/
|
|
8208
|
-
ceil():
|
|
8276
|
+
ceil(): me.Vector3d;
|
|
8209
8277
|
/**
|
|
8210
8278
|
* Ceil this vector values
|
|
8211
8279
|
* @name ceilSelf
|
|
@@ -8213,7 +8281,7 @@ export class Vector3d {
|
|
|
8213
8281
|
* @function
|
|
8214
8282
|
* @return {me.Vector3d} Reference to this object for method chaining
|
|
8215
8283
|
*/
|
|
8216
|
-
ceilSelf():
|
|
8284
|
+
ceilSelf(): me.Vector3d;
|
|
8217
8285
|
/**
|
|
8218
8286
|
* Negate the vector values
|
|
8219
8287
|
* @name negate
|
|
@@ -8221,7 +8289,7 @@ export class Vector3d {
|
|
|
8221
8289
|
* @function
|
|
8222
8290
|
* @return {me.Vector3d} new me.Vector3d
|
|
8223
8291
|
*/
|
|
8224
|
-
negate():
|
|
8292
|
+
negate(): me.Vector3d;
|
|
8225
8293
|
/**
|
|
8226
8294
|
* Negate this vector values
|
|
8227
8295
|
* @name negateSelf
|
|
@@ -8229,7 +8297,7 @@ export class Vector3d {
|
|
|
8229
8297
|
* @function
|
|
8230
8298
|
* @return {me.Vector3d} Reference to this object for method chaining
|
|
8231
8299
|
*/
|
|
8232
|
-
negateSelf():
|
|
8300
|
+
negateSelf(): me.Vector3d;
|
|
8233
8301
|
/**
|
|
8234
8302
|
* Copy the components of the given vector into this one
|
|
8235
8303
|
* @name copy
|
|
@@ -8238,7 +8306,7 @@ export class Vector3d {
|
|
|
8238
8306
|
* @param {me.Vector2d|me.Vector3d} v
|
|
8239
8307
|
* @return {me.Vector3d} Reference to this object for method chaining
|
|
8240
8308
|
*/
|
|
8241
|
-
copy(v:
|
|
8309
|
+
copy(v: me.Vector2d | me.Vector3d): me.Vector3d;
|
|
8242
8310
|
/**
|
|
8243
8311
|
* return true if the two vectors are the same
|
|
8244
8312
|
* @name equals
|
|
@@ -8265,7 +8333,7 @@ export class Vector3d {
|
|
|
8265
8333
|
* @function
|
|
8266
8334
|
* @return {me.Vector3d} Reference to this object for method chaining
|
|
8267
8335
|
*/
|
|
8268
|
-
normalize():
|
|
8336
|
+
normalize(): me.Vector3d;
|
|
8269
8337
|
/**
|
|
8270
8338
|
* change this vector to be perpendicular to what it was before.<br>
|
|
8271
8339
|
* (Effectively rotates it 90 degrees in a clockwise direction around the z axis)
|
|
@@ -8274,7 +8342,7 @@ export class Vector3d {
|
|
|
8274
8342
|
* @function
|
|
8275
8343
|
* @return {me.Vector3d} Reference to this object for method chaining
|
|
8276
8344
|
*/
|
|
8277
|
-
perp():
|
|
8345
|
+
perp(): me.Vector3d;
|
|
8278
8346
|
/**
|
|
8279
8347
|
* Rotate this vector (counter-clockwise) by the specified angle (in radians) around the z axis
|
|
8280
8348
|
* @name rotate
|
|
@@ -8284,7 +8352,7 @@ export class Vector3d {
|
|
|
8284
8352
|
* @param {me.Vector2d|me.ObservableVector2d} [v] an optional point to rotate around (on the same z axis)
|
|
8285
8353
|
* @return {me.Vector3d} Reference to this object for method chaining
|
|
8286
8354
|
*/
|
|
8287
|
-
rotate(angle: number, v?:
|
|
8355
|
+
rotate(angle: number, v?: me.Vector2d | me.ObservableVector2d): me.Vector3d;
|
|
8288
8356
|
/**
|
|
8289
8357
|
* return the dot product of this vector and the passed one
|
|
8290
8358
|
* @name dotProduct
|
|
@@ -8293,7 +8361,7 @@ export class Vector3d {
|
|
|
8293
8361
|
* @param {me.Vector2d|me.Vector3d} v
|
|
8294
8362
|
* @return {Number} The dot product.
|
|
8295
8363
|
*/
|
|
8296
|
-
dotProduct(v:
|
|
8364
|
+
dotProduct(v: me.Vector2d | me.Vector3d): number;
|
|
8297
8365
|
/**
|
|
8298
8366
|
* return the square length of this vector
|
|
8299
8367
|
* @name length2
|
|
@@ -8319,7 +8387,7 @@ export class Vector3d {
|
|
|
8319
8387
|
* @param {Number} alpha distance along the line (alpha = 0 will be this vector, and alpha = 1 will be the given one).
|
|
8320
8388
|
* @return {me.Vector3d} Reference to this object for method chaining
|
|
8321
8389
|
*/
|
|
8322
|
-
lerp(v:
|
|
8390
|
+
lerp(v: me.Vector3d, alpha: number): me.Vector3d;
|
|
8323
8391
|
/**
|
|
8324
8392
|
* return the distance between this vector and the passed one
|
|
8325
8393
|
* @name distance
|
|
@@ -8328,7 +8396,7 @@ export class Vector3d {
|
|
|
8328
8396
|
* @param {me.Vector2d|me.Vector3d} v
|
|
8329
8397
|
* @return {Number}
|
|
8330
8398
|
*/
|
|
8331
|
-
distance(v:
|
|
8399
|
+
distance(v: me.Vector2d | me.Vector3d): number;
|
|
8332
8400
|
/**
|
|
8333
8401
|
* return the angle between this vector and the passed one
|
|
8334
8402
|
* @name angle
|
|
@@ -8337,7 +8405,7 @@ export class Vector3d {
|
|
|
8337
8405
|
* @param {me.Vector2d|me.Vector3d} v
|
|
8338
8406
|
* @return {Number} angle in radians
|
|
8339
8407
|
*/
|
|
8340
|
-
angle(v:
|
|
8408
|
+
angle(v: me.Vector2d | me.Vector3d): number;
|
|
8341
8409
|
/**
|
|
8342
8410
|
* project this vector on to another vector.
|
|
8343
8411
|
* @name project
|
|
@@ -8346,7 +8414,7 @@ export class Vector3d {
|
|
|
8346
8414
|
* @param {me.Vector2d|me.Vector3d} v The vector to project onto.
|
|
8347
8415
|
* @return {me.Vector3d} Reference to this object for method chaining
|
|
8348
8416
|
*/
|
|
8349
|
-
project(v:
|
|
8417
|
+
project(v: me.Vector2d | me.Vector3d): me.Vector3d;
|
|
8350
8418
|
/**
|
|
8351
8419
|
* Project this vector onto a vector of unit length.<br>
|
|
8352
8420
|
* This is slightly more efficient than `project` when dealing with unit vectors.
|
|
@@ -8356,7 +8424,7 @@ export class Vector3d {
|
|
|
8356
8424
|
* @param {me.Vector2d|me.Vector3d} v The unit vector to project onto.
|
|
8357
8425
|
* @return {me.Vector3d} Reference to this object for method chaining
|
|
8358
8426
|
*/
|
|
8359
|
-
projectN(v:
|
|
8427
|
+
projectN(v: me.Vector2d | me.Vector3d): me.Vector3d;
|
|
8360
8428
|
/**
|
|
8361
8429
|
* return a clone copy of this vector
|
|
8362
8430
|
* @name clone
|
|
@@ -8364,7 +8432,7 @@ export class Vector3d {
|
|
|
8364
8432
|
* @function
|
|
8365
8433
|
* @return {me.Vector3d} new me.Vector3d
|
|
8366
8434
|
*/
|
|
8367
|
-
clone():
|
|
8435
|
+
clone(): me.Vector3d;
|
|
8368
8436
|
/**
|
|
8369
8437
|
* convert the object to a string representation
|
|
8370
8438
|
* @name toString
|
|
@@ -8397,14 +8465,11 @@ export class WebGLCompositor {
|
|
|
8397
8465
|
* @type Number
|
|
8398
8466
|
* @readonly
|
|
8399
8467
|
*/
|
|
8400
|
-
readonly
|
|
8401
|
-
currentTextureUnit: any;
|
|
8468
|
+
readonly currentTextureUnit: number;
|
|
8402
8469
|
boundTextures: any[];
|
|
8403
|
-
v: Vector2d[];
|
|
8404
8470
|
renderer: any;
|
|
8405
8471
|
gl: any;
|
|
8406
8472
|
color: any;
|
|
8407
|
-
tint: any;
|
|
8408
8473
|
viewMatrix: any;
|
|
8409
8474
|
/**
|
|
8410
8475
|
* a reference to the active WebGL shader
|
|
@@ -8412,7 +8477,7 @@ export class WebGLCompositor {
|
|
|
8412
8477
|
* @memberOf me.WebGLCompositor
|
|
8413
8478
|
* @type {me.GLShader}
|
|
8414
8479
|
*/
|
|
8415
|
-
activeShader:
|
|
8480
|
+
activeShader: me.GLShader;
|
|
8416
8481
|
/**
|
|
8417
8482
|
* primitive type to render (gl.POINTS, gl.LINE_STRIP, gl.LINE_LOOP, gl.LINES, gl.TRIANGLE_STRIP, gl.TRIANGLE_FAN, gl.TRIANGLES)
|
|
8418
8483
|
* @name mode
|
|
@@ -8430,9 +8495,7 @@ export class WebGLCompositor {
|
|
|
8430
8495
|
attributes: any[];
|
|
8431
8496
|
primitiveShader: GLShader;
|
|
8432
8497
|
quadShader: GLShader;
|
|
8433
|
-
|
|
8434
|
-
sbIndex: number;
|
|
8435
|
-
stream: Float32Array;
|
|
8498
|
+
vertexBuffer: VertexArrayBuffer;
|
|
8436
8499
|
/**
|
|
8437
8500
|
* Reset compositor internal state
|
|
8438
8501
|
* @ignore
|
|
@@ -8446,7 +8509,7 @@ export class WebGLCompositor {
|
|
|
8446
8509
|
* @param {String} name name of the attribute in the vertex shader
|
|
8447
8510
|
* @param {Number} size number of components per vertex attribute. Must be 1, 2, 3, or 4.
|
|
8448
8511
|
* @param {GLenum} type data type of each component in the array
|
|
8449
|
-
* @param {Boolean} normalized whether integer data values should be normalized into a certain
|
|
8512
|
+
* @param {Boolean} normalized whether integer data values should be normalized into a certain range when being cast to a float
|
|
8450
8513
|
* @param {Number} offset offset in bytes of the first component in the vertex attribute array
|
|
8451
8514
|
*/
|
|
8452
8515
|
addAttribute(name: string, size: number, type: GLenum, normalized: boolean, offset: number): void;
|
|
@@ -8478,30 +8541,28 @@ export class WebGLCompositor {
|
|
|
8478
8541
|
* @param {Boolean} [mipmap=true] Whether mipmap levels should be generated for this texture
|
|
8479
8542
|
* @return {WebGLTexture} a WebGL texture
|
|
8480
8543
|
*/
|
|
8481
|
-
createTexture2D(unit: number, image: (new (width?: number, height?: number) => HTMLImageElement) |
|
|
8544
|
+
createTexture2D(unit: number, image: (new (width?: number, height?: number) => HTMLImageElement) | Canvas | ImageData | UInt8Array[] | Float32Array[], filter: number, repeat?: string, w?: number, h?: number, b?: number, premultipliedAlpha?: boolean, mipmap?: boolean): WebGLTexture;
|
|
8482
8545
|
/**
|
|
8483
8546
|
* assign the given WebGL texture to the current batch
|
|
8484
|
-
* @name
|
|
8547
|
+
* @name bindTexture2D
|
|
8485
8548
|
* @memberOf me.WebGLCompositor
|
|
8486
8549
|
* @function
|
|
8487
8550
|
* @param {WebGLTexture} a WebGL texture
|
|
8488
8551
|
* @param {Number} unit Texture unit to which the given texture is bound
|
|
8489
8552
|
*/
|
|
8490
|
-
|
|
8491
|
-
/**
|
|
8492
|
-
* @ignore
|
|
8493
|
-
*/
|
|
8494
|
-
uploadTexture(texture: any, w: any, h: any, b: any, force: any): any;
|
|
8553
|
+
bindTexture2D(texture: any, unit: number): void;
|
|
8495
8554
|
/**
|
|
8496
|
-
*
|
|
8497
|
-
* @
|
|
8555
|
+
* unbind the given WebGL texture, forcing it to be reuploaded
|
|
8556
|
+
* @name unbindTexture2D
|
|
8557
|
+
* @memberOf me.WebGLCompositor
|
|
8558
|
+
* @function
|
|
8559
|
+
* @param {WebGLTexture} a WebGL texture
|
|
8498
8560
|
*/
|
|
8499
|
-
|
|
8561
|
+
unbindTexture2D(texture: any): void;
|
|
8500
8562
|
/**
|
|
8501
|
-
* Resize the stream buffer, retaining its original contents
|
|
8502
8563
|
* @ignore
|
|
8503
8564
|
*/
|
|
8504
|
-
|
|
8565
|
+
uploadTexture(texture: any, w: any, h: any, b: any, force: any): number;
|
|
8505
8566
|
/**
|
|
8506
8567
|
* Select the shader to use for compositing
|
|
8507
8568
|
* @name useShader
|
|
@@ -8510,37 +8571,41 @@ export class WebGLCompositor {
|
|
|
8510
8571
|
* @function
|
|
8511
8572
|
* @param {me.GLShader} shader a reference to a GLShader instance
|
|
8512
8573
|
*/
|
|
8513
|
-
useShader(shader:
|
|
8574
|
+
useShader(shader: me.GLShader): void;
|
|
8514
8575
|
/**
|
|
8515
8576
|
* Add a textured quad
|
|
8516
8577
|
* @name addQuad
|
|
8517
8578
|
* @memberOf me.WebGLCompositor
|
|
8518
8579
|
* @function
|
|
8519
8580
|
* @param {me.Renderer.Texture} texture Source texture
|
|
8520
|
-
* @param {String} key Source texture region name
|
|
8521
8581
|
* @param {Number} x Destination x-coordinate
|
|
8522
8582
|
* @param {Number} y Destination y-coordinate
|
|
8523
8583
|
* @param {Number} w Destination width
|
|
8524
8584
|
* @param {Number} h Destination height
|
|
8585
|
+
* @param {number} u0 Texture UV (u0) value.
|
|
8586
|
+
* @param {number} v0 Texture UV (v0) value.
|
|
8587
|
+
* @param {number} u1 Texture UV (u1) value.
|
|
8588
|
+
* @param {number} v1 Texture UV (v1) value.
|
|
8589
|
+
* @param {number} tint tint color to be applied to the texture in UINT32 format
|
|
8525
8590
|
*/
|
|
8526
|
-
addQuad(texture:
|
|
8591
|
+
addQuad(texture: me.Renderer.Texture, x: number, y: number, w: number, h: number, u0: number, v0: number, u1: number, v1: number, tint: number): void;
|
|
8527
8592
|
/**
|
|
8528
8593
|
* Flush batched texture operations to the GPU
|
|
8529
8594
|
* @param
|
|
8530
8595
|
* @memberOf me.WebGLCompositor
|
|
8531
8596
|
* @function
|
|
8532
8597
|
*/
|
|
8533
|
-
flush(): void;
|
|
8598
|
+
flush(mode?: any): void;
|
|
8534
8599
|
/**
|
|
8535
8600
|
* Draw an array of vertices
|
|
8536
8601
|
* @name drawVertices
|
|
8537
8602
|
* @memberOf me.WebGLCompositor
|
|
8538
8603
|
* @function
|
|
8539
|
-
* @param {GLENUM}
|
|
8540
|
-
* @param {me.Vector2d[]}
|
|
8604
|
+
* @param {GLENUM} mode primitive type to render (gl.POINTS, gl.LINE_STRIP, gl.LINE_LOOP, gl.LINES, gl.TRIANGLE_STRIP, gl.TRIANGLE_FAN, gl.TRIANGLES)
|
|
8605
|
+
* @param {me.Vector2d[]} verts vertices
|
|
8541
8606
|
* @param {Number} [vertexCount=verts.length] amount of points defined in the points array
|
|
8542
8607
|
*/
|
|
8543
|
-
drawVertices(mode
|
|
8608
|
+
drawVertices(mode: GLENUM, verts: me.Vector2d[], vertexCount?: number): void;
|
|
8544
8609
|
/**
|
|
8545
8610
|
* Specify the color values used when clearing color buffers. The values are clamped between 0 and 1.
|
|
8546
8611
|
* @name clearColor
|
|
@@ -8584,14 +8649,6 @@ export class WebGLCompositor {
|
|
|
8584
8649
|
*/
|
|
8585
8650
|
export class WebGLRenderer {
|
|
8586
8651
|
constructor(options: any);
|
|
8587
|
-
/**
|
|
8588
|
-
* The WebGL context
|
|
8589
|
-
* @name gl
|
|
8590
|
-
* @memberOf me.WebGLRenderer
|
|
8591
|
-
* type {WebGLRenderingContext}
|
|
8592
|
-
*/
|
|
8593
|
-
context: WebGLRenderingContext;
|
|
8594
|
-
gl: WebGLRenderingContext;
|
|
8595
8652
|
/**
|
|
8596
8653
|
* The WebGL version used by this renderer (1 or 2)
|
|
8597
8654
|
* @name WebGLVersion
|
|
@@ -8600,7 +8657,7 @@ export class WebGLRenderer {
|
|
|
8600
8657
|
* @default 1
|
|
8601
8658
|
* @readonly
|
|
8602
8659
|
*/
|
|
8603
|
-
readonly
|
|
8660
|
+
readonly WebGLVersion: number;
|
|
8604
8661
|
/**
|
|
8605
8662
|
* The vendor string of the underlying graphics driver.
|
|
8606
8663
|
* @name GPUVendor
|
|
@@ -8619,6 +8676,14 @@ export class WebGLRenderer {
|
|
|
8619
8676
|
* @readonly
|
|
8620
8677
|
*/
|
|
8621
8678
|
readonly GPURenderer: string;
|
|
8679
|
+
/**
|
|
8680
|
+
* The WebGL context
|
|
8681
|
+
* @name gl
|
|
8682
|
+
* @memberOf me.WebGLRenderer
|
|
8683
|
+
* type {WebGLRenderingContext}
|
|
8684
|
+
*/
|
|
8685
|
+
context: WebGLRenderingContext;
|
|
8686
|
+
gl: WebGLRenderingContext;
|
|
8622
8687
|
/**
|
|
8623
8688
|
* Maximum number of texture unit supported under the current context
|
|
8624
8689
|
* @name maxTextures
|
|
@@ -8649,14 +8714,14 @@ export class WebGLRenderer {
|
|
|
8649
8714
|
* @type me.Matrix2d
|
|
8650
8715
|
* @memberOf me.WebGLRenderer#
|
|
8651
8716
|
*/
|
|
8652
|
-
currentTransform:
|
|
8717
|
+
currentTransform: me.Matrix2d;
|
|
8653
8718
|
/**
|
|
8654
8719
|
* The current compositor used by the renderer
|
|
8655
8720
|
* @name currentCompositor
|
|
8656
8721
|
* @type me.WebGLCompositor
|
|
8657
8722
|
* @memberOf me.WebGLRenderer#
|
|
8658
8723
|
*/
|
|
8659
|
-
currentCompositor:
|
|
8724
|
+
currentCompositor: me.WebGLCompositor;
|
|
8660
8725
|
cache: TextureCache;
|
|
8661
8726
|
isContextValid: boolean;
|
|
8662
8727
|
/**
|
|
@@ -8709,7 +8774,7 @@ export class WebGLRenderer {
|
|
|
8709
8774
|
* var vertical = renderer.createPattern(image, "repeat-y");
|
|
8710
8775
|
* var basic = renderer.createPattern(image, "no-repeat");
|
|
8711
8776
|
*/
|
|
8712
|
-
createPattern(image: any, repeat: string):
|
|
8777
|
+
createPattern(image: any, repeat: string): me.Renderer.Texture;
|
|
8713
8778
|
/**
|
|
8714
8779
|
* Flush the compositor to the frame buffer
|
|
8715
8780
|
* @name flush
|
|
@@ -8776,7 +8841,7 @@ export class WebGLRenderer {
|
|
|
8776
8841
|
* @param {Number} height
|
|
8777
8842
|
* @see me.WebGLRenderer#createPattern
|
|
8778
8843
|
*/
|
|
8779
|
-
drawPattern(pattern:
|
|
8844
|
+
drawPattern(pattern: me.Renderer.Texture, x: number, y: number, width: number, height: number): void;
|
|
8780
8845
|
/**
|
|
8781
8846
|
* return a reference to the screen canvas corresponding WebGL Context
|
|
8782
8847
|
* @name getScreenContext
|
|
@@ -8794,8 +8859,7 @@ export class WebGLRenderer {
|
|
|
8794
8859
|
* @param {Boolean} [transparent=true] use false to disable transparency
|
|
8795
8860
|
* @return {WebGLRenderingContext}
|
|
8796
8861
|
*/
|
|
8797
|
-
getContextGL(canvas:
|
|
8798
|
-
WebGLVersion: number;
|
|
8862
|
+
getContextGL(canvas: Canvas, transparent?: boolean): WebGLRenderingContext;
|
|
8799
8863
|
/**
|
|
8800
8864
|
* Returns the WebGLContext instance for the renderer
|
|
8801
8865
|
* return a reference to the system 2d Context
|
|
@@ -8872,7 +8936,7 @@ export class WebGLRenderer {
|
|
|
8872
8936
|
* @function
|
|
8873
8937
|
* @param {me.Color|String} color css color string.
|
|
8874
8938
|
*/
|
|
8875
|
-
setColor(color:
|
|
8939
|
+
setColor(color: me.Color | string): void;
|
|
8876
8940
|
/**
|
|
8877
8941
|
* Set the line width
|
|
8878
8942
|
* @name setLineWidth
|
|
@@ -8961,7 +9025,7 @@ export class WebGLRenderer {
|
|
|
8961
9025
|
* @param {me.Polygon} poly the shape to draw
|
|
8962
9026
|
* @param {Boolean} [fill=false] also fill the shape with the current color if true
|
|
8963
9027
|
*/
|
|
8964
|
-
strokePolygon(poly:
|
|
9028
|
+
strokePolygon(poly: me.Polygon, fill?: boolean): void;
|
|
8965
9029
|
/**
|
|
8966
9030
|
* Fill a me.Polygon on the screen
|
|
8967
9031
|
* @name fillPolygon
|
|
@@ -8969,7 +9033,7 @@ export class WebGLRenderer {
|
|
|
8969
9033
|
* @function
|
|
8970
9034
|
* @param {me.Polygon} poly the shape to draw
|
|
8971
9035
|
*/
|
|
8972
|
-
fillPolygon(poly:
|
|
9036
|
+
fillPolygon(poly: me.Polygon): void;
|
|
8973
9037
|
/**
|
|
8974
9038
|
* Draw a stroke rectangle at the specified coordinates
|
|
8975
9039
|
* @name strokeRect
|
|
@@ -9001,7 +9065,7 @@ export class WebGLRenderer {
|
|
|
9001
9065
|
* @function
|
|
9002
9066
|
* @param {me.Matrix2d} mat2d Matrix to transform by
|
|
9003
9067
|
*/
|
|
9004
|
-
setTransform(mat2d:
|
|
9068
|
+
setTransform(mat2d: me.Matrix2d): void;
|
|
9005
9069
|
/**
|
|
9006
9070
|
* Multiply given matrix into the renderer tranformation matrix
|
|
9007
9071
|
* @name transform
|
|
@@ -9009,7 +9073,7 @@ export class WebGLRenderer {
|
|
|
9009
9073
|
* @function
|
|
9010
9074
|
* @param {me.Matrix2d} mat2d Matrix to transform by
|
|
9011
9075
|
*/
|
|
9012
|
-
transform(mat2d:
|
|
9076
|
+
transform(mat2d: me.Matrix2d): void;
|
|
9013
9077
|
/**
|
|
9014
9078
|
* Translates the uniform matrix by the given coordinates
|
|
9015
9079
|
* @name translate
|
|
@@ -9043,7 +9107,7 @@ export class WebGLRenderer {
|
|
|
9043
9107
|
* @function
|
|
9044
9108
|
* @param {me.Rect|me.Polygon|me.Line|me.Ellipse} [mask] the shape defining the mask to be applied
|
|
9045
9109
|
*/
|
|
9046
|
-
setMask(mask?:
|
|
9110
|
+
setMask(mask?: me.Rect | me.Polygon | me.Line | me.Ellipse): void;
|
|
9047
9111
|
/**
|
|
9048
9112
|
* disable (remove) the rendering mask set through setMask.
|
|
9049
9113
|
* @name clearMask
|
|
@@ -9054,8 +9118,9 @@ export class WebGLRenderer {
|
|
|
9054
9118
|
clearMask(): void;
|
|
9055
9119
|
}
|
|
9056
9120
|
/**
|
|
9121
|
+
* @classdesc
|
|
9057
9122
|
* an object representing the physic world, and responsible for managing and updating all childs and physics
|
|
9058
|
-
* @class
|
|
9123
|
+
* @class World
|
|
9059
9124
|
* @extends me.Container
|
|
9060
9125
|
* @memberOf me
|
|
9061
9126
|
* @constructor
|
|
@@ -9080,7 +9145,7 @@ export class World {
|
|
|
9080
9145
|
* @memberOf me.World
|
|
9081
9146
|
* @see me.timer.maxfps
|
|
9082
9147
|
*/
|
|
9083
|
-
public fps:
|
|
9148
|
+
public fps: me.Vector2d;
|
|
9084
9149
|
/**
|
|
9085
9150
|
* world gravity
|
|
9086
9151
|
* @public
|
|
@@ -9089,7 +9154,7 @@ export class World {
|
|
|
9089
9154
|
* @name gravity
|
|
9090
9155
|
* @memberOf me.World
|
|
9091
9156
|
*/
|
|
9092
|
-
public gravity:
|
|
9157
|
+
public gravity: me.Vector2d;
|
|
9093
9158
|
/**
|
|
9094
9159
|
* Specify the rendering method for tile layers. <br>
|
|
9095
9160
|
* if false visible part of the layers are rendered dynamically,<br>
|
|
@@ -9118,7 +9183,7 @@ export class World {
|
|
|
9118
9183
|
* @public
|
|
9119
9184
|
* @type {me.QuadTree}
|
|
9120
9185
|
*/
|
|
9121
|
-
public broadphase:
|
|
9186
|
+
public broadphase: me.QuadTree;
|
|
9122
9187
|
/**
|
|
9123
9188
|
* reset the game world
|
|
9124
9189
|
* @name reset
|
|
@@ -9135,7 +9200,7 @@ export class World {
|
|
|
9135
9200
|
* @param {me.Body} body
|
|
9136
9201
|
* @return {me.World} this game world
|
|
9137
9202
|
*/
|
|
9138
|
-
addBody(body:
|
|
9203
|
+
addBody(body: me.Body): me.World;
|
|
9139
9204
|
/**
|
|
9140
9205
|
* Remove a physic body from the game world
|
|
9141
9206
|
* @name removeBody
|
|
@@ -9145,7 +9210,7 @@ export class World {
|
|
|
9145
9210
|
* @param {me.Body} body
|
|
9146
9211
|
* @return {me.World} this game world
|
|
9147
9212
|
*/
|
|
9148
|
-
removeBody(body:
|
|
9213
|
+
removeBody(body: me.Body): me.World;
|
|
9149
9214
|
/**
|
|
9150
9215
|
* update the game world
|
|
9151
9216
|
* @name reset
|
|
@@ -9239,7 +9304,7 @@ export namespace collision {
|
|
|
9239
9304
|
* // ...
|
|
9240
9305
|
* }
|
|
9241
9306
|
*/
|
|
9242
|
-
export function rayCast(line:
|
|
9307
|
+
export function rayCast(line: me.Line, resultArray: any): me.Renderable[];
|
|
9243
9308
|
/**
|
|
9244
9309
|
* Checks for object colliding with the given line
|
|
9245
9310
|
* @name rayCast
|
|
@@ -9267,7 +9332,7 @@ export namespace collision {
|
|
|
9267
9332
|
* // ...
|
|
9268
9333
|
* }
|
|
9269
9334
|
*/
|
|
9270
|
-
export function rayCast(line:
|
|
9335
|
+
export function rayCast(line: me.Line, resultArray: any): me.Renderable[];
|
|
9271
9336
|
}
|
|
9272
9337
|
export var deprecated: Readonly<{
|
|
9273
9338
|
__proto__: any;
|
|
@@ -9279,6 +9344,7 @@ declare namespace device$1 {
|
|
|
9279
9344
|
const localStorage: boolean;
|
|
9280
9345
|
const hasAccelerometer: boolean;
|
|
9281
9346
|
const hasDeviceOrientation: boolean;
|
|
9347
|
+
const ScreenOrientation: boolean;
|
|
9282
9348
|
const hasFullscreenSupport: boolean;
|
|
9283
9349
|
const hasPointerLockSupport: boolean;
|
|
9284
9350
|
const hasWebAudio: boolean;
|
|
@@ -9905,8 +9971,8 @@ export var event: Readonly<{
|
|
|
9905
9971
|
}>;
|
|
9906
9972
|
export var game: Readonly<{
|
|
9907
9973
|
__proto__: any;
|
|
9908
|
-
readonly viewport:
|
|
9909
|
-
readonly world:
|
|
9974
|
+
readonly viewport: me.Camera2d;
|
|
9975
|
+
readonly world: me.World;
|
|
9910
9976
|
mergeGroup: boolean;
|
|
9911
9977
|
sortOn: string;
|
|
9912
9978
|
readonly lastUpdate: number;
|
|
@@ -9930,7 +9996,7 @@ export var input: Readonly<{
|
|
|
9930
9996
|
__proto__: any;
|
|
9931
9997
|
preventDefault: boolean;
|
|
9932
9998
|
readonly pointerEventTarget: EventTarget;
|
|
9933
|
-
|
|
9999
|
+
pointer: me.Rect;
|
|
9934
10000
|
readonly throttlingInterval: number;
|
|
9935
10001
|
globalToLocal: typeof globalToLocal;
|
|
9936
10002
|
setTouchAction: typeof setTouchAction;
|
|
@@ -10284,7 +10350,7 @@ export namespace level {
|
|
|
10284
10350
|
* me.game.world.addChild(levelContainer);
|
|
10285
10351
|
*/
|
|
10286
10352
|
function load(levelId: any, options?: {
|
|
10287
|
-
container?:
|
|
10353
|
+
container?: me.Container;
|
|
10288
10354
|
onLoaded?: Function;
|
|
10289
10355
|
flatten?: boolean;
|
|
10290
10356
|
setViewportBounds?: boolean;
|
|
@@ -10329,7 +10395,7 @@ export namespace level {
|
|
|
10329
10395
|
* me.game.world.addChild(levelContainer);
|
|
10330
10396
|
*/
|
|
10331
10397
|
function load(levelId: any, options?: {
|
|
10332
|
-
container?:
|
|
10398
|
+
container?: me.Container;
|
|
10333
10399
|
onLoaded?: Function;
|
|
10334
10400
|
flatten?: boolean;
|
|
10335
10401
|
setViewportBounds?: boolean;
|
|
@@ -10362,7 +10428,7 @@ export namespace level {
|
|
|
10362
10428
|
* @function
|
|
10363
10429
|
* @return {me.TMXTileMap}
|
|
10364
10430
|
*/
|
|
10365
|
-
function getCurrentLevel():
|
|
10431
|
+
function getCurrentLevel(): me.TMXTileMap;
|
|
10366
10432
|
/**
|
|
10367
10433
|
* return the current level definition.
|
|
10368
10434
|
* for a reference to the live instantiated level,
|
|
@@ -10373,7 +10439,7 @@ export namespace level {
|
|
|
10373
10439
|
* @function
|
|
10374
10440
|
* @return {me.TMXTileMap}
|
|
10375
10441
|
*/
|
|
10376
|
-
function getCurrentLevel():
|
|
10442
|
+
function getCurrentLevel(): me.TMXTileMap;
|
|
10377
10443
|
/**
|
|
10378
10444
|
* reload the current level
|
|
10379
10445
|
* @name reload
|
|
@@ -10386,7 +10452,7 @@ export namespace level {
|
|
|
10386
10452
|
* @param {boolean} [options.flatten=me.game.mergeGroup] if true, flatten all objects into the given container
|
|
10387
10453
|
*/
|
|
10388
10454
|
function reload(options?: {
|
|
10389
|
-
container?:
|
|
10455
|
+
container?: me.Container;
|
|
10390
10456
|
onLoaded?: Function;
|
|
10391
10457
|
flatten?: boolean;
|
|
10392
10458
|
}): boolean;
|
|
@@ -10402,7 +10468,7 @@ export namespace level {
|
|
|
10402
10468
|
* @param {boolean} [options.flatten=me.game.mergeGroup] if true, flatten all objects into the given container
|
|
10403
10469
|
*/
|
|
10404
10470
|
function reload(options?: {
|
|
10405
|
-
container?:
|
|
10471
|
+
container?: me.Container;
|
|
10406
10472
|
onLoaded?: Function;
|
|
10407
10473
|
flatten?: boolean;
|
|
10408
10474
|
}): boolean;
|
|
@@ -10418,7 +10484,7 @@ export namespace level {
|
|
|
10418
10484
|
* @param {boolean} [options.flatten=me.game.mergeGroup] if true, flatten all objects into the given container
|
|
10419
10485
|
*/
|
|
10420
10486
|
function next(options?: {
|
|
10421
|
-
container?:
|
|
10487
|
+
container?: me.Container;
|
|
10422
10488
|
onLoaded?: Function;
|
|
10423
10489
|
flatten?: boolean;
|
|
10424
10490
|
}): boolean;
|
|
@@ -10434,7 +10500,7 @@ export namespace level {
|
|
|
10434
10500
|
* @param {boolean} [options.flatten=me.game.mergeGroup] if true, flatten all objects into the given container
|
|
10435
10501
|
*/
|
|
10436
10502
|
function next(options?: {
|
|
10437
|
-
container?:
|
|
10503
|
+
container?: me.Container;
|
|
10438
10504
|
onLoaded?: Function;
|
|
10439
10505
|
flatten?: boolean;
|
|
10440
10506
|
}): boolean;
|
|
@@ -10450,7 +10516,7 @@ export namespace level {
|
|
|
10450
10516
|
* @param {boolean} [options.flatten=me.game.mergeGroup] if true, flatten all objects into the given container
|
|
10451
10517
|
*/
|
|
10452
10518
|
function previous(options?: {
|
|
10453
|
-
container?:
|
|
10519
|
+
container?: me.Container;
|
|
10454
10520
|
onLoaded?: Function;
|
|
10455
10521
|
flatten?: boolean;
|
|
10456
10522
|
}): boolean;
|
|
@@ -10466,7 +10532,7 @@ export namespace level {
|
|
|
10466
10532
|
* @param {boolean} [options.flatten=me.game.mergeGroup] if true, flatten all objects into the given container
|
|
10467
10533
|
*/
|
|
10468
10534
|
function previous(options?: {
|
|
10469
|
-
container?:
|
|
10535
|
+
container?: me.Container;
|
|
10470
10536
|
onLoaded?: Function;
|
|
10471
10537
|
flatten?: boolean;
|
|
10472
10538
|
}): boolean;
|
|
@@ -11231,7 +11297,7 @@ export namespace state {
|
|
|
11231
11297
|
*
|
|
11232
11298
|
* me.state.set(me.state.MENU, new MenuScreen());
|
|
11233
11299
|
*/
|
|
11234
|
-
export function set(state: number, stage:
|
|
11300
|
+
export function set(state: number, stage: me.Stage, start?: boolean): void;
|
|
11235
11301
|
/**
|
|
11236
11302
|
* associate the specified state with a Stage
|
|
11237
11303
|
* @name set
|
|
@@ -11278,7 +11344,7 @@ export namespace state {
|
|
|
11278
11344
|
*
|
|
11279
11345
|
* me.state.set(me.state.MENU, new MenuScreen());
|
|
11280
11346
|
*/
|
|
11281
|
-
export function set(state: number, stage:
|
|
11347
|
+
export function set(state: number, stage: me.Stage, start?: boolean): void;
|
|
11282
11348
|
/**
|
|
11283
11349
|
* return a reference to the current screen object<br>
|
|
11284
11350
|
* useful to call a object specific method
|
|
@@ -11288,7 +11354,7 @@ export namespace state {
|
|
|
11288
11354
|
* @function
|
|
11289
11355
|
* @return {me.Stage}
|
|
11290
11356
|
*/
|
|
11291
|
-
export function current():
|
|
11357
|
+
export function current(): me.Stage;
|
|
11292
11358
|
/**
|
|
11293
11359
|
* return a reference to the current screen object<br>
|
|
11294
11360
|
* useful to call a object specific method
|
|
@@ -11298,7 +11364,7 @@ export namespace state {
|
|
|
11298
11364
|
* @function
|
|
11299
11365
|
* @return {me.Stage}
|
|
11300
11366
|
*/
|
|
11301
|
-
export function current():
|
|
11367
|
+
export function current(): me.Stage;
|
|
11302
11368
|
/**
|
|
11303
11369
|
* specify a global transition effect
|
|
11304
11370
|
* @name transition
|
|
@@ -11594,7 +11660,7 @@ export var video: Readonly<{
|
|
|
11594
11660
|
WEBGL: number;
|
|
11595
11661
|
AUTO: number;
|
|
11596
11662
|
readonly parent: HTMLElement;
|
|
11597
|
-
scaleRatio:
|
|
11663
|
+
scaleRatio: me.Vector2d;
|
|
11598
11664
|
readonly renderer: any;
|
|
11599
11665
|
init: typeof init;
|
|
11600
11666
|
createCanvas: typeof createCanvas;
|
|
@@ -11627,6 +11693,10 @@ declare class TextureCache {
|
|
|
11627
11693
|
* @ignore
|
|
11628
11694
|
*/
|
|
11629
11695
|
get(image: any, atlas: any): any;
|
|
11696
|
+
/**
|
|
11697
|
+
* @ignore
|
|
11698
|
+
*/
|
|
11699
|
+
remove(image: any): void;
|
|
11630
11700
|
/**
|
|
11631
11701
|
* @ignore
|
|
11632
11702
|
*/
|
|
@@ -11679,7 +11749,7 @@ declare class TextureCache {
|
|
|
11679
11749
|
* return false;
|
|
11680
11750
|
* },
|
|
11681
11751
|
*/
|
|
11682
|
-
declare function registerPointerEvent(eventType: string, region:
|
|
11752
|
+
declare function registerPointerEvent(eventType: string, region: me.Rect | me.Polygon | me.Line | me.Ellipse, callback: Function): void;
|
|
11683
11753
|
/**
|
|
11684
11754
|
* allows the removal of event listeners from the object target.
|
|
11685
11755
|
* @see {@link http://www.w3.org/TR/pointerevents/#list-of-pointer-events|W3C Pointer Event list}
|
|
@@ -11694,7 +11764,7 @@ declare function registerPointerEvent(eventType: string, region: any | any | any
|
|
|
11694
11764
|
* // release the registered region on the 'pointerdown' event
|
|
11695
11765
|
* me.input.releasePointerEvent('pointerdown', this);
|
|
11696
11766
|
*/
|
|
11697
|
-
declare function releasePointerEvent(eventType: string, region:
|
|
11767
|
+
declare function releasePointerEvent(eventType: string, region: me.Rect | me.Polygon | me.Line | me.Ellipse, callback?: Function): void;
|
|
11698
11768
|
/**
|
|
11699
11769
|
* returns true if the given value is a power of two
|
|
11700
11770
|
* @public
|
|
@@ -11946,7 +12016,8 @@ declare class Texture {
|
|
|
11946
12016
|
* @function
|
|
11947
12017
|
* @param {String} name name of the sprite
|
|
11948
12018
|
* @param {Object} [settings] Additional settings passed to the {@link me.Sprite} contructor
|
|
11949
|
-
* @
|
|
12019
|
+
* @param {Boolean} [nineSlice=false] if true returns a 9-slice sprite
|
|
12020
|
+
* @return {me.Sprite|me.NineSliceSprite}
|
|
11950
12021
|
* @example
|
|
11951
12022
|
* // create a new texture object under the `game` namespace
|
|
11952
12023
|
* game.texture = new me.video.renderer.Texture(
|
|
@@ -11959,8 +12030,17 @@ declare class Texture {
|
|
|
11959
12030
|
* var sprite = game.texture.createSpriteFromName("coin.png");
|
|
11960
12031
|
* // set the renderable position to bottom center
|
|
11961
12032
|
* sprite.anchorPoint.set(0.5, 1.0);
|
|
12033
|
+
* ...
|
|
12034
|
+
* ...
|
|
12035
|
+
* // create a 9-slice sprite
|
|
12036
|
+
* var dialogPanel = game.texture.createSpriteFromName(
|
|
12037
|
+
* "rpg_dialo.png",
|
|
12038
|
+
* // width & height are mandatory for 9-slice sprites
|
|
12039
|
+
* { width: this.width, height: this.height },
|
|
12040
|
+
* true
|
|
12041
|
+
* );
|
|
11962
12042
|
*/
|
|
11963
|
-
createSpriteFromName(name: string, settings?: any):
|
|
12043
|
+
createSpriteFromName(name: string, settings?: any, nineSlice?: boolean): me.Sprite | me.NineSliceSprite;
|
|
11964
12044
|
/**
|
|
11965
12045
|
* Create an animation object using the first region found using all specified names
|
|
11966
12046
|
* @name createAnimationFromName
|
|
@@ -11994,7 +12074,7 @@ declare class Texture {
|
|
|
11994
12074
|
* // set the renderable position to bottom center
|
|
11995
12075
|
* sprite.anchorPoint.set(0.5, 1.0);
|
|
11996
12076
|
*/
|
|
11997
|
-
createAnimationFromName(names: string[] | number[], settings?: any):
|
|
12077
|
+
createAnimationFromName(names: string[] | number[], settings?: any): me.Sprite;
|
|
11998
12078
|
}
|
|
11999
12079
|
/**
|
|
12000
12080
|
* @classdesc
|
|
@@ -12127,7 +12207,7 @@ declare class Bounds {
|
|
|
12127
12207
|
* @name center
|
|
12128
12208
|
* @memberOf me.Bounds
|
|
12129
12209
|
*/
|
|
12130
|
-
public get center():
|
|
12210
|
+
public get center(): me.Vector2d;
|
|
12131
12211
|
/**
|
|
12132
12212
|
* Updates bounds using the given vertices
|
|
12133
12213
|
* @name update
|
|
@@ -12135,7 +12215,7 @@ declare class Bounds {
|
|
|
12135
12215
|
* @function
|
|
12136
12216
|
* @param {me.Vector2d[]} vertices an array of me.Vector2d points
|
|
12137
12217
|
*/
|
|
12138
|
-
update(vertices:
|
|
12218
|
+
update(vertices: me.Vector2d[]): void;
|
|
12139
12219
|
/**
|
|
12140
12220
|
* add the given vertices to the bounds definition.
|
|
12141
12221
|
* @name add
|
|
@@ -12144,7 +12224,7 @@ declare class Bounds {
|
|
|
12144
12224
|
* @param {me.Vector2d[]} vertices an array of me.Vector2d points
|
|
12145
12225
|
* @param {boolean} [clear=false] either to reset the bounds before adding the new vertices
|
|
12146
12226
|
*/
|
|
12147
|
-
add(vertices:
|
|
12227
|
+
add(vertices: me.Vector2d[], clear?: boolean): void;
|
|
12148
12228
|
/**
|
|
12149
12229
|
* add the given bounds to the bounds definition.
|
|
12150
12230
|
* @name addBounds
|
|
@@ -12153,7 +12233,7 @@ declare class Bounds {
|
|
|
12153
12233
|
* @param {me.Bounds} bounds
|
|
12154
12234
|
* @param {boolean} [clear=false] either to reset the bounds before adding the new vertices
|
|
12155
12235
|
*/
|
|
12156
|
-
addBounds(bounds:
|
|
12236
|
+
addBounds(bounds: me.Bounds, clear?: boolean): void;
|
|
12157
12237
|
/**
|
|
12158
12238
|
* add the given point to the bounds definition.
|
|
12159
12239
|
* @name addPoint
|
|
@@ -12201,7 +12281,7 @@ declare class Bounds {
|
|
|
12201
12281
|
* @param {me.Bounds|me.Rect} bounds
|
|
12202
12282
|
* @return {boolean} True if the bounds overlap, otherwise false
|
|
12203
12283
|
*/
|
|
12204
|
-
overlaps(bounds:
|
|
12284
|
+
overlaps(bounds: me.Bounds | me.Rect): boolean;
|
|
12205
12285
|
/**
|
|
12206
12286
|
* determines whether all coordinates of this bounds are finite numbers.
|
|
12207
12287
|
* @name isFinite
|
|
@@ -12249,7 +12329,7 @@ declare class Bounds {
|
|
|
12249
12329
|
* @function
|
|
12250
12330
|
* @return {me.Bounds}
|
|
12251
12331
|
*/
|
|
12252
|
-
clone():
|
|
12332
|
+
clone(): me.Bounds;
|
|
12253
12333
|
/**
|
|
12254
12334
|
* Returns a polygon whose edges are the same as this bounds.
|
|
12255
12335
|
* @name toPolygon
|
|
@@ -12257,7 +12337,55 @@ declare class Bounds {
|
|
|
12257
12337
|
* @function
|
|
12258
12338
|
* @return {me.Polygon} a new Polygon that represents this bounds.
|
|
12259
12339
|
*/
|
|
12260
|
-
toPolygon():
|
|
12340
|
+
toPolygon(): me.Polygon;
|
|
12341
|
+
}
|
|
12342
|
+
/**
|
|
12343
|
+
* @classdesc
|
|
12344
|
+
* a Vertex Buffer object
|
|
12345
|
+
* @class VertexArrayBuffer
|
|
12346
|
+
* @private
|
|
12347
|
+
*/
|
|
12348
|
+
declare class VertexArrayBuffer {
|
|
12349
|
+
constructor(vertex_size: any, vertex_per_quad: any);
|
|
12350
|
+
vertexSize: any;
|
|
12351
|
+
quadSize: any;
|
|
12352
|
+
maxVertex: number;
|
|
12353
|
+
vertexCount: number;
|
|
12354
|
+
buffer: ArrayBuffer;
|
|
12355
|
+
bufferF32: Float32Array;
|
|
12356
|
+
bufferU32: Uint32Array;
|
|
12357
|
+
/**
|
|
12358
|
+
* clear the vertex array buffer
|
|
12359
|
+
*/
|
|
12360
|
+
clear(): void;
|
|
12361
|
+
/**
|
|
12362
|
+
* return true if full
|
|
12363
|
+
*/
|
|
12364
|
+
isFull(vertex?: number): boolean;
|
|
12365
|
+
/**
|
|
12366
|
+
* resize the vertex buffer, retaining its original contents
|
|
12367
|
+
*/
|
|
12368
|
+
resize(): VertexArrayBuffer;
|
|
12369
|
+
/**
|
|
12370
|
+
* push a new vertex to the buffer
|
|
12371
|
+
*/
|
|
12372
|
+
push(x: any, y: any, u: any, v: any, tint: any): VertexArrayBuffer;
|
|
12373
|
+
/**
|
|
12374
|
+
* return a reference to the data in Float32 format
|
|
12375
|
+
*/
|
|
12376
|
+
toFloat32(begin: any, end: any): Float32Array;
|
|
12377
|
+
/**
|
|
12378
|
+
* return a reference to the data in Uint32 format
|
|
12379
|
+
*/
|
|
12380
|
+
toUint32(begin: any, end: any): Uint32Array;
|
|
12381
|
+
/**
|
|
12382
|
+
* return the size of the vertex in vertex
|
|
12383
|
+
*/
|
|
12384
|
+
length(): number;
|
|
12385
|
+
/**
|
|
12386
|
+
* return true if empty
|
|
12387
|
+
*/
|
|
12388
|
+
isEmpty(): boolean;
|
|
12261
12389
|
}
|
|
12262
12390
|
/**
|
|
12263
12391
|
* Initialize and configure the audio support.<br>
|
|
@@ -12604,7 +12732,7 @@ declare function reset(): void;
|
|
|
12604
12732
|
* Update the renderer framerate using the system config variables.
|
|
12605
12733
|
* @function me.game.updateFrameRate
|
|
12606
12734
|
* @see me.timer.maxfps
|
|
12607
|
-
* @see me.
|
|
12735
|
+
* @see me.World.fps
|
|
12608
12736
|
*/
|
|
12609
12737
|
declare function updateFrameRate(): void;
|
|
12610
12738
|
/**
|
|
@@ -12613,7 +12741,7 @@ declare function updateFrameRate(): void;
|
|
|
12613
12741
|
* @param {me.Renderable} child
|
|
12614
12742
|
* @return {me.Container}
|
|
12615
12743
|
*/
|
|
12616
|
-
declare function getParentContainer(child:
|
|
12744
|
+
declare function getParentContainer(child: me.Renderable): me.Container;
|
|
12617
12745
|
/**
|
|
12618
12746
|
* force the redraw (not update) of all objects
|
|
12619
12747
|
* @function me.game.repaint
|
|
@@ -12626,14 +12754,14 @@ declare function repaint(): void;
|
|
|
12626
12754
|
* @param {Number} time current timestamp as provided by the RAF callback
|
|
12627
12755
|
* @param {me.Stage} stage the current stage
|
|
12628
12756
|
*/
|
|
12629
|
-
declare function update$1(time: number, stage:
|
|
12757
|
+
declare function update$1(time: number, stage: me.Stage): void;
|
|
12630
12758
|
/**
|
|
12631
12759
|
* draw the current scene/stage
|
|
12632
12760
|
* @function me.game.draw
|
|
12633
12761
|
* @ignore
|
|
12634
12762
|
* @param {me.Stage} stage the current stage
|
|
12635
12763
|
*/
|
|
12636
|
-
declare function draw(stage:
|
|
12764
|
+
declare function draw(stage: me.Stage): void;
|
|
12637
12765
|
/**
|
|
12638
12766
|
* Translate the specified x and y values from the global (absolute)
|
|
12639
12767
|
* coordinate to local (viewport) relative coordinate.
|
|
@@ -12643,8 +12771,8 @@ declare function draw(stage: any): void;
|
|
|
12643
12771
|
* @function
|
|
12644
12772
|
* @param {Number} x the global x coordinate to be translated.
|
|
12645
12773
|
* @param {Number} y the global y coordinate to be translated.
|
|
12646
|
-
* @param {
|
|
12647
|
-
* @return {me.Vector2d} A vector object with the corresponding translated coordinates
|
|
12774
|
+
* @param {me.Vector2d} [v] an optional vector object where to set the translated coordinates
|
|
12775
|
+
* @return {me.Vector2d} A vector object with the corresponding translated coordinates
|
|
12648
12776
|
* @example
|
|
12649
12777
|
* onMouseEvent : function (pointer) {
|
|
12650
12778
|
* // convert the given into local (viewport) relative coordinates
|
|
@@ -12652,7 +12780,7 @@ declare function draw(stage: any): void;
|
|
|
12652
12780
|
* // do something with pos !
|
|
12653
12781
|
* };
|
|
12654
12782
|
*/
|
|
12655
|
-
declare function globalToLocal(x: number, y: number, v?:
|
|
12783
|
+
declare function globalToLocal(x: number, y: number, v?: me.Vector2d): me.Vector2d;
|
|
12656
12784
|
/**
|
|
12657
12785
|
* enable/disable all gestures on the given element.<br>
|
|
12658
12786
|
* by default melonJS will disable browser handling of all panning and zooming gestures.
|
|
@@ -12707,7 +12835,7 @@ declare function unbindPointer(button?: number): void;
|
|
|
12707
12835
|
* // release all registered event on the
|
|
12708
12836
|
* me.input.releaseAllPointerEvents(this);
|
|
12709
12837
|
*/
|
|
12710
|
-
declare function releaseAllPointerEvents(region:
|
|
12838
|
+
declare function releaseAllPointerEvents(region: me.Rect | me.Polygon | me.Line | me.Ellipse): void;
|
|
12711
12839
|
/**
|
|
12712
12840
|
* enable keyboard event
|
|
12713
12841
|
* @ignore
|
|
@@ -12755,7 +12883,7 @@ declare function keyStatus(action: string): boolean;
|
|
|
12755
12883
|
* // trigger a key press
|
|
12756
12884
|
* me.input.triggerKeyEvent(me.input.KEY.LEFT, true);
|
|
12757
12885
|
*/
|
|
12758
|
-
declare function triggerKeyEvent(keycode:
|
|
12886
|
+
declare function triggerKeyEvent(keycode: me.input.KEY, status?: boolean, mouseButton: any): void;
|
|
12759
12887
|
/**
|
|
12760
12888
|
* associate a user defined action to a keycode
|
|
12761
12889
|
* @name bindKey
|
|
@@ -12773,7 +12901,7 @@ declare function triggerKeyEvent(keycode: any, status?: boolean, mouseButton: an
|
|
|
12773
12901
|
* me.input.bindKey(me.input.KEY.X, "jump", true);
|
|
12774
12902
|
* me.input.bindKey(me.input.KEY.F1, "options", true, true);
|
|
12775
12903
|
*/
|
|
12776
|
-
declare function bindKey(keycode:
|
|
12904
|
+
declare function bindKey(keycode: me.input.KEY, action: string, lock?: boolean, preventDefault$1?: boolean): void;
|
|
12777
12905
|
/**
|
|
12778
12906
|
* return the action associated with the given keycode
|
|
12779
12907
|
* @name getBindingKey
|
|
@@ -12783,7 +12911,7 @@ declare function bindKey(keycode: any, action: string, lock?: boolean, preventDe
|
|
|
12783
12911
|
* @param {me.input.KEY} keycode
|
|
12784
12912
|
* @return {String} user defined associated action
|
|
12785
12913
|
*/
|
|
12786
|
-
declare function getBindingKey(keycode:
|
|
12914
|
+
declare function getBindingKey(keycode: me.input.KEY): string;
|
|
12787
12915
|
/**
|
|
12788
12916
|
* unlock a key manually
|
|
12789
12917
|
* @name unlockKey
|
|
@@ -12808,7 +12936,7 @@ declare function unlockKey(action: string): void;
|
|
|
12808
12936
|
* @example
|
|
12809
12937
|
* me.input.unbindKey(me.input.KEY.LEFT);
|
|
12810
12938
|
*/
|
|
12811
|
-
declare function unbindKey(keycode:
|
|
12939
|
+
declare function unbindKey(keycode: me.input.KEY): void;
|
|
12812
12940
|
/**
|
|
12813
12941
|
* Associate a gamepad event to a keycode
|
|
12814
12942
|
* @name bindGamepad
|
|
@@ -12832,9 +12960,9 @@ declare function unbindKey(keycode: any): void;
|
|
|
12832
12960
|
*/
|
|
12833
12961
|
declare function bindGamepad(index: number, button: {
|
|
12834
12962
|
type: string;
|
|
12835
|
-
code:
|
|
12963
|
+
code: me.input.GAMEPAD.BUTTONS | me.input.GAMEPAD.AXES;
|
|
12836
12964
|
threshold?: number;
|
|
12837
|
-
}, keyCode:
|
|
12965
|
+
}, keyCode: me.input.KEY): void;
|
|
12838
12966
|
/**
|
|
12839
12967
|
* unbind the defined keycode
|
|
12840
12968
|
* @name unbindGamepad
|
|
@@ -12846,7 +12974,7 @@ declare function bindGamepad(index: number, button: {
|
|
|
12846
12974
|
* @example
|
|
12847
12975
|
* me.input.unbindGamepad(0, me.input.GAMEPAD.BUTTONS.FACE_1);
|
|
12848
12976
|
*/
|
|
12849
|
-
declare function unbindGamepad(index: number, button:
|
|
12977
|
+
declare function unbindGamepad(index: number, button: me.input.GAMEPAD.BUTTONS): void;
|
|
12850
12978
|
/**
|
|
12851
12979
|
* Set deadzone for analog gamepad inputs<br>
|
|
12852
12980
|
* The default deadzone is 0.1 (10%) Analog values less than this will be ignored
|
|
@@ -12872,7 +13000,7 @@ declare class BasePlugin {
|
|
|
12872
13000
|
* this can be overridden by the plugin
|
|
12873
13001
|
* @public
|
|
12874
13002
|
* @type String
|
|
12875
|
-
* @default "10.
|
|
13003
|
+
* @default "10.2.1"
|
|
12876
13004
|
* @name me.plugin.Base#version
|
|
12877
13005
|
*/
|
|
12878
13006
|
public version: string;
|
|
@@ -12969,7 +13097,7 @@ declare function init(game_width: any, game_height: any, options?: {
|
|
|
12969
13097
|
* @param {Boolean} [offscreen=false] will returns an OffscreenCanvas if supported
|
|
12970
13098
|
* @return {HTMLCanvasElement|OffscreenCanvas}
|
|
12971
13099
|
*/
|
|
12972
|
-
declare function createCanvas(width: number, height: number, offscreen?: boolean): HTMLCanvasElement |
|
|
13100
|
+
declare function createCanvas(width: number, height: number, offscreen?: boolean): HTMLCanvasElement | OffscreenCanvas;
|
|
12973
13101
|
/**
|
|
12974
13102
|
* return a reference to the parent DOM element holding the main canvas
|
|
12975
13103
|
* @function me.video.getParent
|
|
@@ -13001,7 +13129,6 @@ declare function scale(x: number, y: number): void;
|
|
|
13001
13129
|
* @name ResponseObject
|
|
13002
13130
|
* @memberOf me.collision
|
|
13003
13131
|
* @public
|
|
13004
|
-
* @see me.collision.check
|
|
13005
13132
|
*/
|
|
13006
13133
|
declare class ResponseObject {
|
|
13007
13134
|
a: any;
|
|
@@ -13035,7 +13162,7 @@ declare class ResponseObject {
|
|
|
13035
13162
|
* @return {Mixed} Value of property
|
|
13036
13163
|
* @memberOf me.utils.agent
|
|
13037
13164
|
*/
|
|
13038
|
-
declare function prefixed(name: string, obj?: any):
|
|
13165
|
+
declare function prefixed(name: string, obj?: any): Mixed;
|
|
13039
13166
|
/**
|
|
13040
13167
|
* Set a vendor-prefixed property
|
|
13041
13168
|
* @public
|
|
@@ -13047,7 +13174,7 @@ declare function prefixed(name: string, obj?: any): any;
|
|
|
13047
13174
|
* @return true if one of the vendor-prefixed property was found
|
|
13048
13175
|
* @memberOf me.utils.agent
|
|
13049
13176
|
*/
|
|
13050
|
-
declare function setPrefixed(name: string, value:
|
|
13177
|
+
declare function setPrefixed(name: string, value: Mixed, obj?: any): void;
|
|
13051
13178
|
/**
|
|
13052
13179
|
* a collection of array utility functions
|
|
13053
13180
|
* @namespace me.utils.array
|