Skip to content

Commit 8ef1534

Browse files
author
Lanny McNie
committed
Minor doc update to Container.getObjectsUnderPoint
1 parent de8ea5e commit 8ef1534

File tree

1 file changed

+19
-15
lines changed

1 file changed

+19
-15
lines changed

src/easeljs/display/Container.js

Lines changed: 19 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -173,11 +173,11 @@ this.createjs = this.createjs||{};
173173
*
174174
* <h4>Example</h4>
175175
*
176-
* container.addChild(bitmapInstance);
176+
* container.addChild(bitmapInstance);
177177
*
178-
* You can also add multiple children at once:
178+
* You can also add multiple children at once:
179179
*
180-
* container.addChild(bitmapInstance, shapeInstance, textInstance);
180+
* container.addChild(bitmapInstance, shapeInstance, textInstance);
181181
*
182182
* @method addChild
183183
* @param {DisplayObject} child The display object to add.
@@ -459,23 +459,27 @@ this.createjs = this.createjs||{};
459459

460460
/**
461461
* Returns an array of all display objects under the specified coordinates that are in this container's display
462-
* list. This routine ignores any display objects with mouseEnabled set to false. The array will be sorted in order
463-
* of visual depth, with the top-most display object at index 0. This uses shape based hit detection, and can be an
464-
* expensive operation to run, so it is best to use it carefully. For example, if testing for objects under the
465-
* mouse, test on tick (instead of on mousemove), and only if the mouse's position has changed.
462+
* list. This routine ignores any display objects with {{#crossLink "DisplayObject/mouseEnabled:property"}}{{/crossLink}}
463+
* set to `false`. The array will be sorted in order of visual depth, with the top-most display object at index 0.
464+
* This uses shape based hit detection, and can be an expensive operation to run, so it is best to use it carefully.
465+
* For example, if testing for objects under the mouse, test on tick (instead of on {{#crossLink "DisplayObject/mousemove:event"}}{{/crossLink}}),
466+
* and only if the mouse's position has changed.
466467
*
467-
* By default this method evaluates all display objects. By setting the `mode` parameter to `1`, the `mouseEnabled`
468-
* and `mouseChildren` properties will be respected.
469-
* Setting it to `2` additionally excludes display objects that do not have active mouse event listeners
470-
* or a `cursor` property. That is, only objects that would normally intercept mouse interaction will be included.
471-
* This can significantly improve performance in some cases by reducing the number of
472-
* display objects that need to be tested.
468+
* <ul>
469+
* <li>By default (mode=0) this method evaluates all display objects.</li>
470+
* <li>By setting the `mode` parameter to `1`, the {{#crossLink "DisplayObject/mouseEnabled:property"}}{{/crossLink}}
471+
* and {{#crossLink "mouseChildren:property"}}{{/crossLink}} properties will be respected.</li>
472+
* <li>Setting the `mode` to `2` additionally excludes display objects that do not have active mouse event
473+
* listeners or a {{#crossLink "DisplayObject:cursor:property"}}{{/crossLink}} property. That is, only objects
474+
* that would normally intercept mouse interaction will be included. This can significantly improve performance
475+
* in some cases by reducing the number of display objects that need to be tested.</li>
476+
* </li>
473477
*
474-
* Accounts for both {{#crossLink "DisplayObject/hitArea:property"}}{{/crossLink}} and {{#crossLink "DisplayObject/mask:property"}}{{/crossLink}}.
478+
* This method accounts for both {{#crossLink "DisplayObject/hitArea:property"}}{{/crossLink}} and {{#crossLink "DisplayObject/mask:property"}}{{/crossLink}}.
475479
* @method getObjectsUnderPoint
476480
* @param {Number} x The x position in the container to test.
477481
* @param {Number} y The y position in the container to test.
478-
* @param {Number} mode The mode to use to determine which display objects to include. 0-all, 1-respect mouseEnabled/mouseChildren, 2-only mouse opaque objects.
482+
* @param {Number} [mode=0] The mode to use to determine which display objects to include. 0-all, 1-respect mouseEnabled/mouseChildren, 2-only mouse opaque objects.
479483
* @return {Array} An Array of DisplayObjects under the specified coordinates.
480484
**/
481485
p.getObjectsUnderPoint = function(x, y, mode) {

0 commit comments

Comments
 (0)