diff --git a/src/interaction/InteractionManager.js b/src/interaction/InteractionManager.js index 472985c..fb5d9a8 100644 --- a/src/interaction/InteractionManager.js +++ b/src/interaction/InteractionManager.js @@ -1,6 +1,12 @@ var core = require('../core'), InteractionData = require('./InteractionData'); +// Mix interactiveTarget into core.DisplayObject.prototype +Object.assign( + core.DisplayObject.prototype, + require('./interactiveTarget') +); + /** * The interaction manager deals with mouse and touch events. Any DisplayObject can be interactive * if its interactive parameter is set to true diff --git a/src/interaction/InteractionManager.js b/src/interaction/InteractionManager.js index 472985c..fb5d9a8 100644 --- a/src/interaction/InteractionManager.js +++ b/src/interaction/InteractionManager.js @@ -1,6 +1,12 @@ var core = require('../core'), InteractionData = require('./InteractionData'); +// Mix interactiveTarget into core.DisplayObject.prototype +Object.assign( + core.DisplayObject.prototype, + require('./interactiveTarget') +); + /** * The interaction manager deals with mouse and touch events. Any DisplayObject can be interactive * if its interactive parameter is set to true diff --git a/src/interaction/interactiveTarget.js b/src/interaction/interactiveTarget.js index a7f2ae5..bde2a23 100644 --- a/src/interaction/interactiveTarget.js +++ b/src/interaction/interactiveTarget.js @@ -1,13 +1,46 @@ -var core = require('../core'); +/** + * Default property values of interactive objects + * used by {@link PIXI.interaction.InteractionManager}. + * + * @mixin + * @memberof PIXI.interaction + * @example + * function MyObject() {} + * + * Object.assign( + * MyObject.prototype, + * PIXI.interaction.interactiveTarget) + * ); + */ +module.exports = { + /** + * @todo + */ + interactive: false; + /** + * @todo + */ + buttonMode: false; + /** + * @todo + */ + interactiveChildren: true; + /** + * @todo + */ + defaultCursor: 'pointer'; -core.DisplayObject.prototype.interactive = false; -core.DisplayObject.prototype.buttonMode = false; -core.DisplayObject.prototype.interactiveChildren = true; -core.DisplayObject.prototype.defaultCursor = 'pointer'; + // some internal checks.. -// some internal checks.. -core.DisplayObject.prototype._over = false; -core.DisplayObject.prototype._touchDown = false; - -module.exports = {}; + /** + * @todo + * @private + */ + _over: false; + /** + * @todo + * @private + */ + _touchDown: false; +};