bool HelloWorld::init()
{
//////////////////////////////
// 1. super init first
if ( !Layer::init() )
return false;
auto listener = EventListenerTouchOneByOne::create();
listener->setSwallowTouches(false);
listener->onTouchBegan = (Touch* touch, Event* event)
{
Vec2 pos = this->convertToNodeSpace(touch->getLocationInView());
CCLOG("%d,%d,%d,%d", touch->getLocationInView().x, touch->getLocationInView().y, pos.x, pos.y);
return true;
};
_eventDispatcher->addEventListenerWithSceneGraphPriority(listener, this);
return true;
}
```
请问如何得到正确的鼠标位置,小弟纯属自学,求教各位大神。
%f

,对啊,谢谢。找了好久都找不到问题所在。。。