win32的API实在太麻烦了,但是glVIEw里面有个setCursorVisible的方法,可是借此实现同样的效果。
AppDelegate.cpp中:
glvIEw = GLVIEwImpl::createWithFullScreen("123465");glvIEw->setCursorVisible(false);director->setopenGLVIEw(glvIEw);
自己的layer中:
//鼠标指针auto cursor = Sprite::create("cursor_nor.png");this->_cursor = Node::create();this->_cursor->addChild(cursor);this->addChild(this->_cursor,10000);auto ListenerMouse = EventListenerMouse::create(); ListenerMouse->onMouseMove = [&](cocos2d::EventMouse* event) { Point mouse = event->getLocation(); mouse.y = 1024 - mouse.y; this->_cursor->setposition(Point(mouse.x+20,mouse.y-30)); }; ListenerMouse->onMouseDown = [&](cocos2d::EventMouse* event) { this->_cursor->removeAllChildren(); auto cursor = Sprite::create("cursor_pre.png"); this->_cursor->addChild(cursor); }; ListenerMouse->onmouseup = [&](cocos2d::EventMouse* event) { this->_cursor->removeAllChildren(); auto cursor = Sprite::create("cursor_nor.png"); this->_cursor->addChild(cursor); }; this->_eventdispatcher->addEventListenerWithFixedPriority(ListenerMouse,1);总结
以上是内存溢出为你收集整理的cocos2dx win32修改鼠标指针图案全部内容,希望文章能够帮你解决cocos2dx win32修改鼠标指针图案所遇到的程序开发问题。
如果觉得内存溢出网站内容还不错,欢迎将内存溢出网站推荐给程序员好友。
欢迎分享,转载请注明来源:内存溢出
评论列表(0条)