Touch location for a big scene [Solved]

Touch location for a big scene [Solved]
0.0 0


Hello friends,
I have one problem in one scenario where my scene is of size 720x720
So when i move object at the end or may be at some position beyond the screen that time i am getting touch location relative to device screen…
How to get touch location relative to the scene…

For example
sprite location 600,600
and touching sprite getting location of screen coordinate at that location like 200,300…(because scene camera moved to that location)

How to get touch location relative to scene?


Ok got the solution…
First get current position of the current layer

float OffsetX,OffsetY;
OffsetX = this~~>getPosition.x;
OffsetY = this~~>getPosition().y;

Second adding that Offset to the touch location

cocos2d::CCTouch *myTouch = (CCTouch *)touches~~>anyObject;
cocos2d::CCPoint location = myTouch~~>locationInView();
location = cocos2d::CCDirector::sharedDirector()->convertToGL(location);

location.x = (-OffsetX + location.x);
location.y = (-OffsetY + location.y);

Still this is the temporary solution.If anybody know how to get it proper with the Z coordinate also then it would be appreciable.