【Cocos2d TestCpp实例模仿一】-- ActionsTest

转载请注明出处:http://blog.csdn.net/oyangyufu/article/details/25252539

CCActionInterval(持续性动作) 位置性变化动作以To结束的, 表示精灵变化位置以绝对坐标为參考,左下角(0, 0);以By结尾,表示精灵精灵变化位置以相对坐标为參考,精灵当前所在位置为(0, 0)

移动动作(位置变化)

一、TestCpp实例ActionsTest 模块中ActionManual动作

素材原图:

动作效果图:

程序代码:

bool HelloWorld::init()
{
    if ( !CCLayer::init() )
    {
        return false;
    }

    CCSize visibleSize = CCDirector::sharedDirector()->getVisibleSize();
    CCPoint origin = CCDirector::sharedDirector()->getVisibleOrigin();
    CCMenuItemImage *pCloseItem = CCMenuItemImage::create(
                                        "CloseNormal.png",
                                        "CloseSelected.png",
                                        this,
                                        menu_selector(HelloWorld::menuCloseCallback));

	pCloseItem->setPosition(ccp(origin.x + visibleSize.width - pCloseItem->getContentSize().width/2 ,
                                origin.y + pCloseItem->getContentSize().height/2));

    CCMenu* pMenu = CCMenu::create(pCloseItem, NULL);
    pMenu->setPosition(CCPointZero);
    this->addChild(pMenu, 1);

	设置猛兽白虎的x,y轴缩放、透明度
	CCSprite *sp1 = CCSprite::create("cpp1.png");
	sp1->setScale(1.0f);
	sp1->setScaleX(1.0f);
	sp1->setScaleY(-0.5f);
	sp1->setPosition(ccp(200,visibleSize.height/2));
	sp1->setOpacity(150);//透明度
	this->addChild(sp1);

	设置天使MM的旋转、自身为红色
	CCSprite *sp2 = CCSprite::create("cpp2.png");
	sp2->setScale(0.5f);
	sp2->setRotation(300);//旋转0~360
	sp2->setColor(ccc3(255,0,0));
	sp2->setPosition(ccp(visibleSize.width/2, visibleSize.height/2));
	this->addChild(sp2);

	设置猛兽灰狼的颜色为蓝色
	CCSprite *sp3 = CCSprite::create("cpp3.png");
	sp3->setScale(0.5f);
	sp3->setColor( ccBLUE);//(0,0,255)
	sp3->setPosition(ccp(visibleSize.width-200, visibleSize.height/2));
	this->addChild(sp3);

    return true;
}

二、TestCpp实例ActionsTest 模块中ActionRotate旋转动作

效果图:

程序代码:

bool HelloWorld::init()
{
    if ( !CCLayer::init() )
    {
        return false;
    }

    CCSize visibleSize = CCDirector::sharedDi	rector()->getVisibleSize();
    CCPoint origin = CCDirector::sharedDirector()->getVisibleOrigin();
    CCMenuItemImage *pCloseItem = CCMenuItemImage::create(
                                        "CloseNormal.png",
                                        "CloseSelected.png",
                                        this,
                                        menu_selector(HelloWorld::menuCloseCallback));

	pCloseItem->setPosition(ccp(origin.x + visibleSize.width - pCloseItem->getContentSize().width/2 ,
                                origin.y + pCloseItem->getContentSize().height/2));

    CCMenu* pMenu = CCMenu::create(pCloseItem, NULL);
    pMenu->setPosition(CCPointZero);
    this->addChild(pMenu, 1);

	//******************************ActionRotate旋转*********************************
		CCSprite *sp1 = CCSprite::create("cpp1.png");
	sp1->setScale(0.5f);
	sp1->setPosition(ccp(100, 100));
	this->addChild(sp1);

	CCSprite *sp2 = CCSprite::create("cpp2.png");
	sp2->setScale(0.5f);
	sp2->setPosition(ccp(visibleSize.width/2-100, visibleSize.height/2));
	this->addChild(sp2);

	CCSprite *sp3 = CCSprite::create("cpp3.png");
	sp3->setScale(0.5f);
	sp3->setPosition(ccp(visibleSize.width/2+100, visibleSize.height/2));
	this->addChild(sp3);

	//2s内将顺时针旋转45‘
		CCActionInterval *to = CCRotateTo::create(2.0f, 45);
	CCActionInterval *to0 = CCRotateTo::create(2.0f, 0);

	//2s内将sp1逆时针旋转45‘
		CCActionInterval *to1 = CCRotateTo::create(2.0f, -45);
	sp2->runAction(CCSequence::create(to, to1, NULL));

	//旋转与回旋360‘
		CCActionInterval *by = CCRotateBy::create(2.0f, 360);
	sp3->runAction(CCSequence::create(by, by->reverse(), NULL));

	//先旋转360‘,再运行逆时针旋转45‘(将top1动作在内存中拷贝一份运行,由于to1动画在sp2也在调用,原则两个精灵运行同一个动画,仅仅有最后面一个精灵调用)
	sp1->runAction(CCSequence::create(by, to1->copy()->autorelease(),  NULL));

	return true;
}

