• <ins id="pjuwb"></ins>
    <blockquote id="pjuwb"><pre id="pjuwb"></pre></blockquote>
    <noscript id="pjuwb"></noscript>
          <sup id="pjuwb"><pre id="pjuwb"></pre></sup>
            <dd id="pjuwb"></dd>
            <abbr id="pjuwb"></abbr>

            專職C++

            不能停止的腳步

              C++博客 :: 首頁 :: 聯系 :: 聚合  :: 管理
              163 Posts :: 7 Stories :: 135 Comments :: 0 Trackbacks

            常用鏈接

            留言簿(28)

            我參與的團隊

            搜索

            •  

            最新評論

            閱讀排行榜

            評論排行榜

            (基于cocos2dx 2.2.2)
            如果很多圖片很小或常用,可以使用CCSpriteFrameCache,來避免資源被反復加載。 
            (注:對于plist,我這里使用的是一個免費的工具,SpritePacker,http://spritepacker.kernys.net)

            如:CCSpriteFrameCache::sharedSpriteFrameCache()->addSpriteFramesWithFile("basetank.plist");
            <?xml version="1.0" encoding="UTF-8"?>
            <!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
            <plist version="1.0">
            <dict>
                <key>frames</key>
                <dict>
                    <key>basetank_down.png</key>
                    <dict>
                        <key>frame</key>
                        <string>{{0,0},{26,26}}</string>
                        <key>offset</key>
                        <string>{0,0}</string>
                        <key>rotated</key>
                        <false/>
                        <key>sourceColorRect</key>
                        <string>{{3,3},{26,26}}</string>
                        <key>sourceSize</key>
                        <string>{32,32}</string>
                    </dict>
                    <key>basetank_left.png</key>
                    <dict>
                        <key>frame</key>
                        <string>{{0,27},{26,26}}</string>
                        <key>offset</key>
                        <string>{0,0}</string>
                        <key>rotated</key>
                        <false/>
                        <key>sourceColorRect</key>
                        <string>{{3,3},{26,26}}</string>
                        <key>sourceSize</key>
                        <string>{32,32}</string>
                    </dict>
                    <key>basetank_right.png</key>
                    <dict>
                        <key>frame</key>
                        <string>{{0,54},{26,26}}</string>
                        <key>offset</key>
                        <string>{0,0}</string>
                        <key>rotated</key>
                        <false/>
                        <key>sourceColorRect</key>
                        <string>{{3,3},{26,26}}</string>
                        <key>sourceSize</key>
                        <string>{32,32}</string>
                    </dict>
                    <key>basetank_up.png</key>
                    <dict>
                        <key>frame</key>
                        <string>{{0,81},{26,26}}</string>
                        <key>offset</key>
                        <string>{0,0}</string>
                        <key>rotated</key>
                        <false/>
                        <key>sourceColorRect</key>
                        <string>{{3,3},{26,26}}</string>
                        <key>sourceSize</key>
                        <string>{32,32}</string>
                    </dict>
                </dict>
                <key>metadata</key>
                <dict>
                    <key>format</key>
                    <integer>2</integer>
                    <key>realTextureFileName</key>
                    <string>basetank.png</string>
                    <key>size</key>
                    <string>{32,128}</string>
                    <key>smartupdate</key>
                    <string>{None}</string>
                    <key>textureFileName</key>
                    <string>basetank.png</string>
                </dict>
            </dict>
            </plist>
            這樣,就可以完成一組圖片資源加載。
                        CCSprite * p1Pic = CCSprite::createWithSpriteFrameName(“basetank_up.png”);
                        p1Pic->setPosition(GetPosition(pPlayerLayer, "Player1"));
                        p1Pic->setAnchorPoint(ccp(0, 0));
                        this->addChild(p1Pic);
            如需更換圖片,
            p1Pic
            ->setDisplayFrame(CCSpriteFrameCache::sharedSpriteFrameCache()->spriteFrameByName("basetank_right.png"));
            這里的作用相當于是把tank向右轉
            posted on 2014-03-24 00:08 冬瓜 閱讀(1964) 評論(0)  編輯 收藏 引用 所屬分類: 原創cocos2dx
            久久久久18| 国内精品久久久久久麻豆| 久久AV高潮AV无码AV| 99久久国产宗和精品1上映| 国产成人精品综合久久久| 亚洲精品tv久久久久久久久| 久久天天躁狠狠躁夜夜不卡| 亚洲中文字幕无码久久精品1 | 精品综合久久久久久888蜜芽| 精品乱码久久久久久久| 久久婷婷五月综合97色直播| 7777久久久国产精品消防器材| 久久综合九色综合97_久久久| 日本高清无卡码一区二区久久| 亚洲色大成网站www久久九 | 久久精品亚洲AV久久久无码| 亚洲精品乱码久久久久久中文字幕| 好久久免费视频高清| 一本久道久久综合狠狠躁AV| 国产韩国精品一区二区三区久久| 久久成人精品| 久久精品视频免费| 久久精品国产亚洲AV影院| 国产999精品久久久久久| 久久精品国产亚洲av麻豆小说| 久久久人妻精品无码一区| 久久99精品国产麻豆| 久久伊人五月丁香狠狠色| 久久精品亚洲男人的天堂| 日本三级久久网| 久久r热这里有精品视频| 无码人妻精品一区二区三区久久久 | 亚洲精品美女久久久久99小说| 国产精品一久久香蕉产线看| 亚洲国产欧洲综合997久久| 亚洲日本久久久午夜精品| 久久久久99精品成人片| 久久久精品国产Sm最大网站| 99久久伊人精品综合观看| 伊人久久免费视频| 国产精品久久久天天影视香蕉 |