Comparing version 2.0.1 to 2.1.0
@@ -22,2 +22,3 @@ **Table of Contents** *generated with [DocToc](http://doctoc.herokuapp.com/)* | ||
- [draw(context)](#drawcontext) | ||
- [clear()](#clear) | ||
- [Engine](#engine) | ||
@@ -245,2 +246,8 @@ - [methods](#methods) | ||
#### clear() | ||
Deletes all sprites in the batch. | ||
See also Sprite::delete() | ||
## Engine | ||
@@ -247,0 +254,0 @@ |
# History | ||
## 2.1.0 | ||
* add Batch::clear() | ||
## 2.0.1 | ||
@@ -4,0 +8,0 @@ |
@@ -34,1 +34,14 @@ module.exports = Batch; | ||
}; | ||
Batch.prototype.clear = function(context) { | ||
for (var i = 0; i < this.layers.length; ++i) { | ||
var layer = this.layers[i]; | ||
if (!layer) continue; | ||
for (var spriteIndex = 0; spriteIndex < layer.length; spriteIndex += 1) { | ||
var sprite = layer[spriteIndex]; | ||
sprite.batch = null; | ||
sprite['delete'](); | ||
} | ||
} | ||
this.layers = []; | ||
}; |
@@ -73,5 +73,5 @@ var Vec2d = require('vec2d').Vec2d; | ||
Label.prototype.delete = function() { | ||
Label.prototype['delete'] = function() { | ||
if (this.batch) this.batch.remove(this); | ||
this.batch = null; | ||
}; |
@@ -5,3 +5,3 @@ { | ||
"author": "Andrew Kelley <superjoe30@gmail.com>", | ||
"version": "2.0.1", | ||
"version": "2.1.0", | ||
"main": "index.js", | ||
@@ -8,0 +8,0 @@ "license": "MIT", |
@@ -1,2 +0,2 @@ | ||
# chem | ||
![chem](http://i.imgur.com/LZPbMwb.png) | ||
@@ -3,0 +3,0 @@ canvas-based game engine and toolchain optimized for rapid development. |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
58763
886