三、TestCpp实例ActionsTest 模块中ActionScale缩放动作

程序代码:

bool HelloWorld::init()
{
    if ( !CCLayer::init() )
    {
        return false;
    }

    CCSize visibleSize = CCDirector::sharedDi	rector()->getVisibleSize();
    CCPoint origin = CCDirector::sharedDirector()->getVisibleOrigin();
    CCMenuItemImage *pCloseItem = CCMenuItemImage::create(
                                        "CloseNormal.png",
                                        "CloseSelected.png",
                                        this,
                                        menu_selector(HelloWorld::menuCloseCallback));

	pCloseItem->setPosition(ccp(origin.x + visibleSize.width - pCloseItem->getContentSize().width/2 ,
                                origin.y + pCloseItem->getContentSize().height/2));

    CCMenu* pMenu = CCMenu::create(pCloseItem, NULL);
    pMenu->setPosition(CCPointZero);
    this->addChild(pMenu, 1);

	/******************************ActionScale缩放*********************************/
	CCSprite *sp1 = CCSprite::create("cpp1.png");
	sp1->setScale(0.5f);
	sp1->setPosition(ccp(100, 100));
	this->addChild(sp1);

	CCSprite *sp2 = CCSprite::create("cpp2.png");
	sp2->setScale(0.5f);
	sp2->setPosition(ccp(visibleSize.width/2-100, visibleSize.height/2));
	this->addChild(sp2);

	CCSprite *sp3 = CCSprite::create("cpp3.png");
	sp3->setScale(0.5f);
	sp3->setPosition(ccp(visibleSize.width/2+100, visibleSize.height/2));
	this->addChild(sp3);

	//2s内放大2倍
	CCActionInterval *to = CCScaleTo::create(2.0f, 2.0f);
	//sp1->runAction(to);

	//2s内在原来基础上xy方向分别放大1倍和3倍
	CCActionInterval *by = CCScaleBy::create(2.0f, 1.0f, 3.0f);
	sp2->runAction(by);

	//2s内先xy方向放大3倍和1倍,再缩回到原来大小
	CCActionInterval *bx = CCScaleBy::create(2.0f, 3.0f, 1.0f);
	sp3->runAction(CCSequence::create(bx, bx->reverse(), NULL));

	return true;
}

四、TestCpp实例ActionsTest 模块中ActionMove移动动作

程序代码:

