mirror of
https://github.com/photonstorm/phaser
synced 2025-02-16 22:18:29 +00:00
Added hitArea property and setHitArea method
This commit is contained in:
parent
3afe6d82fa
commit
6efeb2c90f
2 changed files with 12 additions and 1 deletions
|
@ -1,4 +1,4 @@
|
|||
var CHECKSUM = {
|
||||
build: 'ff2ba330-671a-11e7-ade7-abb54a342c15'
|
||||
build: '3f89fe30-6767-11e7-a84d-c5c9fa126d36'
|
||||
};
|
||||
module.exports = CHECKSUM;
|
|
@ -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 ()
|
||||
{
|
||||
|
|
Loading…
Add table
Reference in a new issue