Added hitArea property and setHitArea method

This commit is contained in:
Richard Davey 2017-07-13 02:05:32 +01:00
parent 3afe6d82fa
commit 6efeb2c90f
2 changed files with 12 additions and 1 deletions

View file

@ -1,4 +1,4 @@
var CHECKSUM = {
build: 'ff2ba330-671a-11e7-ade7-abb54a342c15'
build: '3f89fe30-6767-11e7-a84d-c5c9fa126d36'
};
module.exports = CHECKSUM;

View file

@ -36,6 +36,9 @@ var GameObject = new Class({
this.renderMask = 15;
this.renderFlags = 15;
this.hitArea = null;
this.hitAreaCallback = null;
// Trigger a state z-depth sort
this.state.sys.sortChildrenFlag = true;
},
@ -53,6 +56,14 @@ var GameObject = new Class({
{
},
setHitArea: function (shape, callback)
{
this.hitArea = shape;
this.hitAreaCallback = callback;
return this;
},
// Can be overridden by custom Game Objects, but provides default export functionality
toJSON: function ()
{