bool HelloWorld::init()
{
    if ( !CCLayer::init() )
    {
        return false;
    }

    CCSize visibleSize = CCDirector::sharedDi	rector()->getVisibleSize();
    CCPoint origin = CCDirector::sharedDirector()->getVisibleOrigin();
    CCMenuItemImage *pCloseItem = CCMenuItemImage::create(
                                        "CloseNormal.png",
                                        "CloseSelected.png",
                                        this,
                                        menu_selector(HelloWorld::menuCloseCallback));

	pCloseItem->setPosition(ccp(origin.x + visibleSize.width - pCloseItem->getContentSize().width/2 ,
                                origin.y + pCloseItem->getContentSize().height/2));

    CCMenu* pMenu = CCMenu::create(pCloseItem, NULL);
    pMenu->setPosition(CCPointZero);
    this->addChild(pMenu, 1);

	/******************************ActionMove移动*********************************/
	//创建3怪兽,设置位置
	CCSprite *sp1 = CCSprite::create("cpp1.png");
	sp1->setScale(0.5f);
	sp1->setPosition(ccp(100, 100));
	this->addChild(sp1);

	CCSprite *sp2 = CCSprite::create("cpp2.png");
	sp2->setScale(0.5f);
	sp2->setPosition(ccp(visibleSize.width/2-100, visibleSize.height/2));
	this->addChild(sp2);

	CCSprite *sp3 = CCSprite::create("cpp3.png");
	sp3->setScale(0.5f);
	sp3->setPosition(ccp(visibleSize.width/2+100, visibleSize.height/2));
	this->addChild(sp3);

	//2s内移动屏幕中心(绝对位置)
	CCActionInterval *to = CCMoveTo::create(2.0f, ccp(visibleSize.width/2, visibleSize.height/2));
	sp2->runAction(to);

	//2s内移动后再回到原点
	CCActionInterval *by = CCMoveBy::create(2.0f, ccp(200, 200));//2s内相对它原来坐标,xy轴再移动200
	CCActionInterval *byback = by->reverse();//反向播放动画
	sp3->runAction(CCSequence::create(by, byback, NULL));//按序列运行动作,先相对移动,再反向回到原地

	sp1->runAction(CCMoveTo::create(1.0f, ccp(100, 100)));

	return true;
}

五、TestCpp实例ActionsTest 模块中ActionJump缩放动作

程序代码:

bool HelloWorld::init()
{
    if ( !CCLayer::init() )
    {
        return false;
    }

    CCSize visibleSize = CCDirector::sharedDirector()->getVisibleSize();
    CCPoint origin = CCDirector::sharedDirector()->getVisibleOrigin();
    CCMenuItemImage *pCloseItem = CCMenuItemImage::create(
                                        "CloseNormal.png",
                                        "CloseSelected.png",
                                        this,
                                        menu_selector(HelloWorld::menuCloseCallback));

	pCloseItem->setPosition(ccp(origin.x + visibleSize.width - pCloseItem->getContentSize().width/2 ,
                                origin.y + pCloseItem->getContentSize().height/2));

    CCMenu* pMenu = CCMenu::create(pCloseItem, NULL);
    pMenu->setPosition(CCPointZero);
    this->addChild(pMenu, 1);

	CCSprite *sp1 = CCSprite::create("cpp1.png");
	sp1->setScale(0.5f);
	sp1->setPosition(ccp(100, 100));
	this->addChild(sp1);

	CCSprite *sp2 = CCSprite::create("cpp2.png");
	sp2->setScale(0.5f);
	sp2->setPosition(ccp(visibleSize.width/2-100, visibleSize.height/2));
	this->addChild(sp2);

	CCSprite *sp3 = CCSprite::create("cpp3.png");
	sp3->setScale(0.5f);
	sp3->setPosition(ccp(visibleSize.width/2+100, visibleSize.height/2));
	this->addChild(sp3);

	/******************************ActionJump跳跃*********************************/

	//參数1:持续时间;參数2:跳跃到的位置;參数3:跳跃高度;參数4:跳跃次数
	CCActionInterval *to = CCJumpTo::create(2.0f, ccp(300, 0), 300, 2);
	sp1->runAction(to);

	//跳跃回到原点
	CCActionInterval *by = CCJumpBy::create(2.0f, ccp(300, 0), 100, 2);
	CCActionInterval *backby = by->reverse();
	sp2->runAction(CCSequence::create(by, backby, NULL));

	//原地无限循环跳跃
	CCActionInterval*  actionUp = CCJumpBy::create(2, ccp(0,0), 80, 4);
	sp3->runAction(CCRepeatForever::create(actionUp));

	return true;
}

