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);
时间: 2024-10-11 11:59:01