melonjs 10.9.0 → 10.10.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -18,7 +18,7 @@ var globalFloatingCounter = 0;
18
18
 
19
19
  /**
20
20
  * @classdesc
21
- * me.Container represents a collection of child objects
21
+ * Container represents a collection of child objects
22
22
  * @augments Renderable
23
23
  */
24
24
  class Container extends Renderable {
@@ -192,7 +192,7 @@ class Container extends Renderable {
192
192
  * orginal container. Then when the me.game.world.reset() is called the renderable
193
193
  * will not be in any container.
194
194
  * @name addChild
195
- * @memberof Container.prototype
195
+ * @memberof Container
196
196
  * @function
197
197
  * @param {Renderable} child
198
198
  * @param {number} [z] forces the z index of the child to the specified value
@@ -256,7 +256,7 @@ class Container extends Renderable {
256
256
  * Add a child to the container at the specified index<br>
257
257
  * (the list won't be sorted after insertion)
258
258
  * @name addChildAt
259
- * @memberof Container.prototype
259
+ * @memberof Container
260
260
  * @function
261
261
  * @param {Renderable} child
262
262
  * @param {number} index
@@ -315,7 +315,7 @@ class Container extends Renderable {
315
315
  * - The index of element in the array. <br>
316
316
  * - The array forEach() was called upon. <br>
317
317
  * @name forEach
318
- * @memberof Container.prototype
318
+ * @memberof Container
319
319
  * @function
320
320
  * @param {Function} callback fnction to execute on each element
321
321
  * @param {object} [thisArg] value to use as this(i.e reference Object) when executing callback.
@@ -352,7 +352,7 @@ class Container extends Renderable {
352
352
  /**
353
353
  * Swaps the position (z-index) of 2 children
354
354
  * @name swapChildren
355
- * @memberof Container.prototype
355
+ * @memberof Container
356
356
  * @function
357
357
  * @param {Renderable} child
358
358
  * @param {Renderable} child2
@@ -380,7 +380,7 @@ class Container extends Renderable {
380
380
  /**
381
381
  * Returns the Child at the specified index
382
382
  * @name getChildAt
383
- * @memberof Container.prototype
383
+ * @memberof Container
384
384
  * @function
385
385
  * @param {number} index
386
386
  * @returns {Renderable} the child at the specified index
@@ -397,7 +397,7 @@ class Container extends Renderable {
397
397
  /**
398
398
  * Returns the index of the given Child
399
399
  * @name getChildIndex
400
- * @memberof Container.prototype
400
+ * @memberof Container
401
401
  * @function
402
402
  * @param {Renderable} child
403
403
  * @returns {number} index
@@ -425,7 +425,7 @@ class Container extends Renderable {
425
425
  /**
426
426
  * Returns true if contains the specified Child
427
427
  * @name hasChild
428
- * @memberof Container.prototype
428
+ * @memberof Container
429
429
  * @function
430
430
  * @param {Renderable} child
431
431
  * @returns {boolean}
@@ -439,7 +439,7 @@ class Container extends Renderable {
439
439
  * note : avoid calling this function every frame since
440
440
  * it parses the whole object tree each time
441
441
  * @name getChildByProp
442
- * @memberof Container.prototype
442
+ * @memberof Container
443
443
  * @public
444
444
  * @function
445
445
  * @param {string} prop Property name
@@ -491,7 +491,7 @@ class Container extends Renderable {
491
491
  /**
492
492
  * returns the list of childs with the specified class type
493
493
  * @name getChildByType
494
- * @memberof Container.prototype
494
+ * @memberof Container
495
495
  * @public
496
496
  * @function
497
497
  * @param {object} classType
@@ -518,7 +518,7 @@ class Container extends Renderable {
518
518
  * note : avoid calling this function every frame since
519
519
  * it parses the whole object list each time
520
520
  * @name getChildByName
521
- * @memberof Container.prototype
521
+ * @memberof Container
522
522
  * @public
523
523
  * @function
524
524
  * @param {string|RegExp|number|boolean} name child name
@@ -533,7 +533,7 @@ class Container extends Renderable {
533
533
  * note : avoid calling this function every frame since
534
534
  * it parses the whole object list each time
535
535
  * @name getChildByGUID
536
- * @memberof Container.prototype
536
+ * @memberof Container
537
537
  * @public
538
538
  * @function
539
539
  * @param {string|RegExp|number|boolean} guid child GUID
@@ -547,7 +547,7 @@ class Container extends Renderable {
547
547
  /**
548
548
  * return all child in this container
549
549
  * @name getChildren
550
- * @memberof Container.prototype
550
+ * @memberof Container
551
551
  * @public
552
552
  * @function
553
553
  * @returns {Renderable[]} an array of renderable object
@@ -563,7 +563,7 @@ class Container extends Renderable {
563
563
  * update the bounding box for this shape.
564
564
  * @ignore
565
565
  * @name updateBounds
566
- * @memberof Renderable.prototype
566
+ * @memberof Renderable
567
567
  * @function
568
568
  * @returns {Bounds} this shape bounding box Rectangle object
569
569
  */
@@ -592,7 +592,7 @@ class Container extends Renderable {
592
592
  * Checks if this container is root or if it's attached to the root container.
593
593
  * @private
594
594
  * @name isAttachedToRoot
595
- * @memberof Container.prototype
595
+ * @memberof Container
596
596
  * @function
597
597
  * @returns {boolean}
598
598
  */
@@ -615,7 +615,7 @@ class Container extends Renderable {
615
615
  * update the cointainer's bounding rect (private)
616
616
  * @ignore
617
617
  * @name updateBoundsPos
618
- * @memberof Container.prototype
618
+ * @memberof Container
619
619
  * @function
620
620
  */
621
621
  updateBoundsPos(newX, newY) {
@@ -650,7 +650,7 @@ class Container extends Renderable {
650
650
  /**
651
651
  * Invokes the removeChildNow in a defer, to ensure the child is removed safely after the update & draw stack has completed
652
652
  * @name removeChild
653
- * @memberof Container.prototype
653
+ * @memberof Container
654
654
  * @public
655
655
  * @function
656
656
  * @param {Renderable} child
@@ -670,7 +670,7 @@ class Container extends Renderable {
670
670
  * (removal is immediate and unconditional)<br>
671
671
  * Never use keepalive=true with objects from {@link pool}. Doing so will create a memory leak.
672
672
  * @name removeChildNow
673
- * @memberof Container.prototype
673
+ * @memberof Container
674
674
  * @function
675
675
  * @param {Renderable} child
676
676
  * @param {boolean} [keepalive=False] True to prevent calling child.destroy()
@@ -723,7 +723,7 @@ class Container extends Renderable {
723
723
  /**
724
724
  * Automatically set the specified property of all childs to the given value
725
725
  * @name setChildsProperty
726
- * @memberof Container.prototype
726
+ * @memberof Container
727
727
  * @function
728
728
  * @param {string} prop property name
729
729
  * @param {object} value property value
@@ -741,7 +741,7 @@ class Container extends Renderable {
741
741
  /**
742
742
  * Move the child in the group one step forward (z depth).
743
743
  * @name moveUp
744
- * @memberof Container.prototype
744
+ * @memberof Container
745
745
  * @function
746
746
  * @param {Renderable} child
747
747
  */
@@ -758,7 +758,7 @@ class Container extends Renderable {
758
758
  /**
759
759
  * Move the child in the group one step backward (z depth).
760
760
  * @name moveDown
761
- * @memberof Container.prototype
761
+ * @memberof Container
762
762
  * @function
763
763
  * @param {Renderable} child
764
764
  */
@@ -775,7 +775,7 @@ class Container extends Renderable {
775
775
  /**
776
776
  * Move the specified child to the top(z depth).
777
777
  * @name moveToTop
778
- * @memberof Container.prototype
778
+ * @memberof Container
779
779
  * @function
780
780
  * @param {Renderable} child
781
781
  */
@@ -795,7 +795,7 @@ class Container extends Renderable {
795
795
  /**
796
796
  * Move the specified child the bottom (z depth).
797
797
  * @name moveToBottom
798
- * @memberof Container.prototype
798
+ * @memberof Container
799
799
  * @function
800
800
  * @param {Renderable} child
801
801
  */
@@ -815,7 +815,7 @@ class Container extends Renderable {
815
815
  /**
816
816
  * Manually trigger the sort of all the childs in the container</p>
817
817
  * @name sort
818
- * @memberof Container.prototype
818
+ * @memberof Container
819
819
  * @public
820
820
  * @function
821
821
  * @param {boolean} [recursive=false] recursively sort all containers if true
@@ -910,7 +910,7 @@ class Container extends Renderable {
910
910
  * container update function. <br>
911
911
  * automatically called by the game manager {@link game}
912
912
  * @name update
913
- * @memberof Container.prototype
913
+ * @memberof Container
914
914
  * @function
915
915
  * @protected
916
916
  * @param {number} dt time since the last update in milliseconds.
@@ -963,7 +963,7 @@ class Container extends Renderable {
963
963
  * draw the container. <br>
964
964
  * automatically called by the game manager {@link game}
965
965
  * @name draw
966
- * @memberof Container.prototype
966
+ * @memberof Container
967
967
  * @function
968
968
  * @protected
969
969
  * @param {CanvasRenderer|WebGLRenderer} renderer a renderer object
@@ -159,7 +159,7 @@ class ImageLayer extends Sprite {
159
159
  /**
160
160
  * resize the Image Layer to match the given size
161
161
  * @name resize
162
- * @memberof ImageLayer.prototype
162
+ * @memberof ImageLayer
163
163
  * @function
164
164
  * @param {number} w new width
165
165
  * @param {number} h new height
@@ -249,7 +249,7 @@ class ImageLayer extends Sprite {
249
249
  * draw the ImageLayer. <br>
250
250
  * automatically called by the game manager {@link game}
251
251
  * @name draw
252
- * @memberof ImageLayer.prototype
252
+ * @memberof ImageLayer
253
253
  * @function
254
254
  * @protected
255
255
  * @param {CanvasRenderer|WebGLRenderer} renderer a renderer object
@@ -0,0 +1,115 @@
1
+ import pool from "./../system/pooling.js";
2
+ import Renderable from "./renderable.js";
3
+
4
+ /** @ignore */
5
+ function createGradient(light) {
6
+ var context = light.texture.context;
7
+ var x1 = light.texture.width / 2;
8
+ var y1 = light.texture.height / 2;
9
+ var gradient = context.createRadialGradient(x1, y1, 0, x1, y1, light.radius);
10
+
11
+ light.texture.clear();
12
+
13
+ gradient.addColorStop( 0, light.color.toRGBA(light.intensity));
14
+ gradient.addColorStop( 1, light.color.toRGBA(0.0));
15
+
16
+ context.beginPath();
17
+ context.fillStyle = gradient;
18
+ context.arc(x1, y1, light.radius, 0, Math.PI * 2, false);
19
+ context.fill();
20
+ }
21
+
22
+ /**
23
+ * @classdesc
24
+ * A 2D point light.
25
+ * Note: this is a very experimental and work in progress feature, that provides a simple spot light effect.
26
+ * The light effect is best rendered in WebGL, as they are few limitations when using the Canvas Renderer
27
+ * (multiple lights are not supported, alpha component of the ambient light is ignored)
28
+ * @see stage.lights
29
+ */
30
+ class Light2d extends Renderable {
31
+ /**
32
+ * @param {number} x - The horizontal position of the light.
33
+ * @param {number} y - The vertical position of the light.
34
+ * @param {number} radius - The radius of the light.
35
+ * @param {Color|string} [color="#FFF"] the color of the light
36
+ * @param {number} [intensity=0.7] - The intensity of the light.
37
+ */
38
+ constructor(x, y, radius, color = "#FFF", intensity = 0.7) {
39
+ // call the parent constructor
40
+ super(x, y, radius * 2, radius * 2);
41
+
42
+ /**
43
+ * the color of the light
44
+ * @type {Color}
45
+ * @default "#FFF"
46
+ */
47
+ this.color = pool.pull("Color").parseCSS(color);
48
+
49
+ /**
50
+ * The radius of the light
51
+ * @type {number}
52
+ */
53
+ this.radius = radius;
54
+
55
+ /**
56
+ * The intensity of the light
57
+ * @type {number}
58
+ * @default 0.7
59
+ */
60
+ this.intensity = intensity;
61
+
62
+ /**
63
+ * the default blend mode to be applied when rendering this light
64
+ * @type {string}
65
+ * @default "lighter"
66
+ * @see CanvasRenderer#setBlendMode
67
+ * @see WebGLRenderer#setBlendMode
68
+ */
69
+ this.blendMode = "lighter";
70
+
71
+ /** @ignore */
72
+ this.visibleArea = pool.pull("Ellipse", this.centerX, this.centerY, this.width, this.height);
73
+
74
+ /** @ignore */
75
+ this.texture = pool.pull("CanvasTexture", this.width, this.height, false);
76
+
77
+ this.anchorPoint.set(0, 0);
78
+
79
+ createGradient(this);
80
+ }
81
+
82
+ /**
83
+ * returns a geometry representing the visible area of this light
84
+ * @name getVisibleArea
85
+ * @memberof Light2d
86
+ * @function
87
+ * @returns {Ellipse} the light visible mask
88
+ */
89
+ getVisibleArea() {
90
+ return this.visibleArea.setShape(this.getBounds().centerX, this.getBounds().centerY, this.width, this.height);
91
+ }
92
+
93
+ /**
94
+ * object draw (Called internally by the engine).
95
+ * @ignore
96
+ */
97
+ draw(renderer) {
98
+ renderer.drawImage(this.texture.canvas, this.getBounds().x, this.getBounds().y);
99
+ }
100
+
101
+ /**
102
+ * Destroy function<br>
103
+ * @ignore
104
+ */
105
+ destroy() {
106
+ pool.push(this.color);
107
+ this.color = undefined;
108
+ pool.push(this.texture);
109
+ this.texture = undefined;
110
+ pool.push(this.visibleArea);
111
+ this.visibleArea = undefined;
112
+ super.destroy();
113
+ }
114
+ };
115
+ export default Light2d;
@@ -380,7 +380,7 @@ class Renderable extends Rect {
380
380
  /**
381
381
  * returns the bounding box for this renderable
382
382
  * @name getBounds
383
- * @memberof Renderable.prototype
383
+ * @memberof Renderable
384
384
  * @function
385
385
  * @returns {Bounds} bounding box Rectangle object
386
386
  */
@@ -401,7 +401,7 @@ class Renderable extends Rect {
401
401
  /**
402
402
  * get the renderable alpha channel value<br>
403
403
  * @name getOpacity
404
- * @memberof Renderable.prototype
404
+ * @memberof Renderable
405
405
  * @function
406
406
  * @returns {number} current opacity value between 0 and 1
407
407
  */
@@ -412,7 +412,7 @@ class Renderable extends Rect {
412
412
  /**
413
413
  * set the renderable alpha channel value<br>
414
414
  * @name setOpacity
415
- * @memberof Renderable.prototype
415
+ * @memberof Renderable
416
416
  * @function
417
417
  * @param {number} alpha opacity value between 0.0 and 1.0
418
418
  */
@@ -431,7 +431,7 @@ class Renderable extends Rect {
431
431
  * flip the renderable on the horizontal axis (around the center of the renderable)
432
432
  * @see Matrix2d#scaleX
433
433
  * @name flipX
434
- * @memberof Renderable.prototype
434
+ * @memberof Renderable
435
435
  * @function
436
436
  * @param {boolean} [flip=true] `true` to flip this renderable.
437
437
  * @returns {Renderable} Reference to this object for method chaining
@@ -446,7 +446,7 @@ class Renderable extends Rect {
446
446
  * flip the renderable on the vertical axis (around the center of the renderable)
447
447
  * @see Matrix2d#scaleY
448
448
  * @name flipY
449
- * @memberof Renderable.prototype
449
+ * @memberof Renderable
450
450
  * @function
451
451
  * @param {boolean} [flip=true] `true` to flip this renderable.
452
452
  * @returns {Renderable} Reference to this object for method chaining
@@ -460,7 +460,7 @@ class Renderable extends Rect {
460
460
  /**
461
461
  * multiply the renderable currentTransform with the given matrix
462
462
  * @name transform
463
- * @memberof Renderable.prototype
463
+ * @memberof Renderable
464
464
  * @see Renderable#currentTransform
465
465
  * @function
466
466
  * @param {Matrix2d} m the transformation matrix
@@ -525,7 +525,7 @@ class Renderable extends Rect {
525
525
  /**
526
526
  * Rotate this renderable towards the given target.
527
527
  * @name lookAt
528
- * @memberof Renderable.prototype
528
+ * @memberof Renderable
529
529
  * @function
530
530
  * @param {Renderable|Vector2d|Vector3d} target the renderable or position to look at
531
531
  * @returns {Renderable} Reference to this object for method chaining
@@ -549,7 +549,7 @@ class Renderable extends Rect {
549
549
  /**
550
550
  * Rotate this renderable by the specified angle (in radians).
551
551
  * @name rotate
552
- * @memberof Renderable.prototype
552
+ * @memberof Renderable
553
553
  * @function
554
554
  * @param {number} angle The angle to rotate (in radians)
555
555
  * @param {Vector2d|ObservableVector2d} [v] an optional point to rotate around
@@ -571,7 +571,7 @@ class Renderable extends Rect {
571
571
  * is an image, the image.width and image.height properties are unaltered but the currentTransform
572
572
  * member will be changed.
573
573
  * @name scale
574
- * @memberof Renderable.prototype
574
+ * @memberof Renderable
575
575
  * @function
576
576
  * @param {number} x a number representing the abscissa of the scaling vector.
577
577
  * @param {number} [y=x] a number representing the ordinate of the scaling vector.
@@ -587,7 +587,7 @@ class Renderable extends Rect {
587
587
  /**
588
588
  * scale the renderable around his anchor point
589
589
  * @name scaleV
590
- * @memberof Renderable.prototype
590
+ * @memberof Renderable
591
591
  * @function
592
592
  * @param {Vector2d} v scaling vector
593
593
  * @returns {Renderable} Reference to this object for method chaining
@@ -601,7 +601,7 @@ class Renderable extends Rect {
601
601
  * update function. <br>
602
602
  * automatically called by the game manager {@link game}
603
603
  * @name update
604
- * @memberof Renderable.prototype
604
+ * @memberof Renderable
605
605
  * @function
606
606
  * @protected
607
607
  * @param {number} dt time since the last update in milliseconds.
@@ -615,7 +615,7 @@ class Renderable extends Rect {
615
615
  * update the bounding box for this shape.
616
616
  * @ignore
617
617
  * @name updateBounds
618
- * @memberof Renderable.prototype
618
+ * @memberof Renderable
619
619
  * @function
620
620
  * @returns {Bounds} this shape bounding box Rectangle object
621
621
  */
@@ -629,7 +629,7 @@ class Renderable extends Rect {
629
629
  * update the renderable's bounding rect (private)
630
630
  * @ignore
631
631
  * @name updateBoundsPos
632
- * @memberof Renderable.prototype
632
+ * @memberof Renderable
633
633
  * @function
634
634
  */
635
635
  updateBoundsPos(newX, newY) {
@@ -655,13 +655,14 @@ class Renderable extends Rect {
655
655
  if (this.ancestor instanceof Container && this.floating !== true) {
656
656
  bounds.translate(this.ancestor.getAbsolutePosition());
657
657
  }
658
- //return bounds;
658
+
659
+ this.isDirty = true;
659
660
  }
660
661
 
661
662
  /**
662
663
  * return the renderable absolute position in the game world
663
664
  * @name getAbsolutePosition
664
- * @memberof Renderable.prototype
665
+ * @memberof Renderable
665
666
  * @function
666
667
  * @returns {Vector2d}
667
668
  */
@@ -681,7 +682,7 @@ class Renderable extends Rect {
681
682
  * called when the anchor point value is changed
682
683
  * @private
683
684
  * @name onAnchorUpdate
684
- * @memberof Renderable.prototype
685
+ * @memberof Renderable
685
686
  * @function
686
687
  * @param {number} x the new X value to be set for the anchor
687
688
  * @param {number} y the new Y value to be set for the anchor
@@ -699,7 +700,7 @@ class Renderable extends Rect {
699
700
  * (apply defined transforms, anchor point). <br>
700
701
  * automatically called by the game manager {@link game}
701
702
  * @name preDraw
702
- * @memberof Renderable.prototype
703
+ * @memberof Renderable
703
704
  * @function
704
705
  * @protected
705
706
  * @param {CanvasRenderer|WebGLRenderer} renderer a renderer object
@@ -755,7 +756,7 @@ class Renderable extends Rect {
755
756
  * object draw. <br>
756
757
  * automatically called by the game manager {@link game}
757
758
  * @name draw
758
- * @memberof Renderable.prototype
759
+ * @memberof Renderable
759
760
  * @function
760
761
  * @protected
761
762
  * @param {CanvasRenderer|WebGLRenderer} renderer a renderer object
@@ -768,7 +769,7 @@ class Renderable extends Rect {
768
769
  * restore the rendering context after drawing. <br>
769
770
  * automatically called by the game manager {@link game}
770
771
  * @name postDraw
771
- * @memberof Renderable.prototype
772
+ * @memberof Renderable
772
773
  * @function
773
774
  * @protected
774
775
  * @param {CanvasRenderer|WebGLRenderer} renderer a renderer object
@@ -793,7 +794,7 @@ class Renderable extends Rect {
793
794
  * onCollision callback, triggered in case of collision,
794
795
  * when this renderable body is colliding with another one
795
796
  * @name onCollision
796
- * @memberof Renderable.prototype
797
+ * @memberof Renderable
797
798
  * @function
798
799
  * @param {collision.ResponseObject} response the collision response object
799
800
  * @param {Renderable} other the other renderable touching this one (a reference to response.a or response.b)
@@ -1,7 +1,7 @@
1
1
  import { renderer } from "./../video/video.js";
2
2
  import pool from "./../system/pooling.js";
3
3
  import loader from "./../loader/loader.js";
4
- import { TextureAtlas } from "./../video/texture.js";
4
+ import { TextureAtlas } from "./../video/texture/atlas.js";
5
5
  import Renderable from "./renderable.js";
6
6
 
7
7
  /**
@@ -209,7 +209,7 @@ class Sprite extends Renderable {
209
209
  /**
210
210
  * return the flickering state of the object
211
211
  * @name isFlickering
212
- * @memberof Sprite.prototype
212
+ * @memberof Sprite
213
213
  * @function
214
214
  * @returns {boolean}
215
215
  */
@@ -220,7 +220,7 @@ class Sprite extends Renderable {
220
220
  /**
221
221
  * make the object flicker
222
222
  * @name flicker
223
- * @memberof Sprite.prototype
223
+ * @memberof Sprite
224
224
  * @function
225
225
  * @param {number} duration expressed in milliseconds
226
226
  * @param {Function} callback Function to call when flickering ends
@@ -251,7 +251,7 @@ class Sprite extends Renderable {
251
251
  * logic as per the following example :<br>
252
252
  * <img src="images/spritesheet_grid.png"/>
253
253
  * @name addAnimation
254
- * @memberof Sprite.prototype
254
+ * @memberof Sprite
255
255
  * @function
256
256
  * @param {string} name animation id
257
257
  * @param {number[]|string[]|object[]} index list of sprite index or name
@@ -351,7 +351,7 @@ class Sprite extends Renderable {
351
351
  * set the current animation
352
352
  * this will always change the animation & set the frame to zero
353
353
  * @name setCurrentAnimation
354
- * @memberof Sprite.prototype
354
+ * @memberof Sprite
355
355
  * @function
356
356
  * @param {string} name animation id
357
357
  * @param {string|Function} [resetAnim] animation id to switch to when complete, or callback
@@ -412,7 +412,7 @@ class Sprite extends Renderable {
412
412
  /**
413
413
  * reverse the given or current animation if none is specified
414
414
  * @name reverseAnimation
415
- * @memberof Sprite.prototype
415
+ * @memberof Sprite
416
416
  * @function
417
417
  * @param {string} [name] animation id
418
418
  * @returns {Sprite} Reference to this object for method chaining
@@ -431,7 +431,7 @@ class Sprite extends Renderable {
431
431
  /**
432
432
  * return true if the specified animation is the current one.
433
433
  * @name isCurrentAnimation
434
- * @memberof Sprite.prototype
434
+ * @memberof Sprite
435
435
  * @function
436
436
  * @param {string} name animation id
437
437
  * @returns {boolean}
@@ -448,7 +448,7 @@ class Sprite extends Renderable {
448
448
  * change the current texture atlas region for this sprite
449
449
  * @see Texture.getRegion
450
450
  * @name setRegion
451
- * @memberof Sprite.prototype
451
+ * @memberof Sprite
452
452
  * @function
453
453
  * @param {object} region typically returned through me.Texture.getRegion()
454
454
  * @returns {Sprite} Reference to this object for method chaining
@@ -480,7 +480,7 @@ class Sprite extends Renderable {
480
480
  /**
481
481
  * force the current animation frame index.
482
482
  * @name setAnimationFrame
483
- * @memberof Sprite.prototype
483
+ * @memberof Sprite
484
484
  * @function
485
485
  * @param {number} [idx=0] animation frame index
486
486
  * @returns {Sprite} Reference to this object for method chaining
@@ -496,7 +496,7 @@ class Sprite extends Renderable {
496
496
  /**
497
497
  * return the current animation frame index.
498
498
  * @name getCurrentAnimationFrame
499
- * @memberof Sprite.prototype
499
+ * @memberof Sprite
500
500
  * @function
501
501
  * @returns {number} current animation frame index
502
502
  */
@@ -507,7 +507,7 @@ class Sprite extends Renderable {
507
507
  /**
508
508
  * Returns the frame object by the index.
509
509
  * @name getAnimationFrameObjectByIndex
510
- * @memberof Sprite.prototype
510
+ * @memberof Sprite
511
511
  * @function
512
512
  * @ignore
513
513
  * @param {number} id the frame id
@@ -521,7 +521,7 @@ class Sprite extends Renderable {
521
521
  * update function. <br>
522
522
  * automatically called by the game manager {@link game}
523
523
  * @name update
524
- * @memberof Sprite.prototype
524
+ * @memberof Sprite
525
525
  * @function
526
526
  * @protected
527
527
  * @param {number} dt time since the last update in milliseconds.
@@ -600,7 +600,7 @@ class Sprite extends Renderable {
600
600
  * sprite draw. <br>
601
601
  * automatically called by the game manager {@link game}
602
602
  * @name draw
603
- * @memberof Sprite.prototype
603
+ * @memberof Sprite
604
604
  * @function
605
605
  * @protected
606
606
  * @param {CanvasRenderer|WebGLRenderer} renderer a renderer object