六、TestCpp实例ActionsTest 模块中ActionTint色值渐变动作

程序代码:

bool HelloWorld::init()
{
    if ( !CCLayer::init() )
    {
        return false;
    }

    CCSize visibleSize = CCDirector::sharedDirector()->getVisibleSize();
    CCPoint origin = CCDirector::sharedDirector()->getVisibleOrigin();
    CCMenuItemImage *pCloseItem = CCMenuItemImage::create(
                                        "CloseNormal.png",
                                        "CloseSelected.png",
                                        this,
                                        menu_selector(HelloWorld::menuCloseCallback));

	pCloseItem->setPosition(ccp(origin.x + visibleSize.width - pCloseItem->getContentSize().width/2 ,
                                origin.y + pCloseItem->getContentSize().height/2));

    CCMenu* pMenu = CCMenu::create(pCloseItem, NULL);
    pMenu->setPosition(CCPointZero);
    this->addChild(pMenu, 1);

	CCSprite *sp1 = CCSprite::create("cpp1.png");
	sp1->setScale(0.5f);
	sp1->setPosition(ccp(100, 100));
	this->addChild(sp1);

	CCSprite *sp2 = CCSprite::create("cpp2.png");
	sp2->setScale(0.5f);
	sp2->setPosition(ccp(visibleSize.width/2-100, visibleSize.height/2));
	this->addChild(sp2);

	CCSprite *sp3 = CCSprite::create("cpp3.png");
	sp3->setScale(0.5f);
	sp3->setPosition(ccp(visibleSize.width/2+100, visibleSize.height/2));
	this->addChild(sp3);

	/******************************ActionTint色值渐变*********************************/
	CCActionInterval *ac = CCTintTo::create(4, 255,255, 0);//4s渐变黄色
	CCActionInterval *ac1 = CCTintBy::create(4, -255, 0, -255);//在眼下值上加上该色值,4s渐变绿

	sp3->runAction(ac);
	sp2->runAction(CCRepeatForever::create(CCSequence::create(ac1, ac1->reverse(), NULL)));

	return true;
}

七、TestCpp实例ActionsTest 模块中ActionBlink闪烁动作

程序代码:

bool HelloWorld::init()
{
    if ( !CCLayer::init() )
    {
        return false;
    }

    CCSize visibleSize = CCDirector::sharedDirector()->getVisibleSize();
    CCPoint origin = CCDirector::sharedDirector()->getVisibleOrigin();
    CCMenuItemImage *pCloseItem = CCMenuItemImage::create(
                                        "CloseNormal.png",
                                        "CloseSelected.png",
                                        this,
                                        menu_selector(HelloWorld::menuCloseCallback));

	pCloseItem->setPosition(ccp(origin.x + visibleSize.width - pCloseItem->getContentSize().width/2 ,
                                origin.y + pCloseItem->getContentSize().height/2));

    CCMenu* pMenu = CCMenu::create(pCloseItem, NULL);
    pMenu->setPosition(CCPointZero);
    this->addChild(pMenu, 1);

	CCSprite *sp1 = CCSprite::create("cpp1.png");
	sp1->setScale(0.5f);
	sp1->setPosition(ccp(100, 100));
	this->addChild(sp1);

	CCSprite *sp2 = CCSprite::create("cpp2.png");
	sp2->setScale(0.5f);
	sp2->setPosition(ccp(visibleSize.width/2-100, visibleSize.height/2));
	this->addChild(sp2);

	CCSprite *sp3 = CCSprite::create("cpp3.png");
	sp3->setScale(0.5f);
	sp3->setPosition(ccp(visibleSize.width/2+100, visibleSize.height/2));
	this->addChild(sp3);

	/******************************ActionBlink闪烁*********************************/
	CCActionInterval *ac = CCBlink::create(2, 4);//2s内闪烁4次
	CCActionInterval *ac1 = CCBlink::create(5, 4);//5s内闪烁4次
	sp2->runAction(ac);
	sp3->runAction(ac1);

	return true;
}

