• 博客园logo
  • 会员
  • 周边
  • 新闻
  • 博问
  • 闪存
  • 众包
  • 赞助商
  • Chat2DB
    • 搜索
      所有博客
    • 搜索
      当前博客
  • 写随笔 我的博客 短消息 简洁模式
    用户头像
    我的博客 我的园子 账号设置 会员中心 简洁模式 ... 退出登录
    注册 登录
linux_ios
博客园    首页    新随笔    联系   管理    订阅  订阅
04 2013 档案
cocos2dx 音乐与音效

摘要://根据不同的平台使用的预编译索引不同音频文件#if (CC_TARGET_PLATFORM == CC_PLATFORM_ANDROID)#define EFFECT_FILE "effect2.ogg"#elif (CC_TARCET_PLATFORM == CC_PLATFORM_MARMALADE)#define EFFECT_FILE "effect1.raw"#else#define EFFECT_FILE "effect1.wav"#endif#if (CC_TARGET_PLATEFOM == CC_PLATFORM_ 阅读全文
posted @ 2013-04-13 19:49 linux_ios 阅读(3093) 评论(0) 推荐(0)
cocos2dx 圆形碰撞

摘要:bool HelloWorld::init(){ ////////////////////////////// // 1. super init first if ( !CCLayer::init() ) { return false; } CCLayerColor* colorLayer = CCLayerColor::create(ccc4(0, 0, 255, 0),480 ,320); addChild(colorLayer); CCLabelTTF * pLabel = CCLabelTTF::... 阅读全文
posted @ 2013-04-13 18:05 linux_ios 阅读(871) 评论(0) 推荐(0)
cocos2dx 矩形碰撞

摘要:bool HelloWorld::init(){ ////////////////////////////// // 1. super init first if ( !CCLayer::init() ) { return false; } CCLayerColor* colorLayer = CCLayerColor::create(ccc4(255, 0, 255, 0),480 ,320); addChild(colorLayer); CCLabelTTF * pLabel = CCLabelTTF::creat... 阅读全文
posted @ 2013-04-13 18:03 linux_ios 阅读(1888) 评论(0) 推荐(0)
cocos2dx 多点触屏事件

摘要:CCScene* HelloWorld::scene(){ // 'scene' is an autorelease object CCScene *scene = CCScene::create(); // 'layer' is an autorelease object HelloWorld *layer = HelloWorld::create(); // add layer as a child to scene scene->addChild(layer); // return the scene return scene;}/... 阅读全文
posted @ 2013-04-13 18:02 linux_ios 阅读(1244) 评论(0) 推荐(0)
cocos2dx 触屏事件

摘要:// on "init" you need to initialize your instancebool HelloWorld::init(){ ////////////////////////////// // 1. super init first if ( !CCLayer::init() ) { return false; } CCSprite * spr = CCSprite::create("Icon.png"); spr->setPosition(ccp(150, 200)); addChild(spr, 0... 阅读全文
posted @ 2013-04-13 18:01 linux_ios 阅读(453) 评论(0) 推荐(0)
cocos2dx 常见的32种切换场景的动画

摘要:bool HelloWorld::init(){ ////////////////////////////// // 1. super init first if ( !CCLayer::init() ) { return false; } CCSize size = CCDirector::sharedDirector()->getWinSize(); CCSprite * sp= CCSprite::create("background1.png"); sp->setPosition(ccp( size.width/2... 阅读全文
posted @ 2013-04-09 18:59 linux_ios 阅读(4064) 评论(0) 推荐(0)
cocos2dx 动画常见的22种特效

摘要:bool HelloWorld::init(){ ////////////////////////////// // 1. super init first if ( !CCLayer::init() ) { return false; } CCSize size =CCDirector::sharedDirector()->getWinSize();//获取屏幕大小 CCSprite * sp = CCSprite::create("Icon.png"); sp->setPosition(ccp(200, 200));... 阅读全文
posted @ 2013-04-09 08:32 linux_ios 阅读(5247) 评论(0) 推荐(0)
cocos2dx 自定义动画 手动添加

摘要:bool HelloWorld::init(){ ////////////////////////////// // 1. super init first if ( !CCLayer::init() ) { return false; } // CCSprite * sp= CCSprite::create("crop1.png");// sp->setPosition(ccp(170, 200));// addChild(sp);// // CCAnimation * animation = CCAnimati... 阅读全文
posted @ 2013-04-08 17:28 linux_ios 阅读(709) 评论(0) 推荐(0)
cocos2dx 自定义动画

摘要:bool HelloWorld::init(){ ////////////////////////////// // 1. super init first if ( !CCLayer::init() ) { return false; }//// 添加4个精灵, 每个精灵用来标示一帧// CCSprite * sp1= CCSprite::create("crop1.png");// CCSprite * sp2= CCSprite::create("crop2.png");// CCSprite * sp3= CCSpri... 阅读全文
posted @ 2013-04-08 17:26 linux_ios 阅读(542) 评论(0) 推荐(0)
cocos2dx 常见的49中动作详解

摘要:bool HelloWorld::init(){ ////////////////////////////// // 1. super init first if ( !CCLayer::init() ) { return false; } CCSprite * sp= CCSprite::create("Icon.png"); sp->setPosition(ccp(150, 150)); addChild(sp,0,922); //// Action动作// ////CCMoveBy 创建一个移动的动作 参数1... 阅读全文
posted @ 2013-04-06 09:03 linux_ios 阅读(9304) 评论(0) 推荐(2)
cocos2dx 基础

摘要:经过这段时间 , 将cocos2dx的基础部分学完了, 需要消化 , 更需要项目经验啊!继续学习 动作和动画! 加油啊 少年! 阅读全文
posted @ 2013-04-04 13:47 linux_ios 阅读(321) 评论(0) 推荐(0)
cocos2dx CCScrollView 滚动视图

摘要:bool HelloWorld::init(){ ////////////////////////////// // 1. super init first if ( !CCLayer::init() ) { return false; } CCSize size = CCDirector::sharedDirector()->getWinSize();// 创建一个layer作为容器 CCLayer * containlayer = CCLayer::create(); CCSprite * sp = CCSprit... 阅读全文
posted @ 2013-04-04 13:42 linux_ios 阅读(1906) 评论(0) 推荐(0)
cocos2dx CCProgressTimer 进度条计时器

摘要:bool HelloWorld::init(){ ////////////////////////////// // 1. super init first if ( !CCLayer::init() ) { return false; } CCProgressTimer * pr = CCProgressTimer::create(CCSprite::create("Icon.png")); pr->setPosition(ccp(100,200));// 设置进度条的样式 pr->setType(kCCProgressTi... 阅读全文
posted @ 2013-04-04 11:30 linux_ios 阅读(1522) 评论(0) 推荐(0)
cocos2dx scheduleUpdate 更新函数

摘要:bool HelloWorld::init(){ ////////////////////////////// // 1. super init first if ( !CCLayer::init() ) { return false; } CCSprite* sp = CCSprite::create("Icon.png"); sp->setPosition(ccp(100,100)); addChild(sp,0,922); // scheduleUpdate();// 自定义更新函数 , 每一帧都调用 sche... 阅读全文
posted @ 2013-04-04 11:06 linux_ios 阅读(1886) 评论(2) 推荐(0)
cocos2dx 获取设备的当前语言

摘要:// 获取当前设备的语言 CCSize size= CCDirector::sharedDirector()->getWinSize();// 这个是显示当前设备 CCLabelTTF * labelLanguage = CCLabelTTF::create("", "", 20); labelLanguage->setPosition(ccp(size.width* 0.5, size.height*0.5)); // 获取语言 ccLanguageType la = CCApplication::sharedApplica... 阅读全文
posted @ 2013-04-04 09:46 linux_ios 阅读(748) 评论(0) 推荐(0)
cocos2dx 绘图Draw

摘要:void HelloWorld::draw(){ CCSize size = CCDirector::sharedDirector()->getWinSize();// 设置颜色 ccDrawColor4B(255, 0, 255, 0);// 设置宽度 glLineWidth(3);// 绘制一条直线 起点到终点的位置 ccDrawLine(ccp(0, 0), ccp(size.width*0.5, size.height*0.5)); ccDrawColor4B(225, 255, 0, 0);// 设置像素尺寸 ... 阅读全文
posted @ 2013-04-04 09:44 linux_ios 阅读(868) 评论(0) 推荐(0)
cocos2dx CCControlButton 按钮事件

摘要:bool HelloWorld::init(){ ////////////////////////////// // 1. super init first if ( !CCLayer::init() ) { return false; } CCLabelTTF * label = CCLabelTTF::create("为选中文字", "MarkerFelt",25); CCControlButton * button = CCControlButton ::create(label,CCScale9Sprite::create("bu... 阅读全文
posted @ 2013-04-03 23:58 linux_ios 阅读(2248) 评论(0) 推荐(0)
cocos2dx CCControlSlider 滑动条

摘要://滑动条 CCControlSlider * slider = CCControlSlider ::create("sliderBg.png", "sliderProgress.png", "sliderThumb.png"); slider->setPosition(ccp(200, 170));// 设置滑动条最大值 slider->setMaximumValue(100); // 设置滑动条最小值 slider->setMinimumValue(0); addChild(slider,0,921);// 设置 阅读全文
posted @ 2013-04-01 23:49 linux_ios 阅读(2516) 评论(0) 推荐(0)

博客园  ©  2004-2026
浙公网安备 33010602011771号 浙ICP备2021040463号-3