首页 > 代码库 > cocos2d tiled at

cocos2d tiled at

    CCTMXTiledMap *map=CCTMXTiledMap::create("4.tmx");    addChild(map);    //CCSize s=map->getContentSize();    //fight juchi    CCArray* pChildrenArray=map->getChildren();    CCSpriteBatchNode* child=NULL;    CCObject* pObject=NULL;    CCARRAY_FOREACH(pChildrenArray,pObject)    {        child=(CCSpriteBatchNode*)pObject;        if(!child)        {            break;        }        child->getTexture()->setAntiAliasTexParameters();    }        CCTMXLayer*  layer=map->layerNamed("Layer 0");    CCSize s=layer->getLayerSize();    CCSprite* sprite;    sprite=layer->tileAt(ccp(0,0));    sprite->setScale(2);    sprite=layer->tileAt(ccp(s.width-1,0));    sprite->setScale(2);    sprite=layer->tileAt(ccp(0,s.height-1));    sprite->setScale(2);    sprite=layer->tileAt(ccp(s.width-1,s.height-1));    sprite->setScale(2);

 

cocos2d tiled at