八、TestCpp实例ActionsTest 模块中ActionFade谈入谈出动作

程序代码:

bool HelloWorld::init()
{
    if ( !CCLayer::init() )
    {
        return false;
    }

    CCSize visibleSize = CCDirector::sharedDirector()->getVisibleSize();
    CCPoint origin = CCDirector::sharedDirector()->getVisibleOrigin();
    CCMenuItemImage *pCloseItem = CCMenuItemImage::create(
                                        "CloseNormal.png",
                                        "CloseSelected.png",
                                        this,
                                        menu_selector(HelloWorld::menuCloseCallback));

	pCloseItem->setPosition(ccp(origin.x + visibleSize.width - pCloseItem->getContentSize().width/2 ,
                                origin.y + pCloseItem->getContentSize().height/2));

    CCMenu* pMenu = CCMenu::create(pCloseItem, NULL);
    pMenu->setPosition(CCPointZero);
    this->addChild(pMenu, 1);

	CCSprite *sp1 = CCSprite::create("cpp1.png");
	sp1->setScale(0.5f);
	sp1->setPosition(ccp(100, 100));
	this->addChild(sp1);

	CCSprite *sp2 = CCSprite::create("cpp2.png");
	sp2->setScale(0.5f);
	sp2->setPosition(ccp(visibleSize.width/2-100, visibleSize.height/2));
	this->addChild(sp2);

	CCSprite *sp3 = CCSprite::create("cpp3.png");
	sp3->setScale(0.5f);
	sp3->setPosition(ccp(visibleSize.width/2+100, visibleSize.height/2));
	this->addChild(sp3);

	/******************************ActionFade谈入谈出*********************************/
	sp1->setOpacity(0);//设置透明
	CCActionInterval *in = CCFadeIn::create(2.0f);//谈入
	sp1->runAction(CCSequence::create(in, in->reverse(), NULL));

	CCActionInterval *out = CCFadeOut::create(2.0f);//谈出
	sp2->runAction(CCSequence::create(out, in->reverse(), NULL));

	sp3->setOpacity(100);

	return true;
}

九、TestCpp实例ActionsTest 模块中ActionBezier贝赛尔曲线动作

程序代码:

