From 7ec6c14e655f0cb152c9e3730d69fe67029964af Mon Sep 17 00:00:00 2001 From: Fishrock123 Date: Tue, 16 Apr 2013 23:37:28 -0400 Subject: [PATCH] Added Stage.getMousePosition() Directly returns a more sane path to the Stage.interactionManager.mouse.global point object that contains the mouse's coords. --- src/pixi/Stage.js | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/src/pixi/Stage.js b/src/pixi/Stage.js index d589658..2562054 100644 --- a/src/pixi/Stage.js +++ b/src/pixi/Stage.js @@ -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;