zoukankan      html  css  js  c++  java
  • 预加载+CCSpriteBatchNode + CCSpriteFrameCache

      /////////////////-------------------  2-22-13 14:20 ------------

    //添加plist
     CCSpriteFrameCache::sharedSpriteFrameCache()->addSpriteFramesWithFile("showroom.plist",
      CCTextureCache::sharedTextureCache()->addImage("showroom.png"));
     //去纹理
     CCTexture2D * tex = CCTextureCache::sharedTextureCache()->textureForKey("showroom.png");
     CCSpriteBatchNode *batchNode = CCSpriteBatchNode::createWithTexture(tex);
     addChild(batchNode);

    //////////////---------------------------我是 分割线 ---------------------------

    CCTexture2D *texture = CCTextureCache::sharedTextureCache()->addImage("showroom.png");
     
     CCSpriteBatchNode *batchNode = CCSpriteBatchNode::createWithTexture(texture);


     addChild(batchNode);


     CCSpriteFrameCache::sharedSpriteFrameCache()->addSpriteFramesWithFile("showroom.plist",texture);

    CCSprite * pSpBracket1 = CCSprite::createWithSpriteFrameName("bracket4.png");  

    pSpBracket1->setAnchorPoint(CCPointZero);  

    pSpBracket1->setPosition(ccp(100,768-728));  

    batchNode->addChild(pSpBracket1);  //注意这里就好了

     CCSprite * pSpBracket2 = CCSprite::createWithSpriteFrameName("bracket5.png");  

    //pSpBracket2->setAnchorPoint(CCPointZero);  

    pSpBracket2->setPosition(ccp(320,768-490));

     batchNode->addChild(pSpBracket2);    //注意这里就好了

  • 相关阅读:
    iOS 证书、真机调试、发布 App Store
    iOS 9 适配
    交叉编译tslib1.4
    nau8822 codec driver 录音时mic bias 无法自动打开问题
    nuc900 nand flash mtd 驱动
    在ubuntu14.04上安装oracle java6 java7的方法
    N3292x IBR介绍
    N3292系列资料之RTC介绍
    支持mdev的init脚本片断
    Nginx
  • 原文地址:https://www.cnblogs.com/jaoye/p/2921708.html
Copyright © 2011-2022 走看看