bool HelloWorld::init()
{
    if ( !CCLayer::init() )
    {
        return false;
    }

    CCSize visibleSize = CCDirector::sharedDirector()->getVisibleSize();
    CCPoint origin = CCDirector::sharedDirector()->getVisibleOrigin();
    CCMenuItemImage *pCloseItem = CCMenuItemImage::create(
                                        "CloseNormal.png",
                                        "CloseSelected.png",
                                        this,
                                        menu_selector(HelloWorld::menuCloseCallback));

	pCloseItem->setPosition(ccp(origin.x + visibleSize.width - pCloseItem->getContentSize().width/2 ,
                                origin.y + pCloseItem->getContentSize().height/2));

    CCMenu* pMenu = CCMenu::create(pCloseItem, NULL);
    pMenu->setPosition(CCPointZero);
    this->addChild(pMenu, 1);

	CCSprite *sp1 = CCSprite::create("cpp1.png");
	sp1->setScale(0.5f);
	sp1->setPosition(ccp(100, 100));
	this->addChild(sp1);

	CCSprite *sp2 = CCSprite::create("cpp2.png");
	sp2->setScale(0.5f);
	sp2->setPosition(ccp(visibleSize.width/2-100, visibleSize.height/2));
	this->addChild(sp2);

	CCSprite *sp3 = CCSprite::create("cpp3.png");
	sp3->setScale(0.5f);
	sp3->setPosition(ccp(visibleSize.width/2+100, visibleSize.height/2));
	this->addChild(sp3);

	/******************************ActionBezier贝赛尔曲线*********************************/
	//sprite 1
	ccBezierConfig bezi;//配置贝赛尔曲线动作
	bezi.controlPoint_1 = ccp(0, visibleSize.height/2);//控制点1位置
	bezi.controlPoint_2 = ccp(300, -visibleSize.height/2);//控制点2位置
	bezi.endPosition = ccp(300, 100);

	CCActionInterval * to = CCBezierBy::create(3, bezi);//參数1:持续时间;參数2:配置对象
	CCAction *ac = CCRepeatForever::create(CCSequence::create(to, to->reverse(), NULL));
	sp1->runAction(ac);

	//sprite 2
	ccBezierConfig bezi1;
	bezi1.controlPoint_1 = ccp(100, visibleSize.height/2);
	bezi1.controlPoint_2 = ccp(200, -visibleSize.height/2);
	bezi1.endPosition = ccp(500, 500);
	CCActionInterval *to1 = CCBezierTo::create(3, bezi1);
	sp2->runAction(to1);

	//sprite 3
	sp3->setPosition(ccp(400,160));
	CCActionInterval *to2 = CCBezierTo::create(3, bezi1);
	sp3->runAction(to2);

	return true;
}

十、TestCpp实例ActionsTest 模块中ActionJump跳跃动作

程序代码:

bool HelloWorld::init()
{
    if ( !CCLayer::init() )
    {
        return false;
    }

    CCSize visibleSize = CCDirector::sharedDirector()->getVisibleSize();
    CCPoint origin = CCDirector::sharedDirector()->getVisibleOrigin();
    CCMenuItemImage *pCloseItem = CCMenuItemImage::create(
                                        "CloseNormal.png",
                                        "CloseSelected.png",
                                        this,
                                        menu_selector(HelloWorld::menuCloseCallback));

	pCloseItem->setPosition(ccp(origin.x + visibleSize.width - pCloseItem->getContentSize().width/2 ,
                                origin.y + pCloseItem->getContentSize().height/2));

    CCMenu* pMenu = CCMenu::create(pCloseItem, NULL);
    pMenu->setPosition(CCPointZero);
    this->addChild(pMenu, 1);

	CCSprite *sp1 = CCSprite::create("cpp1.png");
	sp1->setScale(0.5f);
	sp1->setPosition(ccp(100, 100));
	this->addChild(sp1);

	CCSprite *sp2 = CCSprite::create("cpp2.png");
	sp2->setScale(0.5f);
	sp2->setPosition(ccp(visibleSize.width/2-100, visibleSize.height/2));
	this->addChild(sp2);

	CCSprite *sp3 = CCSprite::create("cpp3.png");
	sp3->setScale(0.5f);
	sp3->setPosition(ccp(visibleSize.width/2+100, visibleSize.height/2));
	this->addChild(sp3);

	/******************************ActionJump跳跃*********************************/

	//參数1:持续时间;參数2:跳跃到的位置;參数3:跳跃高度;參数4:跳跃次数
	CCActionInterval *to = CCJumpTo::create(2.0f, ccp(300, 0), 300, 2);
	sp1->runAction(to);

	//跳跃回到原点
	CCActionInterval *by = CCJumpBy::create(2.0f, ccp(300, 0), 100, 2);
	CCActionInterval *backby = by->reverse();
	sp2->runAction(CCSequence::create(by, backby, NULL));

	//原地无限循环跳跃
	CCActionInterval*  actionUp = CCJumpBy::create(2, ccp(0,0), 80, 4);
	sp3->runAction(CCRepeatForever::create(actionUp));

	return true;
}
时间: 2024-10-18 02:35:12

【Cocos2d TestCpp实例模仿一】-- ActionsTest的相关文章

