摘要: 自定义的方法Poly.h 1 // 2 // Poly.h 3 // L01DrawingAPI 4 // 5 // Created by Mac OS 10.9.3 on 15-3-30. 6 // 7 // 8 9 #ifndef __L01DrawingAPI__Poly__10 #d... 阅读全文
posted @ 2015-03-30 08:41 silent-bobo 阅读(687) 评论(0) 推荐(0) 编辑
摘要: Cocos2d-x之绘制填充圆形自定义的方法SCircle.h 1 // 2 // SCircle.h 3 // L01DrawingAPI 4 // 5 // Created by Mac OS 10.9.3 on 15-3-30. 6 // 7 // 8 9 #ifndef __L01D... 阅读全文
posted @ 2015-03-30 08:12 silent-bobo 阅读(581) 评论(0) 推荐(0) 编辑
摘要: 自定义的方法Circle.h 1 // 2 // Circle.h 3 // L01DrawingAPI 4 // 5 // Created by Mac OS 10.9.3 on 15-3-30. 6 // 7 // 8 9 #ifndef __L01DrawingAPI__Circle_... 阅读全文
posted @ 2015-03-30 07:53 silent-bobo 阅读(1377) 评论(0) 推荐(0) 编辑
摘要: Cocos2d-x之绘制填充矩形自定义的方法SRect.h 1 // 2 // SRect.h 3 // L01DrawingAPI 4 // 5 // Created by Mac OS 10.9.3 on 15-3-30. 6 // 7 // 8 9 #ifndef __L01Drawi... 阅读全文
posted @ 2015-03-30 07:16 silent-bobo 阅读(545) 评论(0) 推荐(0) 编辑
摘要: Cocos2d-x之绘制矩形自定义的方法Rect.h 1 // 2 // Rect.h 3 // L01DrawingAPI 4 // 5 // Created by Mac OS 10.9.3 on 15-3-29. 6 // 7 // 8 9 #ifndef __L01DrawingAP... 阅读全文
posted @ 2015-03-29 14:57 silent-bobo 阅读(910) 评论(0) 推荐(0) 编辑
摘要: Node类中的draw()方法,重写draw方法去绘制图形 1 //创建自定义的类 2 class Shape:public Node { 3 public: 4 //重写draw方法,用于绘制图形 5 virtual void draw(){ 6 //使用DrawP... 阅读全文
posted @ 2015-03-29 14:14 silent-bobo 阅读(195) 评论(0) 推荐(0) 编辑
摘要: 1 //如何监听按键事件 2 //创建物理按键的监听事件 3 auto listener = EventListenerKeyboard::create(); 4 //按键被释放时执行的操作,EventKeyboard::KeyCode表示按键代码 5 listen... 阅读全文
posted @ 2015-03-29 10:51 silent-bobo 阅读(424) 评论(0) 推荐(0) 编辑
摘要: cocos2d-x之加速度传感器使用真机来调试1 //加速度的默认状态是关闭的,需要手动的开启2 Device::setAccelerometerEnabled(true);3 4 //auto listener = EventListenerAcceleration::cr... 阅读全文
posted @ 2015-03-29 10:15 silent-bobo 阅读(441) 评论(0) 推荐(0) 编辑
摘要: cocos2d-x之多点触摸事件 1 //全部所有的触摸点一起触发 2 auto listener = EventListenerTouchAllAtOnce::create(); 3 4 listener->onTouchesBegan = [](std::vector ... 阅读全文
posted @ 2015-03-29 09:44 silent-bobo 阅读(527) 评论(0) 推荐(0) 编辑
摘要: cocos2d-x之事件传递(onTouchBegan的返回值的作用)只有当onTouchBegan的返回值是true时才执行后面的两个触摸事件 1 //onTouchBegan表示开始触摸的事件 2 listener->onTouchBegan = [](Touch *t, Event *... 阅读全文
posted @ 2015-03-29 08:59 silent-bobo 阅读(4735) 评论(0) 推荐(0) 编辑