1. The automatically adapted HD mode cannot load resources.
Reproduction method: Enable HD adaptation
- pDirector->enableRetinaDisplay(true);
HD resources are provided, but SD resources are not provided. For example, xxxx-hd.png is provided, but General xxxx.png is not provided. Note that the error recurrence rate is unstable. You must delete the software on your mobile phone and clean the project to have a high probability of recurrence.
Phenomenon: loading resources on HD phones fails, and the game is stuck.
Analysis: Debugging found that fullPathFromRelativePath could not obtain the correct path, but directly returned the file name for the parameter.
Conclusion: Both HD and SD images must be provided.
2. CCMenu automatic adaptation interface disorder
Reproduction method: Use the Automatic Layout function of CCMenu to adapt to temporary resource images, and then use larger image resources.
Symptom: The positions of item buttons are superimposed on each other.
Analysis: cocos2d-x CCMenu has some very convenient automatic layout functions, such as alignItemsXXX, when the resource picture is small enough, use these functions does not matter, if the picture is large, location overlap may occur during adaptation. conclusion: if you are not in trouble, it is best to manually control the layout.
3. XCode4.2, iTouch2 4.21 system, which is fully configured by default. It can be run with hello world, 5.01 tou42. 4.21 touch2 cannot run.Reproduction Method: In XCode4.2, with the cocos2d-x template to establish helloworld, plug touch2, point run, compiled successfully, but no reaction on the phone phenomenon: the phone did not respond, there is no output in the console. On the device console, there will be something similar to the following:
- unknown lockdownd[16] <Error>: 2ff68000 handle_connection: Could not receive USB message #6 from Xcode. Killing connection
Analysis: the old version of iOS mainly refers to 5. before x, and 5. x compilation parameters are different, the main difference is armv6 and armv7, first according to this post check their settings: After the http://stackoverflow.com/questions/6378228/switching-from-xcode3-to-xcode4-cant-load-programs-onto-older-ipod-touch is confirmed correct, in the building setting in ubuntures, add the parameter armv6650) this. width = 650; "border =" 0 "alt =" "src =" http://www.bkjia.com/uploads/allimg/131228/1A9343a8-0.png "/> conclusion: it is best to add this as per project creation to prevent forgetting
4. How to disable automatic rotation of iOS screensIn gravity sensing games, automatic screen rotation is often caused, which will lead to an inversion of the screen, causing inconvenience to the operation. The method to disable gravity sensing is: "Project/ios/RootViewController. mm ", find the following function
- -(BOOL) shouldAutorotateToInterfaceOrientation :( UIInterfaceOrientation) interfaceOrientation {
- // Return UIInterfaceOrientationIsLandscape (interfaceOrientation );
- Return interfaceOrientation = UIInterfaceOrientationPortrait; // enter the direction parameter you want to lock
- // Switch to this line if you want to set portrait view
- // Return UIInterfaceOrientationIsPortrait (interfaceOrientation );
- }
650) this. width = 650; "alt =" "src ="/neweditor/editor/images/smiley/15.gif"/> thanks to friends from group 6 for providing this method, I have known a method for modifying the source code of the engine 650) this. width = 650; "alt =" "src ="/neweditor/editor/images/smiley/23.gif"/>. You do not need to change the engine source code, but only the project code.
This article is from the "Old G hut" blog, please be sure to keep this source http://4137613.blog.51cto.com/4127613/819677