首页 > 代码库 > 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
声明:以上内容来自用户投稿及互联网公开渠道收集整理发布,本网站不拥有所有权,未作人工编辑处理,也不承担相关法律责任,若内容有误或涉及侵权可进行投诉: 投诉/举报 工作人员会在5个工作日内联系你,一经查实,本站将立刻删除涉嫌侵权内容。