New issue 84 by iworkinprogress: Add isPointWithinRectangle to Point class.
http://code.google.com/p/sekati/issues/detail?id=84
public function isPointWithinRectangle(rectangle : Rectangle) : Boolean {
if(x >= rectangle.x && x <= rectangle.x + rectangle.width && y >=
rectangle.y && y <= rectangle.y + rectangle.height) {
return true;
} else {
return false;
}
}
// also a nice shortcut for checking if a point is within a sprite
public function isPointWithinSprite(sprite : Sprite) : Boolean {
return isPointWithinRectangle(new Rectangle( sprite.x, sprite.y,
sprite.width, sprite.height ) );
}
Comment #1 on issue 84 by sekati: Add isPointWithinRectangle to Point class.
http://code.google.com/p/sekati/issues/detail?id=84
Similar functionality is already available in DisplayObject per
histTestPoint() & HitTestObject().
WF / NAB :-)