简体   繁体   English

如何使用Cocos 2d摇动iPhone

[英]How to do shake the iPhone using Cocos 2d

I can detect shake in iPhone using Cocos 2D when I use: 使用以下工具时,我可以使用Cocos 2D检测iPhone中的震动:

-(void)accelerometer:(UIAccelerometer *)accelerometer didAccelerate:(UIAcceleration *)acceleration

Now, I want to do shake the iPhone using Cocos 2D. 现在,我想使用Cocos 2D摇动iPhone。 Who can help me? 谁能帮我?

You cannot physically shake your iPhone using Cocos2d. 您无法使用Cocos2d来摇动iPhone。 But if you want to vibrate your phone programatically, check this: Making the iPhone vibrate 但是,如果要以编程方式振动手机,请检查以下内容: 使iPhone振动

在iOS模拟器中,单击“硬件”,然后在下拉菜单中看到“摇动手势” ...单击该

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM