var pt:Point = sceneView.worldView.globalToLocal(new Point(e.stageX-80,e.stageY-80)); //转换当前点的坐标到worldView上
private function conversionGotoPt(goalpt:Point):Point//目标点转化
{
var centerpt:Point = new Point(wSize / 2 - groundLayerView.x ,hSize / 2 - groundLayerView.y);
var gotopt:Point = new Point(groundLayerView.x - (goalpt.x - centerpt.x),groundLayerView.y - (goalpt.y - centerpt.y));
var topPt:Point = new Point(wSize/2,hSize/2);
var topDownPt:Point = new Point(wSize/2,this.groundLayerView.height-(hSize/2));
var leftPt:Point = new Point(this.groundLayerView.width-(wSize/2),hSize/2);
var leftDownPt:Point = new Point(this.groundLayerView.width-(wSize/2),this.groundLayerView.height-(hSize/2));
if(goalpt.x>leftPt.x && goalpt.y < leftPt.y)
{
gotopt.x = wSize-groundLayerView.width;
gotopt.y = 0;
}
else if( goalpt.x>leftDownPt.x && goalpt.y > leftDownPt.y)
{
gotopt.x = wSize-groundLayerView.width;
gotopt.y = hSize-groundLayerView.height;
}
else if(goalpt.x<topDownPt.x && goalpt.y > topDownPt.y)
{
gotopt.x = 0;
gotopt.y = hSize-groundLayerView.height;
}
else if(goalpt.x<topPt.x && goalpt.y < topPt.y )
{
gotopt.x = 0;
gotopt.y = 0;
}
else if(goalpt.x < (wSize/2))
{
gotopt.x = 0;
}
else if(goalpt.x > this.worldView.width-(wSize/2))
{
gotopt.x = wSize-groundLayerView.width;
}
else if(goalpt.y < (hSize/2))
{
gotopt.y = 0;
}
else if( goalpt.y > this.worldView.height-(hSize/2))
{
gotopt.y = hSize-groundLayerView.height;
}
return gotopt;
}