Comparing version 0.4.3 to 0.4.4
@@ -96,2 +96,7 @@ var Vec2d = require('vec2d').Vec2d; | ||
}; | ||
Sprite.prototype.hitTest = function(pt) { | ||
var tl = this.getTopLeft(); | ||
var br = this.getBottomRight(); | ||
return pt.x >= tl.x && pt.y >= tl.y && pt.x < br.x && pt.y < br.y; | ||
}; | ||
Sprite.prototype.setVisible = function(visible){ | ||
@@ -124,4 +129,4 @@ this.visible = visible; | ||
Sprite.prototype.setLoop = function(loop){ | ||
this.loop = loop; | ||
// this is the actual value we'll use to check if we're going to loop. | ||
this.loop = !!loop; | ||
this._loop = this.loop == null ? this.animation.loop : this.loop; | ||
@@ -128,0 +133,0 @@ this.setUpInterval(); |
@@ -5,3 +5,3 @@ { | ||
"author": "Andrew Kelley <superjoe30@gmail.com>", | ||
"version": "0.4.3", | ||
"version": "0.4.4", | ||
"main": "index.js", | ||
@@ -8,0 +8,0 @@ "license": "MIT", |
@@ -524,2 +524,9 @@ # chem | ||
`Sprite::hitTest(vec2d)` | ||
Returns boolean of whether the point is inside the bounding box | ||
of the sprite. | ||
Takes into account scale and current frame. | ||
Does not take into account rotation. | ||
`Sprite::setVisible(visible)` | ||
@@ -647,2 +654,7 @@ | ||
### 0.4.4 | ||
* add Sprite::hitTest(vec2d) | ||
* fix not respecting `loop` property in chemfile | ||
### 0.4.3 | ||
@@ -649,0 +661,0 @@ |
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
37452
623
719