diff --git a/src/core/display/DisplayObject.js b/src/core/display/DisplayObject.js index 018cec8..def3434 100644 --- a/src/core/display/DisplayObject.js +++ b/src/core/display/DisplayObject.js @@ -10,6 +10,7 @@ * * @class * @extends EventEmitter + * @mixes PIXI.interaction.interactiveTarget * @memberof PIXI */ function DisplayObject() @@ -73,13 +74,6 @@ this.filterArea = null; /** - * Interaction shape. Children will be hit first, then this shape will be checked. - * - * @member {PIXI.Rectangle|PIXI.Circle|PIXI.Ellipse|PIXI.Polygon|PIXI.RoundedRectangle} - */ - this.hitArea = null; - - /** * The original, cached bounds of the object * * @member {PIXI.Rectangle} diff --git a/src/core/display/DisplayObject.js b/src/core/display/DisplayObject.js index 018cec8..def3434 100644 --- a/src/core/display/DisplayObject.js +++ b/src/core/display/DisplayObject.js @@ -10,6 +10,7 @@ * * @class * @extends EventEmitter + * @mixes PIXI.interaction.interactiveTarget * @memberof PIXI */ function DisplayObject() @@ -73,13 +74,6 @@ this.filterArea = null; /** - * Interaction shape. Children will be hit first, then this shape will be checked. - * - * @member {PIXI.Rectangle|PIXI.Circle|PIXI.Ellipse|PIXI.Polygon|PIXI.RoundedRectangle} - */ - this.hitArea = null; - - /** * The original, cached bounds of the object * * @member {PIXI.Rectangle} diff --git a/src/interaction/interactiveTarget.js b/src/interaction/interactiveTarget.js index a331ca2..726e71b 100644 --- a/src/interaction/interactiveTarget.js +++ b/src/interaction/interactiveTarget.js @@ -1,6 +1,6 @@ /** * Default property values of interactive objects - * used by {@link PIXI.interaction.InteractionManager}. + * Used by {@link PIXI.interaction.InteractionManager} to automatically give all DisplayObjects these properties * * @mixin * @memberof PIXI.interaction @@ -14,34 +14,74 @@ */ var interactiveTarget = { /** - * @todo Needs docs. + * Determines if the displayObject be clicked/touched + * + * @inner {boolean} */ interactive: false, + /** - * @todo Needs docs. - */ - buttonMode: false, - /** - * @todo Needs docs. + * Determines if the children to the displayObject can be clicked/touched + * Setting this to false allows pixi to bypass a recursive hitTest function + * + * @inner {boolean} */ interactiveChildren: true, + /** - * @todo Needs docs. + * Interaction shape. Children will be hit first, then this shape will be checked. + * + * @inner {PIXI.Rectangle|PIXI.Circle|PIXI.Ellipse|PIXI.Polygon|PIXI.RoundedRectangle} + */ + hitArea: null, + + /** + * If enabled, the mouse cursor will change when hovered over the displayObject if it is interactive + * + * @inner {boolean} + */ + buttonMode: false, + + /** + * If buttonMode is enabled, this defines what CSS cursor property is used when the mouse cursor is hovered over the displayObject + * https://developer.mozilla.org/en/docs/Web/CSS/cursor + * + * @inner {string} */ defaultCursor: 'pointer', // some internal checks.. - /** - * @todo Needs docs. + * Internal check to detect if the mouse cursor is hovered over the displayObject + * + * @inner {boolean} * @private */ _over: false, + /** - * @todo Needs docs. + * Internal check to detect if the left mouse button is pressed on the displayObject + * + * @inner {boolean} + * @private + */ + _isLeftDown: false, + + /** + * Internal check to detect if the right mouse button is pressed on the displayObject + * + * @inner {boolean} + * @private + */ + _isRightDown: false, + + /** + * Internal check to detect if a user has touched the displayObject + * + * @inner {boolean} * @private */ _touchDown: false -}; + }; module.exports = interactiveTarget;