首页 > 其他 > 详细

cocos2d tiled at

时间:2014-10-03 13:22:54      阅读:284      评论:0      收藏:0      [点我收藏+]
    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

原文:http://www.cnblogs.com/yufenghou/p/4004870.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!