• 预加载+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);    //注意这里就好了

  • 相关阅读:
    静态(static)、虚拟(virtual)、动态(dynamic)或消息处理(message)
    SQLLITE
    SQLite数据表和视图
    SQLite
    DELPHI 泛型
    indy10 学习2
    indy10 线程池
    indy
    Indy10 控件的使用(2)TidTCpServer组件学习
    Socket心跳包机制
  • 原文地址:https://www.cnblogs.com/jaoye/p/2921708.html
Copyright © 2020-2023  润新知