【Cocos2d TestCpp实例模仿】-- ActionsTest

一.TestCpp实例ActionsTest 模块中ActionManual动作 素材原图: 动作效果图: 程序代码: bool HelloWorld::init() { if ( !CCLayer::init() ) { return false; } CCSize visibleSize = CCDirector::sharedDirector()->getVisibleSize(); CCPoint origin = CCDirector::sharedDirector()->getVi

Cocos2d之cocos2d::Value实例分享

于v3.0beta加入 定义在"COCOS2DX_ROOT/cocos/base"的头文件"CCValue.h"中.推荐教程Cocos2d-x从零开始视频教程 class Value; cocos2d::Value是许多基本类型(int,float,double,bool,unsigned char,char*和std::string)还有std::vector, std::unordered_map和 std::unordered_map这些类的包装类型. 你可以

基于Cocos2d-x-1.0.1的飞机大战游戏开发实例(上)

最近接触过几个版本的cocos2dx,决定每个大变动的版本都尝试一下.本实例模仿微信5.0版本中的飞机大战游戏,如图: 一.工具 1.素材:飞机大战的素材(图片.声音等)来自于网络 2.引擎:cocos2d-1.0.1-x-0.9.2 3.环境:vs2010 二.使用的类 1.游戏菜单界面类:PlaneWarMenu——派生自CCLayer类. 1 // 游戏菜单界面类 2 class PlaneWarMenu: public CCLayer 3 { 4 public: 5 virtual bo

python使用 minidom创建xml实例

python创建xml实例 模仿下面的xml文件,使用python脚本进行创建. <?xml version='1.0'?> <database> <user username="user" fromAddress="[email protected]" fullName="John Q. User" password="pass"> <subscription host="

MongoDB---前世今生

MongoDB的官方文档基本是how to do的介绍,而关于how it worked却少之又少,本人也刚买了<MongoDB TheDefinitive Guide>的影印版,还没来得及看,本文原作者将其书中一些关于MongoDB内部现实方面的一些知识介绍如下,值得一看. 今天下载了<MongoDB The Definitive Guide>电子版,浏览了里面的内容,还是挺丰富的.是官网文档实际应用方面的一个补充.和官方文档类似,介绍MongoDB的内部原理是少之又少,只有在附

iOS开发人员必看的精品资料(100个)

目录下载地址:http://down.51cto.com/data/416672 附件预览如下: iOS游戏开发之Unity3D引擎系列 http://down.51cto.com/zt/399 iPadian软件:让你在Windows下真实地体验iPad http://down.51cto.com/data/274307 <iPhone开发秘籍(第2版)>中文版电子书 http://down.51cto.com/data/259386 iPhone开发基础教程+源码 pdf http://d

Highcharts入门小示例

一.创建条形图 1.创建div容器 <div id="container" style="min-width:800px;height:400px"></div> 2.编写图表配置代码 相关示例: <html> <head>  <script type="text/javascript" src="http://cdn.hcharts.cn/jquery/jquery-1.8.3.m

多线程同步(Lock)

实例 模仿生产者和消费者的模式 先来个两个线程的 class ProducerConsumerDemo { public static void main(String[] args) { Res r=new Res(); Pro in=new Pro(r); Cou out=new Cou(r); Thread t1=new Thread(in); Thread t2=new Thread(out); t1.start(); t2.start(); } } class Res { privat

【热门收藏】iOS开发人员必看的精品资料(100个)——下载目录

iPhone.iPad产品风靡全球,巨大的用户群刺激着iOS软件开发需求,然而国内人才缺口很大,正处于供不应求的状态,ios开发前景大好.我们整理了51CTO下载中心100份热门的ios开发资料,做了一个地址收藏目录,方便大家选择性下载.里边均是好资料,相信对学习ios开发有所帮助.目录下载地址:http://down.51cto.com/data/416672 附件预览如下: iOS游戏开发之Unity3D引擎系列 http://down.51cto.com/zt/399 iPadian软件: