[IOS-cocos2d-X game development 12] custom cocos2dx joystick (enhanced joystick), increase the joystick following the user contact as the joystick coordinates, so that the joystick is no longer rigid!

Source: Internet
Author: User

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
Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.