当光标点击这个位置时,节点移动到这里,这里没有问题,图片和代码如下:
void HelloWorld::onMouseDown(Event* event){
node3_3=Sprite::create("ty.png");
node3_3->setPosition(node2->getPosition());
this->addChild(node3_3);
this->p_3=(EventMouse*)event;
auto moveTo = MoveTo::create(1, Vec2(p_3->getCursorX(),p_3->getCursorY()));
node3_3->runAction(moveTo);
}
然后节点向右移动,
场景向左移动一定距离后,光标停留在红圈上并点击,但是节点没有移动到红圈的地方,这是为什么?图片及代码如下:
bool HelloWorld::init(){
auto s = Director::getInstance()->getWinSize();
auto pFollow=Follow::create(node2,Rect(0, 0, s.width+480, s.height));
this->runAction(pFollow);
}
void HelloWorld::onMouseDown(Event* event){
node3_3=Sprite::create("ty.png");
node3_3->setPosition(node2->getPosition());
this->addChild(node3_3);
this->p_3=(EventMouse*)event;
auto moveTo = MoveTo::create(1, Vec2(p_3->getCursorX(),p_3->getCursorY()));
node3_3->runAction(moveTo);
}

