上一页 1 ··· 31 32 33 34 35 36 37 38 39 ··· 43 下一页
摘要: CCSize size=CCDirector::sharedDirector()->getWinSize(); CCSprite* spr1=CCSprite::create("s_2.png"); spr1->setPosition(ccp(size.width*0.2,size.height*0.2)); this->addChild(spr1); CCActionInterval* action=CCMoveTo::create(3.0f,ccp(size.width*0.8,size.height*0.8)); //spr1->runActi 阅读全文
posted @ 2014-03-21 23:12 yufenghou 阅读(330) 评论(0) 推荐(0)
摘要: CCSize size=CCDirector::sharedDirector()->getWinSize(); CCSprite* spr1=CCSprite::create("s_2.png"); spr1->setPosition(ccp(size.width*0.4,size.height*0.5)); this->addChild(spr1); CCSprite* spr2=CCSprite::create("s_2.png"); spr2->setPosition(ccp(size.width*0.6,size.heig 阅读全文
posted @ 2014-03-21 17:28 yufenghou 阅读(245) 评论(0) 推荐(0)
摘要: CCDictionary* dict=CCDictionary::create(); CCString* str1=CCString::create("123"); CCString* str2=CCString::create("456"); dict->setObject(str1,"key1"); dict->setObject(str2,"key2"); CCString* tempStr=(CCString *)dict->objectForKey("key2"); 阅读全文
posted @ 2014-03-21 17:07 yufenghou 阅读(184) 评论(0) 推荐(0)
摘要: CCArray* arr=CCArray::create(); arr->retain();//如果不加这个东西,CCArray会被清空 arr->addObject(CCSprite::create("s_1.png")); arr->addObject(CCSprite::create("s_2.png")); arr->addObject(CCSprite::create("s_3.png")); arr->addObject(CCSprite::create("s_4.png" 阅读全文
posted @ 2014-03-21 11:10 yufenghou 阅读(139) 评论(0) 推荐(0)
摘要: //获取当前系统的语言 LanguageType language=CCApplication::sharedApplication()->getCurrentLanguage(); //每一帧都回去调用回调函数 schedule(schedule_selector(HelloWorld::scheCallback)); schedule(schedule_selector(HelloWorld::scheCallback),1.0f); //每隔1秒调用一次 scheduleOnce(schedule_selector(HelloWorld::sc... 阅读全文
posted @ 2014-03-20 14:45 yufenghou 阅读(160) 评论(0) 推荐(0)
摘要: // 在init这个函数当中做一些初始化的事情bool HelloWorld::init(){ ////////////////////////////// // 先构造父级对象 if ( !CCLayer::init() ) { return false; } CCSize size=CCDirector::sharedDirector()->getWinSize(); //创建一个label以后就不能再设置位置,有可能会超出屏幕, //这个label不能添加到this当中 CCLabelTTF *label1=CC... 阅读全文
posted @ 2014-03-20 11:58 yufenghou 阅读(255) 评论(0) 推荐(0)
摘要: // 在init这个函数当中做一些初始化的事情bool HelloWorld::init(){ ////////////////////////////// // 先构造父级对象 if ( !CCLayer::init() ) { return false; } CCSize size=CCDirector::sharedDirector()->getWinSize(); //添加一个雪碧图 CCSprite* pSprite = CCSprite::create("love.png"); pSprite->setPo... 阅读全文
posted @ 2014-03-19 23:14 yufenghou 阅读(376) 评论(0) 推荐(0)
摘要: tbl = {"alpha", "beta", ["one"] = "uno", ["two"] = "dos"}for key, value in ipairs(tbl) do print(key, value)end 阅读全文
posted @ 2014-03-05 18:05 yufenghou 阅读(248) 评论(0) 推荐(0)
摘要: x=10local i=1while i20 then local x x =20 print(x+2)else print(x)endprint(x) 阅读全文
posted @ 2014-03-05 17:42 yufenghou 阅读(155) 评论(0) 推荐(0)
摘要: print(type("hello"))print(type(print))--[[给一个全局变量付一个nil数值可以删除这个变量]]--print("10"+1)days={"1","2","3","4","5","6","7"}print(days[4]) 阅读全文
posted @ 2014-03-05 17:21 yufenghou 阅读(111) 评论(0) 推荐(0)
上一页 1 ··· 31 32 33 34 35 36 37 38 39 ··· 43 下一页