8000 fix animation jsdoc · GameJs/gamejs@7bed8a2 · GitHub
[go: up one dir, main page]

Skip to content

Commit 7bed8a2

Browse files
committed
fix animation jsdoc
1 parent e3832cb commit 7bed8a2

File tree

1 file changed

+12
-6
lines changed

1 file changed

+12
-6
lines changed

src/gamejs/animate.js

+12-6
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,22 @@
11
var gamejs = require('../gamejs'< 8000 /span>);
22

33
/**
4-
* @fileoverview `Animations` on top of `SpriteSheets`.
4+
* @fileoverview Provides Animations and SpriteSheets.
55
*
66
* @example
77
* var spriteSheet = new SpriteSheet(sheetSurface, {width: 16, height: 16});
8-
* var animation = new Animation(spriteSheet, {walk: [0,1,2,3], loop: true});
9-
* animation.setState('walk');
8+
* var animationSpec = {
9+
* walk: {
10+
* frames: [0,1,2,3],
11+
* loop: true,
12+
* rate: 20 // framerate per second
13+
* }
14+
* }
15+
* var animation = new Animation(spriteSheet, 'walk', animationSpec);
1016
* ....
1117
* animation.update(msDuration)
1218
* ....
13-
* display.blit(animation.currentFrame);
19+
* display.blit(animation.image);
1420
*
1521
*/
1622

@@ -103,7 +109,7 @@ var Animation = exports.Animation = function(spriteSheet, initial, spec) {
103109
/** @ignore **/
104110
this.spec = spec;
105111

106-
/** The current tile surface of the animation. Draw this to the screen. **/
112+
/** @ignore **/
107113
this.currentFrame = null;
108114
/** @ignore **/
109115
this.currentFrameDuration = 0;
@@ -113,7 +119,7 @@ var Animation = exports.Animation = function(spriteSheet, initial, spec) {
113119
this._isFinished = false;
114120
/** @ignore **/
115121
this.spriteSheet = spriteSheet;
116-
/** @ignore **/
122+
/** The current tile surface of the animation. Draw this to the screen. **/
117123
this.image = spriteSheet.get(0);
118124
this.start(initial);
119125

0 commit comments

Comments
 (0)
0