码迷,mamicode.com
首页 > 其他好文 > 详细

cocos2d tiled at

时间:2014-10-03 14:55:04      阅读:159      评论:0      收藏:0      [点我收藏+]

标签:style   blog   color   os   ar   for   sp   div   c   

    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

标签:style   blog   color   os   ar   for   sp   div   c   

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

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!