Added Stage.getMousePosition()

Directly returns a more sane path to the
Stage.interactionManager.mouse.global point object that contains the
mouse's coords.
This commit is contained in:
Fishrock123 2013-04-16 23:37:28 -04:00
parent a1faefe5c7
commit 7ec6c14e65

View file

@ -68,6 +68,16 @@ PIXI.Stage.prototype.setBackgroundColor = function(backgroundColor)
this.backgroundColorString = "#" + this.backgroundColor.toString(16);
}
/**
* This will return the point containing global coords of the mouse.
* @method getMousePosition
* @return {Point} The point containing the coords of the global InteractionData position.
*/
PIXI.Stage.prototype.getMousePosition = function()
{
return this.interactionManager.mouse.global;
}
PIXI.Stage.prototype.__addChild = function(child)
{
if(child.interactive)this.dirty = true;