Skip to content

Commit 9bc4483

Browse files
committed
Added x/y getters to input manager for quick (if limited) access
1 parent fb8b428 commit 9bc4483

1 file changed

Lines changed: 20 additions & 0 deletions

File tree

v3/src/input/local/SceneInputManager.js

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -117,6 +117,26 @@ var SceneInputManager = new Class({
117117
sortHandlerGO: require('./components/SortHandlerGO'),
118118
sortHandlerIO: require('./components/SortHandlerIO'),
119119

120+
// The x/y coordinates of the ActivePointer based on the first camera in the camera list.
121+
// This is only safe to use if your game has just 1 non-transformed camera and doesn't use multi-touch.
122+
x: {
123+
124+
get: function ()
125+
{
126+
return this.manager.activePointer.x;
127+
}
128+
129+
},
130+
131+
y: {
132+
133+
get: function ()
134+
{
135+
return this.manager.activePointer.y;
136+
}
137+
138+
},
139+
120140
// Scene that owns this is shutting down
121141
shutdown: function ()
122142
{

0 commit comments

Comments
 (0)