Cocos2d-x for iOS multi-touch issues

Source: Internet
Author: User
Tags apple keyboard

Still reading study and practice, but the book of mistakes really ...

The first is Cclayer, which has written a class that inherits from Ccsprite, implements a single touch with the finger, overrides the begin,moved and end functions, and then sets and cancels the proxy in OnEnter and Oneixt. The example in the book is directly to the HelloWorld, not only rewrite the three functions, but also rewrite the Registerwithtouchdispatcher function, I write all to give a hint error, roughly ambiguous conversion from class HelloWorld to Cctouchdelegate kind of ~ ~ Actually because inherited the Cclayer function, so do not rewrite this. Replaced by the Ccsprite after this sentence will not error.

Then there is the multi-touch of the iOS simulator. The option key and the mouse, not the Apple keyboard, are alt and mouse. If you want to scale to size, it always fails. In the BEGIN function it was only judged that the contact was more than two, and there was a further judgment.

    if (Ptouches->count () = =1

Then two conditions to print different information, we found that using the ALT key to get is just a contact information ~ Although the simulator on the screen gave two ~

Had to ask Niang, the solution is in the iOS directory files need to change ~appcontroller this file ~ in

BOOL) Application: (uiapplication *) application didfinishlaunchingwithoptions: (nsdictionary *) Launchoptions

This function adds a sentence:[__glview setmultipletouchenabled: true];

Originally thought is in HelloWorld inside onenter Such add, always hold the wrong ... The original is here ~ ~

Then you can.

Another thing to note is the type of distance and scale ~ before the brain pumping set int, so the whole tragedy ~ ~

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.