newlist

  博客园 :: 首页 :: 博问 :: 闪存 :: 新随笔 :: 联系 :: 订阅 订阅 :: 管理 ::
上一页 1 ··· 8 9 10 11 12 13 14 15 16 ··· 26 下一页

2013年7月27日

摘要: Test6::Test6(){ CCSprite* sp1 = CCSprite::create(s_pPathSister1); CCSprite* sp11 = CCSprite::create(s_pPathSister1); CCSprite* sp2 = CCSprite::create(s_pPathSister2); CCSprite* sp21 = CCSprite::create(s_pPathSister2); sp1->setPosition(ccp(100,160)); sp2->setPosition(ccp(380... 阅读全文
posted @ 2013-07-27 07:25 一枚程序 阅读(1931) 评论(0) 推荐(0) 编辑

2013年7月25日

摘要: Test5::Test5(){ CCSprite* sp1 = CCSprite::create(s_pPathSister1); CCSprite* sp2 = CCSprite::create(s_pPathSister2); sp1->setPosition(ccp(100,160)); sp2->setPosition(ccp(380,160)); CCRotateBy* rot = CCRotateBy::create(2, 360); CCActionInterval* rot_back = rot->reverse(); CCAc... 阅读全文
posted @ 2013-07-25 21:26 一枚程序 阅读(5130) 评论(0) 推荐(0) 编辑

摘要: Test4::Test4(){ CCSprite *sp1 = CCSprite::create(s_pPathSister1); CCSprite *sp2 = CCSprite::create(s_pPathSister2); sp1->setPosition( ccp(100,160) ); sp2->setPosition( ccp(380,160) ); addChild(sp1, 0, 2); addChild(sp2, 0, 3); //在第二秒的时候执行delay2函数 schedule( schedule_sel... 阅读全文
posted @ 2013-07-25 20:00 一枚程序 阅读(3122) 评论(0) 推荐(0) 编辑

摘要: void Test2::onEnter(){ TestCocosNodeDemo::onEnter(); CCSize s = CCDirector::sharedDirector()->getWinSize(); CCSprite *sp1 = CCSprite::create(s_pPathSister1); CCSprite *sp2 = CCSprite::create(s_pPathSister2); CCSprite *sp3 = CCSprite::create(s_pPathSister1); CCSprite *sp4 = CCSp... 阅读全文
posted @ 2013-07-25 19:30 一枚程序 阅读(381) 评论(0) 推荐(0) 编辑

摘要: #ifndef _DRAW_PRIMITIVES_TEST_H_#define _DRAW_PRIMITIVES_TEST_H_////----#include "cocos2d.h"#include "../testBasic.h"class DrawPrimitivesTest : public CCLayer{public: DrawPrimitivesTest(); virtual void draw();//必须重写这个函数,画图要在这函数中画};class DrawPrimitivesTestScene : public TestScene{ 阅读全文
posted @ 2013-07-25 15:19 一枚程序 阅读(997) 评论(0) 推荐(0) 编辑

摘要: void MotionStreakTest1::onEnter(){ MotionStreakTest::onEnter(); CCSize s = CCDirector::sharedDirector()->getWinSize(); // the root object just rotates around m_root = CCSprite::create(s_pPathR1); addChild(m_root, 1); m_root->setPosition(ccp(s.width/2, s.height/2)); // the ta... 阅读全文
posted @ 2013-07-25 08:49 一枚程序 阅读(1408) 评论(0) 推荐(0) 编辑

摘要: //创建类的对象,并返回相应类的指针/** * define a create function for a specific type, such as CCLayer * @__TYPE__ class type to add create(), such as CCLayer */#define CREATE_FUNC(__TYPE__) \static __TYPE__* create() \{ \ __TYPE__ *pRet = new __TYPE__(); \ if (pRet && pRet->init()) \ { \ pRet->autor.. 阅读全文
posted @ 2013-07-25 07:18 一枚程序 阅读(325) 评论(0) 推荐(0) 编辑

2013年7月23日

摘要: 关于scheduleUpdate看这篇即可http://www.benmutou.com/blog/archives/56接下来是示例代码: CCSize size = CCDirector::sharedDirector()->getWinSize(); //创建二个精灵,一绿一红 CCSprite *psSprite1 = CCSprite::create("green.png"); CCSprite *psSprite2 = CCSprite::create("red.png"); //利用精灵创建进度条,并设置一些属... 阅读全文
posted @ 2013-07-23 21:57 一枚程序 阅读(1651) 评论(0) 推荐(0) 编辑

摘要: pSprite->setAnchorPoint(CCPoint(0,0)); pSprite->setPosition(CCPoint(300,700)); CCFiniteTimeAction* pAcion = CCEaseElasticOut::actionWithAction( CCMoveTo::create(1.0f,CCPoint(300,300)),0.6f);//通过第二个参数来调整振幅,或者速度,值越大越慢振幅越小 pSprite->runAction( CCRepeatForever::create( ... 阅读全文
posted @ 2013-07-23 21:34 一枚程序 阅读(2588) 评论(0) 推荐(0) 编辑

摘要: 关于ccTouchesEnded看这个博客即可http://blog.linguofeng.com/archive/2012/09/12/cocos2d-x-touch.htmlclass ClickAndMoveTestScene : public TestScene{public: virtual void runThisTest();};class MainLayer : public CCLayer{public: MainLayer(); virtual void ccTouchesEnded(CCSet *pTouches, CCEvent *pEvent);};... 阅读全文
posted @ 2013-07-23 17:36 一枚程序 阅读(508) 评论(0) 推荐(0) 编辑

上一页 1 ··· 8 9 10 11 12 13 14 15 16 ··· 26 下一页