This siteArticleBothLi huaming himiOriginal, reprinted must be clearly indicated: Reprinted from[Heimi gamedev block]Link: http://www.himigame.com/iphone-cocos2dx/721.html☞Click to subscribe☜The latest developments in this blog! Notify you of the latest blog in time!
Virtual joystick is essential for game development. For Android, It is encapsulated by himi. You can click here to view the detailed implementation mechanism:
[Android game development 24] 360 ° smooth game joystick (touch screen navigation)
So the cocos2d engine has provided this joystick class (joystick), so himi is too lazy to rewrite it, But cocos2dx is not encapsulated. Here, himi provides joystick (hrocker class) for cocos2dx ), in addition, himi adds the following user contact to this class as the joystick coordinate function!
Not much hereCodeThe structure directly posts the source code, and then focuses on the usage and method parameters. For specific implementation, refer to the implementation mechanism of the source code and some Android himi;
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657 |