锘??xml version="1.0" encoding="utf-8" standalone="yes"?>久久精品国产亚洲,亚洲国产天堂久久综合网站,亚洲另类激情综合偷自拍http://www.tkk7.com/demibug/zh-cnSun, 11 May 2025 06:02:02 GMTSun, 11 May 2025 06:02:02 GMT60PS 濡備綍鍘婚櫎鍏夋檿鐨勯粦鑹茶儗鏅?/title><link>http://www.tkk7.com/demibug/archive/2013/03/20/396721.html</link><dc:creator>Hiji</dc:creator><author>Hiji</author><pubDate>Wed, 20 Mar 2013 04:19:00 GMT</pubDate><guid>http://www.tkk7.com/demibug/archive/2013/03/20/396721.html</guid><wfw:comment>http://www.tkk7.com/demibug/comments/396721.html</wfw:comment><comments>http://www.tkk7.com/demibug/archive/2013/03/20/396721.html#Feedback</comments><slash:comments>1</slash:comments><wfw:commentRss>http://www.tkk7.com/demibug/comments/commentRss/396721.html</wfw:commentRss><trackback:ping>http://www.tkk7.com/demibug/services/trackbacks/396721.html</trackback:ping><description><![CDATA[<pre id="answer-content-675599077" accuse="aContent" mb-10"="" style="margin-top: 0px; margin-bottom: 10px; padding: 0px; font-family: arial, 'courier new', courier, 瀹嬩綋, monospace; white-space: pre-wrap; word-wrap: break-word; color: #333333; line-height: 24px; background-color: #ffffff;">鑳屾櫙鑹叉槸綰粦鐨勶紵<br />杞埌閫氶亾闈㈡澘錛屾寜浣廋trl+Shift閿紝渚濇鐐瑰嚮綰㈢豢钃濅笁涓氶亾錛屽緱鍒板厜鏅曠殑閫夊尯銆傞変腑鍥懼眰錛屾寜涓婥trl+J閿紝寰楀埌鍏夋檿鍥懼眰銆傞殣钘忚儗鏅浘灞傘傛鏃剁殑鍏夋檿鍖呭惈鏈夊皯閲忛忔槑鐨勯粦搴曪紝鍥犱負鑳屾櫙鏄粦鑹詫紝褰撴妸閫忔槑鐨勫厜鏅曞浘灞傛斁鍒板埆鐨勫浘灞備笂鏃訛紝灝嗘販鍚堟ā寮忔敼涓?#8220;婊よ壊”鍗沖彲杈懼埌灞忚斀榛戣壊鑳屾櫙鐨勭洰鐨勩?br />鎴栬呯敤鑳屾櫙姍$毊鎿︼紝浣嗘槸鏁堟灉涓嶆槸寰堝ソ銆?/pre><img src ="http://www.tkk7.com/demibug/aggbug/396721.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.tkk7.com/demibug/" target="_blank">Hiji</a> 2013-03-20 12:19 <a href="http://www.tkk7.com/demibug/archive/2013/03/20/396721.html#Feedback" target="_blank" style="text-decoration:none;">鍙戣〃璇勮</a></div>]]></description></item><item><title>cocos2d-x 2.0鐗堟湰 鑷傚簲灞忓箷鍒嗚鯨鐜?/title><link>http://www.tkk7.com/demibug/archive/2013/03/13/396355.html</link><dc:creator>Hiji</dc:creator><author>Hiji</author><pubDate>Tue, 12 Mar 2013 17:25:00 GMT</pubDate><guid>http://www.tkk7.com/demibug/archive/2013/03/13/396355.html</guid><wfw:comment>http://www.tkk7.com/demibug/comments/396355.html</wfw:comment><comments>http://www.tkk7.com/demibug/archive/2013/03/13/396355.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.tkk7.com/demibug/comments/commentRss/396355.html</wfw:commentRss><trackback:ping>http://www.tkk7.com/demibug/services/trackbacks/396355.html</trackback:ping><description><![CDATA[<p style="color: #333333; background-color: #ffffff; margin-top: 0px; margin-bottom: 0px; padding: 5px 10px; line-height: 1.8; text-indent: 28px; font-family: Tahoma, Geneva, sans-serif;">鎴戜嬌鐢ㄧ殑鐗堟湰鏄痗ocos2d-2.0-x-2.0.4錛宑ocos2dx-2.0鐗堟湰瀵瑰鍒嗚鯨鐜囬傞厤鎻愪緵浜嗗緢濂界殑鏀寔錛屼嬌鐢ㄨ搗鏉ユ瘮1.0鐗堟湰瑕佺畝鍗曚簺錛?.0鐗堟湰鐨勯傞厤鍙互鍙傝?a target="_blank" style="color: #950000; text-decoration: initial;">榪欑瘒鍗氭枃</a>銆?br />1. 鍋?.0鐗堟湰鐨勯傞厤棣栧厛闇瑕佷簡瑙d笅闈㈣繖浜涚煡璇嗐?br /><span style="color: #993300;"><strong>(1)閫傞厤絳栫暐</strong></span><br />2.0鐗堟湰鎻愪緵浜嗕笁縐嶉傞厤絳栫暐錛?br /><span style="color: #993300;">kResolutionNoBorder錛?/span>瓚呭嚭灞忓箷鐨勯儴鍒嗕細琚鍓紝涓や晶娌℃湁榛戣竟錛岄摵婊″睆騫曪紝鎸夊浘鐗囧師濮嬫瘮渚嬫樉紺猴紝鍥劇墖涓嶅彉褰€?br /><span style="color: #993300;">kResolutionShowAll錛?/span>鏁翠釜娓告垙鐣岄潰鏄彲瑙佺殑錛屼細鎸夊師濮嬫瘮渚嬭繘琛岀緝鏀撅紝鍥劇墖涓嶅彉褰紝浣嗕袱渚у彲鑳戒細鐣欐湁榛戣竟錛屼笉閾烘弧灞忓箷銆?br /><span style="color: #993300;">kResolutionExactFit錛?/span>鏁翠釜娓告垙鐣岄潰鏄彲瑙佺殑錛屽浘鐗囧彲鑳戒細榪涜鎷変幾鎴栬呭帇緙╁鐞嗭紝閾烘弧灞忓箷錛屽浘鐗囦細鍙樺艦銆?br />鍙互鏍規嵁鑷繁鐨勮姹傞夋嫨銆?br /><strong><span style="color: #993300;">(2)VisibleSize鍜孷isibleOrigin</span></strong><br />getVisibleSize錛氳〃紺鴻幏寰楄鍙?鍙鍖哄煙)鐨勫ぇ灝忥紝濡傛灉DesignResolutionSize璺熷睆騫曞昂瀵鎬竴鏍峰ぇ錛屽垯getVisibleSize絳変簬getWinSize銆?br />getVisibleOrigin錛氳〃紺哄彲瑙嗗尯鍩熺殑璧風偣鍧愭爣錛岃繖鍦ㄥ鐞嗙浉瀵逛綅緗殑鏃跺欓潪甯告湁鐢紝紜繚鑺傜偣鍦ㄤ笉鍚屽垎杈ㄧ巼涓嬬殑浣嶇疆涓鑷淬?br /><strong><span style="color: #993300;">(3)DesignResolutionSize</span></strong><br />DesignResolutionSize鏄竴涓瘮杈冮噸瑕佺殑姒傚康錛屽叾瀹?.0鐗堟湰鐨勯傞厤璺?.0鐗堟湰鍘熺悊宸笉澶氾紝閮芥槸鎸夋瘮渚嬭繘琛岀緝鏀俱傝繖涓狣esignResolutionSize琛ㄧず璁捐鏂規錛屽氨鏄綘鐨勬父鎴忓畬緹庢敮鎸佺殑鍒嗚鯨鐜囨柟妗堬紝涓鑸牴鎹浘鐗囪祫婧愮殑灝哄鏉ュ畾錛岃嚜閫傞厤鏃朵細鎸夌収榪欎釜鍒嗚鯨鐜囪綆楀嚭緙╂斁鍥犲瓙銆傚洜姝わ紝榪欎釜鍊間篃搴旇鏄姩鎬佺殑錛屽鏋滄槸妯睆娓告垙鍒欓珮搴﹁偗瀹氭槸閾烘弧灞忓箷鐨勶紝瀹藉害涔熻灝藉彲鑳界殑閾烘弧灞忓箷錛屽洜姝ゅ簲璇ラ夋嫨瀹介珮姣旀渶澶х殑浣滀負璁捐鍒嗚鯨鐜囷紝涓嬮潰鐨刣emo浼氱粰鍑轟嬌鐢ㄦ柟娉曘?br /><strong><span style="color: #993300;">(4)璁劇疆鐩稿浣嶇疆</span></strong><br />鍦ㄦ父鎴忎腑浣跨敤鐩稿浣嶇疆璁劇疆鍧愭爣鐨勫ソ澶勬槸鏄捐屾槗瑙佺殑錛岃繖鏍峰氨涓嶉渶瑕佷負姣忎釜鍒嗚鯨鐜囬兘瀹氫箟涓濂楀潗鏍囦簡銆傞鍏堝緱瀹氫箟涓浜涘弬鑰冪偣錛屽紩鎿庣殑TestCpp渚嬪瓙涓氨鎻愪緵浜嗕竴縐嶆柟娉曪紝浠ュ睆騫曚笂鍙鍖哄煙鐨?涓偣浣滀負鍙傝冪偣錛岀浉褰撲簬鍦ㄨ鐭╁艦鍐呭啓涓涓背瀛楋紝榪?涓偣鍒嗗埆鏄細宸︿笂銆佸乏銆佸乏涓嬨佷笅銆佸彸涓嬨佸彸銆佸彸涓娿佷笂銆佷腑蹇冦?/p><p style="color: #333333; background-color: #ffffff; margin-top: 0px; margin-bottom: 0px; padding: 5px 10px; line-height: 1.8; text-indent: 28px; font-family: Tahoma, Geneva, sans-serif;">2. 涓嬮潰鏉ュ疄鐜頒竴涓畝鍗曠殑demo錛岄鍏堝垱寤轟竴涓獁in32宸ョ▼錛岃繖涓氨涓嶈榪頒簡銆?br />(1)鍒涘緩涓涓狝ppMacros.h鏂囦歡錛屽畾涔変簡涓浜涘畯錛屾簮鐮佸涓嬶細</p><p style="color: #333333; background-color: #ffffff; margin-top: 0px; margin-bottom: 0px; padding: 5px 10px; line-height: 1.8; text-indent: 28px; font-family: Tahoma, Geneva, sans-serif;"></p><div bg_cpp"="" style="width: 687.046875px; color: #333333; line-height: 26px;"><div><div><strong>[cpp]</strong> <a title="view plain" style="background-image: url(http://static.blog.csdn.net/scripts/SyntaxHighlighter/styles/images/default/ico_plain.gif); padding: 1px; display: inline-block; width: 16px; height: 16px; text-indent: -2000px; background-position: 0% 0%; background-repeat: no-repeat no-repeat;">view plain</a><a title="copy" style="background-image: url(http://static.blog.csdn.net/scripts/SyntaxHighlighter/styles/images/default/ico_copy.gif); padding: 1px; display: inline-block; width: 16px; height: 16px; text-indent: -2000px; background-position: 0% 0%; background-repeat: no-repeat no-repeat;">copy</a><div style="position: absolute; left: 558px; top: 1113px; width: 18px; height: 18px; z-index: 99;"></div><div style="position: absolute; left: 558px; top: 1113px; width: 18px; height: 18px; z-index: 99;"><embed id="ZeroClipboardMovie_1" src="http://static.blog.csdn.net/scripts/ZeroClipboard/ZeroClipboard.swf" loop="false" menu="false" quality="best" bgcolor="#ffffff" width="18" height="18" name="ZeroClipboardMovie_1" align="center" allowscriptaccess="always" allowfullscreen="false" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer" flashvars="id=1&width=18&height=18" wmode="transparent"></div></div></div><ol start="1"><li style="line-height: 18px;">#ifndef __APPMACROS_H__  </li><li style="line-height: 18px;">#define __APPMACROS_H__  </li><li style="line-height: 18px;">   </li><li style="line-height: 18px;">#include "cocos2d.h"  </li><li style="line-height: 18px;">   </li><li style="line-height: 18px;">typedef struct tagResource  </li><li style="line-height: 18px;">{  </li><li style="line-height: 18px;">    cocos2d::CCSize size;  </li><li style="line-height: 18px;">    <span style="color: #2e8b57; font-weight: bold;">char</span> directory[100];  </li><li style="line-height: 18px;">}Resource;  </li><li style="line-height: 18px;">   </li><li style="line-height: 18px;">//鍙敤鐨勮祫婧愬昂瀵?nbsp; </li><li style="line-height: 18px;">static Resource smallResource  =  { cocos2d::CCSizeMake(480, 320),   "iphone" };  </li><li style="line-height: 18px;">static Resource mediumResource =  { cocos2d::CCSizeMake(1024, 768),  "ipad"   };  </li><li style="line-height: 18px;">static Resource largeResource  =  { cocos2d::CCSizeMake(2048, 1536), "ipadhd" };  </li><li style="line-height: 18px;">   </li><li style="line-height: 18px;">//璁捐鏂規  </li><li style="line-height: 18px;">static cocos2d::CCSize smallDesignResolutionSize = cocos2d::CCSizeMake(480.0f, 320.0f);  </li><li style="line-height: 18px;">static cocos2d::CCSize mediumDesignResolutionSize = cocos2d::CCSizeMake(1024.0f, 768.0f);  </li><li style="line-height: 18px;">static cocos2d::CCSize largeDesignResolutionSize = cocos2d::CCSizeMake(2048.0f, 1536.0f);  </li><li style="line-height: 18px;">   </li><li style="line-height: 18px;">//緙╂斁鍥犲瓙錛屼富瑕佺粰鏂囧瓧鏍囩浣跨敤  </li><li style="line-height: 18px;">#define SCALE_FACTOR  (cocos2d::CCEGLView::sharedOpenGLView()->getDesignResolutionSize().width / smallResource.size.width)  </li><li style="line-height: 18px;">   </li><li style="line-height: 18px;">#endif  </li></ol></div><span style="color: #333333; background-color: #ffffff; font-family: Tahoma, Geneva, sans-serif; line-height: 25px; text-indent: 28px;">(2)鎺ヤ笅鏉ヤ慨鏀笰ppDelegate.cpp鏂囦歡鐨刟pplicationDidFinishLaunching鍑芥暟錛屾坊鍔犱互涓嬩唬鐮侊細</span><p style="color: #333333; font-family: Arial; line-height: 26px; background-color: #ffffff;"></p><p style="color: #333333; background-color: #ffffff; margin-top: 0px; margin-bottom: 0px; padding: 5px 10px; line-height: 1.8; text-indent: 28px; font-family: Tahoma, Geneva, sans-serif;"></p><div bg_cpp"="" style="width: 687.046875px; color: #333333; line-height: 26px;"><div><div><strong>[cpp]</strong> <a title="view plain" style="background-image: url(http://static.blog.csdn.net/scripts/SyntaxHighlighter/styles/images/default/ico_plain.gif); padding: 1px; display: inline-block; width: 16px; height: 16px; text-indent: -2000px; background-position: 0% 0%; background-repeat: no-repeat no-repeat;">view plain</a><a title="copy" style="background-image: url(http://static.blog.csdn.net/scripts/SyntaxHighlighter/styles/images/default/ico_copy.gif); padding: 1px; display: inline-block; width: 16px; height: 16px; text-indent: -2000px; background-position: 0% 0%; background-repeat: no-repeat no-repeat;">copy</a><div style="position: absolute; left: 558px; top: 1715px; width: 18px; height: 18px; z-index: 99;"></div><div style="position: absolute; left: 558px; top: 1715px; width: 18px; height: 18px; z-index: 99;"><embed id="ZeroClipboardMovie_2" src="http://static.blog.csdn.net/scripts/ZeroClipboard/ZeroClipboard.swf" loop="false" menu="false" quality="best" bgcolor="#ffffff" width="18" height="18" name="ZeroClipboardMovie_2" align="center" allowscriptaccess="always" allowfullscreen="false" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer" flashvars="id=2&width=18&height=18" wmode="transparent"></div></div></div><ol start="1"><li style="line-height: 18px;"><span style="color: #2e8b57; font-weight: bold;">bool</span> AppDelegate::applicationDidFinishLaunching()  </li><li style="line-height: 18px;">{  </li><li style="line-height: 18px;">    // initialize director  </li><li style="line-height: 18px;">    CCDirector *pDirector = CCDirector::sharedDirector();  </li><li style="line-height: 18px;">    CCEGLView *pEGLView = CCEGLView::sharedOpenGLView();  </li><li style="line-height: 18px;">    pDirector->setOpenGLView(pEGLView);  </li><li style="line-height: 18px;">   </li><li style="line-height: 18px;">    CCSize frameSize = pEGLView->getFrameSize();  </li><li style="line-height: 18px;">    <span style="color: #2e8b57; font-weight: bold;">float</span> ratio = frameSize.width / frameSize.height;  </li><li style="line-height: 18px;">    <span style="color: #2e8b57; font-weight: bold;">float</span> ratio1 = largeDesignResolutionSize.width / largeDesignResolutionSize.height;  </li><li style="line-height: 18px;">    <span style="color: #2e8b57; font-weight: bold;">float</span> ratio2 = mediumDesignResolutionSize.width / mediumDesignResolutionSize.height;  </li><li style="line-height: 18px;">    <span style="color: #2e8b57; font-weight: bold;">float</span> ratio3 = smallDesignResolutionSize.width / smallDesignResolutionSize.height;  </li><li style="line-height: 18px;">    <span style="color: #2e8b57; font-weight: bold;">float</span> d1 = abs(ratio - ratio1);  </li><li style="line-height: 18px;">    <span style="color: #2e8b57; font-weight: bold;">float</span> d2 = abs(ratio - ratio2);  </li><li style="line-height: 18px;">    <span style="color: #2e8b57; font-weight: bold;">float</span> d3 = abs(ratio - ratio3);  </li><li style="line-height: 18px;">    std::map<<span style="color: #2e8b57; font-weight: bold;">float</span>, CCSize> designSize;  </li><li style="line-height: 18px;">    designSize[d1] = largeDesignResolutionSize;  </li><li style="line-height: 18px;">    designSize[d2] = mediumDesignResolutionSize;  </li><li style="line-height: 18px;">    designSize[d3] = smallDesignResolutionSize;  </li><li style="line-height: 18px;">    std::map<<span style="color: #2e8b57; font-weight: bold;">float</span>, CCSize>::reverse_iterator iter = designSize.rbegin();  </li><li style="line-height: 18px;">    //寰楀埌key鏈澶х殑錛屽洜姝ゆ垜榪欓噷鏄í灞忥紝鎵浠ヤ互楂樺害涓哄熀鍑嗭紝涓轟簡紜繚緙╂斁鍚庡搴﹁兘鍏ㄥ睆錛屾墍浠ラ夊彇瀹介珮姣旀渶澶х殑涓鴻璁℃柟妗?nbsp; </li><li style="line-height: 18px;">    CCSize designResolutionSize = iter->second;  </li><li style="line-height: 18px;">   </li><li style="line-height: 18px;">    //pEGLView->setDesignResolutionSize(designResolutionSize.width, designResolutionSize.height, kResolutionNoBorder);  </li><li style="line-height: 18px;">    pEGLView->setDesignResolutionSize(designResolutionSize.width, designResolutionSize.height, kResolutionShowAll);  </li><li style="line-height: 18px;">    //pEGLView->setDesignResolutionSize(designResolutionSize.width, designResolutionSize.height, kResolutionExactFit);  </li><li style="line-height: 18px;">   </li><li style="line-height: 18px;">    if (frameSize.height > mediumResource.size.height)  </li><li style="line-height: 18px;">    {   </li><li style="line-height: 18px;">        CCFileUtils::sharedFileUtils()->setResourceDirectory(largeResource.directory);  </li><li style="line-height: 18px;">        pDirector->setContentScaleFactor(largeResource.size.height/designResolutionSize.height);  </li><li style="line-height: 18px;">    }  </li><li style="line-height: 18px;">    else if (frameSize.height > smallResource.size.height)  </li><li style="line-height: 18px;">    {   </li><li style="line-height: 18px;">        CCFileUtils::sharedFileUtils()->setResourceDirectory(mediumResource.directory);  </li><li style="line-height: 18px;">        pDirector->setContentScaleFactor(mediumResource.size.height/designResolutionSize.height);  </li><li style="line-height: 18px;">    }  </li><li style="line-height: 18px;">    else  </li><li style="line-height: 18px;">    {   </li><li style="line-height: 18px;">        CCFileUtils::sharedFileUtils()->setResourceDirectory(smallResource.directory);  </li><li style="line-height: 18px;">        pDirector->setContentScaleFactor(smallResource.size.height/designResolutionSize.height);  </li><li style="line-height: 18px;">    }  </li><li style="line-height: 18px;">   </li><li style="line-height: 18px;">    pDirector->setDisplayStats(true);  </li><li style="line-height: 18px;">   </li><li style="line-height: 18px;">    pDirector->setAnimationInterval(1.0 / 60);  </li><li style="line-height: 18px;">   </li><li style="line-height: 18px;">    CCScene *pScene = HelloWorld::scene();  </li><li style="line-height: 18px;">   </li><li style="line-height: 18px;">    pDirector->runWithScene(pScene);  </li><li style="line-height: 18px;">   </li><li style="line-height: 18px;">    return true;  </li><li style="line-height: 18px;">}  </li></ol></div><br style="color: #333333; font-family: Arial; line-height: 26px; background-color: #ffffff;" /><span style="color: #333333; background-color: #ffffff; font-family: Tahoma, Geneva, sans-serif; line-height: 25px; text-indent: 28px;">(3)鍒涘緩VisibleRect.h鍜孷isibleRect.cpp鏂囦歡錛屽皝瑁呬簡鑾峰彇閭?涓偣鍧愭爣鐨勫嚱鏁幫紝姣旇緝綆鍗曘備唬鐮佸涓嬶細</span><br style="color: #333333; background-color: #ffffff; font-family: Tahoma, Geneva, sans-serif; line-height: 25px; text-indent: 28px;" /><span style="color: #333333; background-color: #ffffff; font-family: Tahoma, Geneva, sans-serif; line-height: 25px; text-indent: 28px;">VisibleRect.h</span><p style="color: #333333; font-family: Arial; line-height: 26px; background-color: #ffffff;"></p><p style="color: #333333; background-color: #ffffff; margin-top: 0px; margin-bottom: 0px; padding: 5px 10px; line-height: 1.8; text-indent: 28px; font-family: Tahoma, Geneva, sans-serif;"></p><div bg_cpp"="" style="width: 687.046875px; color: #333333; line-height: 26px;"><div><div><strong>[cpp]</strong> <a title="view plain" style="background-image: url(http://static.blog.csdn.net/scripts/SyntaxHighlighter/styles/images/default/ico_plain.gif); padding: 1px; display: inline-block; width: 16px; height: 16px; text-indent: -2000px; background-position: 0% 0%; background-repeat: no-repeat no-repeat;">view plain</a><a title="copy" style="background-image: url(http://static.blog.csdn.net/scripts/SyntaxHighlighter/styles/images/default/ico_copy.gif); padding: 1px; display: inline-block; width: 16px; height: 16px; text-indent: -2000px; background-position: 0% 0%; background-repeat: no-repeat no-repeat;">copy</a><div style="position: absolute; left: 558px; top: 2980px; width: 18px; height: 18px; z-index: 99;"></div><div style="position: absolute; left: 558px; top: 2980px; width: 18px; height: 18px; z-index: 99;"><embed id="ZeroClipboardMovie_3" src="http://static.blog.csdn.net/scripts/ZeroClipboard/ZeroClipboard.swf" loop="false" menu="false" quality="best" bgcolor="#ffffff" width="18" height="18" name="ZeroClipboardMovie_3" align="center" allowscriptaccess="always" allowfullscreen="false" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer" flashvars="id=3&width=18&height=18" wmode="transparent"></div></div></div><ol start="1"><li style="line-height: 18px;">#ifndef __VISIBLERECT_H__  </li><li style="line-height: 18px;">#define __VISIBLERECT_H__  </li><li style="line-height: 18px;">   </li><li style="line-height: 18px;">#include "cocos2d.h"  </li><li style="line-height: 18px;">USING_NS_CC;  </li><li style="line-height: 18px;">   </li><li style="line-height: 18px;">class VisibleRect  </li><li style="line-height: 18px;">{  </li><li style="line-height: 18px;">public:  </li><li style="line-height: 18px;">    static CCRect getVisibleRect();  </li><li style="line-height: 18px;">   </li><li style="line-height: 18px;">    static CCPoint left();  </li><li style="line-height: 18px;">    static CCPoint right();  </li><li style="line-height: 18px;">    static CCPoint top();  </li><li style="line-height: 18px;">    static CCPoint bottom();  </li><li style="line-height: 18px;">    static CCPoint center();  </li><li style="line-height: 18px;">    static CCPoint leftTop();  </li><li style="line-height: 18px;">    static CCPoint rightTop();  </li><li style="line-height: 18px;">    static CCPoint leftBottom();  </li><li style="line-height: 18px;">    static CCPoint rightBottom();  </li><li style="line-height: 18px;">private:  </li><li style="line-height: 18px;">    static void lazyInit();  </li><li style="line-height: 18px;">    static CCRect s_visibleRect;  </li><li style="line-height: 18px;">};  </li><li style="line-height: 18px;">   </li><li style="line-height: 18px;">#endif  </li></ol></div><p style="color: #333333; font-family: Arial; line-height: 26px; background-color: #ffffff;"><span style="font-family: Tahoma, Geneva, sans-serif; line-height: 25px; text-indent: 28px;">VisibleRect.cpp</span></p><p style="color: #333333; font-family: Arial; line-height: 26px; background-color: #ffffff;"></p><div bg_cpp"="" style="width: 687.046875px; color: #333333; line-height: 26px;"><div><div><strong>[cpp]</strong> <a title="view plain" style="background-image: url(http://static.blog.csdn.net/scripts/SyntaxHighlighter/styles/images/default/ico_plain.gif); padding: 1px; display: inline-block; width: 16px; height: 16px; text-indent: -2000px; background-position: 0% 0%; background-repeat: no-repeat no-repeat;">view plain</a><a title="copy" style="background-image: url(http://static.blog.csdn.net/scripts/SyntaxHighlighter/styles/images/default/ico_copy.gif); padding: 1px; display: inline-block; width: 16px; height: 16px; text-indent: -2000px; background-position: 0% 0%; background-repeat: no-repeat no-repeat;">copy</a><div style="position: absolute; left: 558px; top: 3542px; width: 18px; height: 18px; z-index: 99;"></div><div style="position: absolute; left: 558px; top: 3542px; width: 18px; height: 18px; z-index: 99;"><embed id="ZeroClipboardMovie_4" src="http://static.blog.csdn.net/scripts/ZeroClipboard/ZeroClipboard.swf" loop="false" menu="false" quality="best" bgcolor="#ffffff" width="18" height="18" name="ZeroClipboardMovie_4" align="center" allowscriptaccess="always" allowfullscreen="false" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer" flashvars="id=4&width=18&height=18" wmode="transparent"></div></div></div><ol start="1"><li style="line-height: 18px;">#include "VisibleRect.h"  </li><li style="line-height: 18px;">   </li><li style="line-height: 18px;">CCRect VisibleRect::s_visibleRect;  </li><li style="line-height: 18px;">   </li><li style="line-height: 18px;">void VisibleRect::lazyInit()  </li><li style="line-height: 18px;">{  </li><li style="line-height: 18px;">    if (s_visibleRect.size.width == 0.0f && s_visibleRect.size.height == 0.0f)  </li><li style="line-height: 18px;">    {  </li><li style="line-height: 18px;">        CCEGLView* pEGLView = CCEGLView::sharedOpenGLView();  </li><li style="line-height: 18px;">        s_visibleRect.origin = pEGLView->getVisibleOrigin();  </li><li style="line-height: 18px;">        s_visibleRect.size = pEGLView->getVisibleSize();  </li><li style="line-height: 18px;">    }  </li><li style="line-height: 18px;">}  </li><li style="line-height: 18px;">   </li><li style="line-height: 18px;">CCRect VisibleRect::getVisibleRect()  </li><li style="line-height: 18px;">{  </li><li style="line-height: 18px;">    lazyInit();  </li><li style="line-height: 18px;">    return CCRectMake(s_visibleRect.origin.x, s_visibleRect.origin.y, s_visibleRect.size.width, s_visibleRect.size.height);  </li><li style="line-height: 18px;">}  </li><li style="line-height: 18px;">   </li><li style="line-height: 18px;">CCPoint VisibleRect::left()  </li><li style="line-height: 18px;">{  </li><li style="line-height: 18px;">    lazyInit();  </li><li style="line-height: 18px;">    return ccp(s_visibleRect.origin.x, s_visibleRect.origin.y + s_visibleRect.size.height/2);  </li><li style="line-height: 18px;">}  </li><li style="line-height: 18px;">   </li><li style="line-height: 18px;">CCPoint VisibleRect::right()  </li><li style="line-height: 18px;">{  </li><li style="line-height: 18px;">    lazyInit();  </li><li style="line-height: 18px;">    return ccp(s_visibleRect.origin.x+s_visibleRect.size.width, s_visibleRect.origin.y + s_visibleRect.size.height/2);  </li><li style="line-height: 18px;">}  </li><li style="line-height: 18px;">   </li><li style="line-height: 18px;">CCPoint VisibleRect::top()  </li><li style="line-height: 18px;">{  </li><li style="line-height: 18px;">    lazyInit();  </li><li style="line-height: 18px;">    return ccp(s_visibleRect.origin.x + s_visibleRect.size.width/2, s_visibleRect.origin.y + s_visibleRect.size.height);  </li><li style="line-height: 18px;">}  </li><li style="line-height: 18px;">   </li><li style="line-height: 18px;">CCPoint VisibleRect::bottom()  </li><li style="line-height: 18px;">{  </li><li style="line-height: 18px;">    lazyInit();  </li><li style="line-height: 18px;">    return ccp(s_visibleRect.origin.x + s_visibleRect.size.width/2, s_visibleRect.origin.y);  </li><li style="line-height: 18px;">}  </li><li style="line-height: 18px;">   </li><li style="line-height: 18px;">CCPoint VisibleRect::center()  </li><li style="line-height: 18px;">{  </li><li style="line-height: 18px;">    lazyInit();  </li><li style="line-height: 18px;">    return ccp(s_visibleRect.origin.x + s_visibleRect.size.width/2, s_visibleRect.origin.y + s_visibleRect.size.height/2);  </li><li style="line-height: 18px;">}  </li><li style="line-height: 18px;">   </li><li style="line-height: 18px;">CCPoint VisibleRect::leftTop()  </li><li style="line-height: 18px;">{  </li><li style="line-height: 18px;">    lazyInit();  </li><li style="line-height: 18px;">    return ccp(s_visibleRect.origin.x, s_visibleRect.origin.y + s_visibleRect.size.height);  </li><li style="line-height: 18px;">}  </li><li style="line-height: 18px;">   </li><li style="line-height: 18px;">CCPoint VisibleRect::rightTop()  </li><li style="line-height: 18px;">{  </li><li style="line-height: 18px;">    lazyInit();  </li><li style="line-height: 18px;">    return ccp(s_visibleRect.origin.x + s_visibleRect.size.width, s_visibleRect.origin.y + s_visibleRect.size.height);  </li><li style="line-height: 18px;">}  </li><li style="line-height: 18px;">   </li><li style="line-height: 18px;">CCPoint VisibleRect::leftBottom()  </li><li style="line-height: 18px;">{  </li><li style="line-height: 18px;">    lazyInit();  </li><li style="line-height: 18px;">    return s_visibleRect.origin;  </li><li style="line-height: 18px;">}  </li><li style="line-height: 18px;">   </li><li style="line-height: 18px;">CCPoint VisibleRect::rightBottom()  </li><li style="line-height: 18px;">{  </li><li style="line-height: 18px;">    lazyInit();  </li><li style="line-height: 18px;">    return ccp(s_visibleRect.origin.x + s_visibleRect.size.width, s_visibleRect.origin.y);  </li><li style="line-height: 18px;">}  </li></ol></div><span style="color: #333333; background-color: #ffffff; font-family: Tahoma, Geneva, sans-serif; line-height: 25px; text-indent: 28px;">(4)淇敼HelloWorldScene.cpp鐨刬nit鍑芥暟錛屼嬌鐢ㄧ浉瀵逛綅緗緗潗鏍囥?/span><p style="color: #333333; font-family: Arial; line-height: 26px; background-color: #ffffff;"></p><p style="color: #333333; font-family: Arial; line-height: 26px; background-color: #ffffff;"></p><div bg_cpp"="" style="width: 687.046875px; color: #333333; line-height: 26px;"><div><div><strong>[cpp]</strong> <a title="view plain" style="background-image: url(http://static.blog.csdn.net/scripts/SyntaxHighlighter/styles/images/default/ico_plain.gif); padding: 1px; display: inline-block; width: 16px; height: 16px; text-indent: -2000px; background-position: 0% 0%; background-repeat: no-repeat no-repeat;">view plain</a><a title="copy" style="background-image: url(http://static.blog.csdn.net/scripts/SyntaxHighlighter/styles/images/default/ico_copy.gif); padding: 1px; display: inline-block; width: 16px; height: 16px; text-indent: -2000px; background-position: 0% 0%; background-repeat: no-repeat no-repeat;">copy</a><div style="position: absolute; left: 558px; top: 4966px; width: 18px; height: 18px; z-index: 99;"></div><div style="position: absolute; left: 558px; top: 4966px; width: 18px; height: 18px; z-index: 99;"><embed id="ZeroClipboardMovie_5" src="http://static.blog.csdn.net/scripts/ZeroClipboard/ZeroClipboard.swf" loop="false" menu="false" quality="best" bgcolor="#ffffff" width="18" height="18" name="ZeroClipboardMovie_5" align="center" allowscriptaccess="always" allowfullscreen="false" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer" flashvars="id=5&width=18&height=18" wmode="transparent"></div></div></div><ol start="1"><li style="line-height: 18px;"><span style="color: #2e8b57; font-weight: bold;">bool</span> HelloWorld::init()  </li><li style="line-height: 18px;">{  </li><li style="line-height: 18px;">    if ( !CCLayer::init() )  </li><li style="line-height: 18px;">    {  </li><li style="line-height: 18px;">        return false;  </li><li style="line-height: 18px;">    }  </li><li style="line-height: 18px;">    CCMenuItemImage *pCloseItem = CCMenuItemImage::create(  </li><li style="line-height: 18px;">                                        "CloseNormal.png",  </li><li style="line-height: 18px;">                                        "CloseSelected.png",  </li><li style="line-height: 18px;">                                        this,  </li><li style="line-height: 18px;">                                        menu_selector(HelloWorld::menuCloseCallback));  </li><li style="line-height: 18px;">   </li><li style="line-height: 18px;">    pCloseItem->setPosition(ccpAdd(VisibleRect::rightBottom(),   </li><li style="line-height: 18px;">                                ccp(-pCloseItem->getContentSize().width/2, pCloseItem->getContentSize().height/2)));  </li><li style="line-height: 18px;">   </li><li style="line-height: 18px;">    CCMenu* pMenu = CCMenu::create(pCloseItem, NULL);  </li><li style="line-height: 18px;">    pMenu->setPosition(CCPointZero);  </li><li style="line-height: 18px;">    this->addChild(pMenu, 1);  </li><li style="line-height: 18px;">   </li><li style="line-height: 18px;">    CCLabelTTF* pLabel = CCLabelTTF::create("Hello World", "Arial", SCALE_FACTOR * 24);  </li><li style="line-height: 18px;">    pLabel->setPosition(ccpAdd(VisibleRect::top(),  </li><li style="line-height: 18px;">                            ccp(0, -pLabel->getContentSize().height)));  </li><li style="line-height: 18px;">    this->addChild(pLabel, 1);  </li><li style="line-height: 18px;">   </li><li style="line-height: 18px;">    CCSprite* pSprite = CCSprite::create("HelloWorld.png");  </li><li style="line-height: 18px;">    pSprite->setPosition(VisibleRect::center());  </li><li style="line-height: 18px;">    this->addChild(pSprite, 0);  </li><li style="line-height: 18px;">   </li><li style="line-height: 18px;">    CCSprite *pLogoSprite = CCSprite::create("icon.png");  </li><li style="line-height: 18px;">    pLogoSprite->setAnchorPoint( ccp(0, 0.5) );  </li><li style="line-height: 18px;">    pLogoSprite->setPosition(ccpAdd(VisibleRect::left(), ccp(50, 0)));  </li><li style="line-height: 18px;">    this->addChild(pLogoSprite, 0);  </li><li style="line-height: 18px;">   </li><li style="line-height: 18px;">    return true;  </li><li style="line-height: 18px;">}  </li></ol></div><br style="color: #333333; font-family: Arial; line-height: 26px; background-color: #ffffff;" /><span style="color: #333333; background-color: #ffffff; font-family: Tahoma, Geneva, sans-serif; line-height: 25px; text-indent: 28px;">(5)鍒涘緩紿楀彛錛宮ain.cpp鐨勪富瑕佸唴瀹癸細</span><p style="color: #333333; font-family: Arial; line-height: 26px; background-color: #ffffff;"></p><p style="color: #333333; font-family: Arial; line-height: 26px; background-color: #ffffff;"></p><div bg_cpp"="" style="width: 687.046875px; color: #333333; line-height: 26px;"><div><div><strong>[cpp]</strong> <a title="view plain" style="background-image: url(http://static.blog.csdn.net/scripts/SyntaxHighlighter/styles/images/default/ico_plain.gif); padding: 1px; display: inline-block; width: 16px; height: 16px; text-indent: -2000px; background-position: 0% 0%; background-repeat: no-repeat no-repeat;">view plain</a><a title="copy" style="background-image: url(http://static.blog.csdn.net/scripts/SyntaxHighlighter/styles/images/default/ico_copy.gif); padding: 1px; display: inline-block; width: 16px; height: 16px; text-indent: -2000px; background-position: 0% 0%; background-repeat: no-repeat no-repeat;">copy</a><div style="position: absolute; left: 558px; top: 5734px; width: 18px; height: 18px; z-index: 99;"></div><div style="position: absolute; left: 558px; top: 5734px; width: 18px; height: 18px; z-index: 99;"><embed id="ZeroClipboardMovie_6" src="http://static.blog.csdn.net/scripts/ZeroClipboard/ZeroClipboard.swf" loop="false" menu="false" quality="best" bgcolor="#ffffff" width="18" height="18" name="ZeroClipboardMovie_6" align="center" allowscriptaccess="always" allowfullscreen="false" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer" flashvars="id=6&width=18&height=18" wmode="transparent"></div></div></div><ol start="1"><li style="line-height: 18px;">AppDelegate app;  </li><li style="line-height: 18px;">CCEGLView* eglView = CCEGLView::sharedOpenGLView();  </li><li style="line-height: 18px;">    //eglView->setFrameSize(2048, 1536);  </li><li style="line-height: 18px;">    //eglView->setFrameSize(480, 320);  </li><li style="line-height: 18px;">    //eglView->setFrameSize(800, 480);  </li><li style="line-height: 18px;">    //eglView->setFrameSize(1024, 768);  </li><li style="line-height: 18px;">    //eglView->setFrameSize(1280, 800);  </li><li style="line-height: 18px;">    eglView->setFrameSize(1280, 768);  </li><li style="line-height: 18px;">    //eglView->setFrameSize(960, 640);  </li><li style="line-height: 18px;">    eglView->setFrameZoomFactor(0.5f);  </li><li style="line-height: 18px;">   </li><li style="line-height: 18px;"><span style="color: #2e8b57; font-weight: bold;">int</span> ret = CCApplication::sharedApplication()->run();  </li></ol></div><span style="color: #333333; background-color: #ffffff; font-family: Tahoma, Geneva, sans-serif; line-height: 25px; text-indent: 28px;">OK錛屽埌姝や負姝紝浠g爜閮ㄥ垎宸茬粡瀹屾垚浜嗭紝涓嬮潰鐪嬬湅鍦ㄥ悇縐嶅垎杈ㄧ巼鍜屼笉鍚岀瓥鐣ヤ笅鐨勬晥鏋滃浘錛?/span><br style="color: #333333; background-color: #ffffff; font-family: Tahoma, Geneva, sans-serif; line-height: 25px; text-indent: 28px;" /><span style="color: #333333; background-color: #ffffff; font-family: Tahoma, Geneva, sans-serif; line-height: 25px; text-indent: 28px;">1. kResolutionShowAll絳栫暐</span><span style="color: #333333; background-color: #ffffff; font-family: Tahoma, Geneva, sans-serif; line-height: 25px; text-indent: 28px;">錛?/span><br style="color: #333333; background-color: #ffffff; font-family: Tahoma, Geneva, sans-serif; line-height: 25px; text-indent: 28px;" /><span style="color: #333333; background-color: #ffffff; font-family: Tahoma, Geneva, sans-serif; line-height: 25px; text-indent: 28px;">(1)</span><span style="background-color: #ffffff; font-family: Tahoma, Geneva, sans-serif; line-height: 25px; text-indent: 28px; color: #993300;">2048×1536</span><p style="color: #333333; font-family: Arial; line-height: 26px; background-color: #ffffff;"></p><p style="color: #333333; font-family: Arial; line-height: 26px; background-color: #ffffff;"><span style="font-family: Tahoma, Geneva, sans-serif; line-height: 25px; text-indent: 28px;"><span style="color: #993300;"><img src="http://codingnow.cn/wp-content/uploads/2012/12/20121204221330.png" alt="" style="border: none;" /><br /></span><br />(2)<span style="color: #993300;">1024×768</span><br /></span></p><p style="color: #333333; font-family: Arial; line-height: 26px; background-color: #ffffff;"><span style="font-family: Tahoma, Geneva, sans-serif; line-height: 25px; text-indent: 28px;"><span style="color: #993300;"><img src="http://codingnow.cn/wp-content/uploads/2012/12/20121204221415.png" alt="" style="border: none;" /><br /></span></span></p><p style="color: #333333; font-family: Arial; line-height: 26px; background-color: #ffffff;"><span style="font-family: Tahoma, Geneva, sans-serif; line-height: 25px; text-indent: 28px;"><span style="color: #993300;">(3)480×320<br /></span></span></p><p style="color: #333333; font-family: Arial; line-height: 26px; background-color: #ffffff;"><span style="font-family: Tahoma, Geneva, sans-serif; line-height: 25px; text-indent: 28px;"><span style="color: #993300;"><img src="http://codingnow.cn/wp-content/uploads/2012/12/20121204221454.png" alt="" style="border: none;" /><br /></span></span></p><p style="color: #333333; font-family: Arial; line-height: 26px; background-color: #ffffff;"><span style="font-family: Tahoma, Geneva, sans-serif; line-height: 25px; text-indent: 28px;"></span></p><span style="color: #333333; background-color: #ffffff; font-family: Tahoma, Geneva, sans-serif; line-height: 25px; text-indent: 28px;">2. kResolutionExactFit絳栫暐</span><br style="color: #333333; background-color: #ffffff; font-family: Tahoma, Geneva, sans-serif; line-height: 25px; text-indent: 28px;" /><span style="background-color: #ffffff; font-family: Tahoma, Geneva, sans-serif; line-height: 25px; text-indent: 28px; color: #993300;">1280×768鍒嗚鯨鐜?/span><p style="color: #333333; font-family: Arial; line-height: 26px; background-color: #ffffff;"><span style="font-family: Tahoma, Geneva, sans-serif; line-height: 25px; text-indent: 28px;"><span style="color: #993300;"><img src="http://codingnow.cn/wp-content/uploads/2012/12/20121204224333.png" alt="" style="border: none;" /><br /></span></span></p><p style="color: #333333; font-family: Arial; line-height: 26px; background-color: #ffffff;"><span style="font-family: Tahoma, Geneva, sans-serif; line-height: 25px; text-indent: 28px;"><span style="color: #993300;">3. kResolutionNoBorder絳栫暐<br />1280×768鍒嗚鯨鐜?br /></span></span></p><p style="color: #333333; font-family: Arial; line-height: 26px; background-color: #ffffff;"><span style="font-family: Tahoma, Geneva, sans-serif; line-height: 25px; text-indent: 28px;"><span style="color: #993300;"><img src="http://codingnow.cn/wp-content/uploads/2012/12/20121204224410.png" alt="" style="border: none;" /></span></span></p><p style="color: #333333; font-family: Arial; line-height: 26px; background-color: #ffffff;"><span style="font-family: Tahoma, Geneva, sans-serif; line-height: 1.8; text-indent: 28px; color: #993300;">demo婧愮爜錛歨ttp://download.csdn.net/detail/zhoujianghai/4847206</span></p><p style="color: #333333; font-family: Arial; line-height: 26px; background-color: #ffffff;"><span style="font-family: Tahoma, Geneva, sans-serif; line-height: 1.8; text-indent: 28px; color: #993300;">鏈枃閾炬帴錛歨ttp://codingnow.cn/cocos2d-x/975.html</span></p><img src ="http://www.tkk7.com/demibug/aggbug/396355.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.tkk7.com/demibug/" target="_blank">Hiji</a> 2013-03-13 01:25 <a href="http://www.tkk7.com/demibug/archive/2013/03/13/396355.html#Feedback" target="_blank" style="text-decoration:none;">鍙戣〃璇勮</a></div>]]></description></item><item><title>娣卞叆浜嗚ВCCSpritehttp://www.tkk7.com/demibug/archive/2013/03/11/396277.htmlHijiHijiMon, 11 Mar 2013 03:05:00 GMThttp://www.tkk7.com/demibug/archive/2013/03/11/396277.htmlhttp://www.tkk7.com/demibug/comments/396277.htmlhttp://www.tkk7.com/demibug/archive/2013/03/11/396277.html#Feedback0http://www.tkk7.com/demibug/comments/commentRss/396277.htmlhttp://www.tkk7.com/demibug/services/trackbacks/396277.html闃呰鍏ㄦ枃

Hiji 2013-03-11 11:05 鍙戣〃璇勮
]]>
CCsprite瀛︿範絎旇http://www.tkk7.com/demibug/archive/2013/03/11/396276.htmlHijiHijiMon, 11 Mar 2013 03:04:00 GMThttp://www.tkk7.com/demibug/archive/2013/03/11/396276.htmlhttp://www.tkk7.com/demibug/comments/396276.htmlhttp://www.tkk7.com/demibug/archive/2013/03/11/396276.html#Feedback0http://www.tkk7.com/demibug/comments/commentRss/396276.htmlhttp://www.tkk7.com/demibug/services/trackbacks/396276.html綺劇伒鏄父鎴忎腑鍗佸垎閲嶈鐨勭粍鎴愰儴鍒嗭紝闅忓鍙錛屽錛氭父鎴忚儗鏅丯PC銆佷漢鐗┿侀亾鍏風瓑銆傚湪cocos2d-x寮曟搸涓紝鍙鏄敤鍥劇墖灞曠ず鐨勶紝鍩烘湰涓婇渶瑕佷嬌鐢ㄧ簿鐏電被銆?br />1. 棣栧厛鏉ヤ簡瑙d竴涓嬭窡綺劇伒鐩稿叧鐨勫嚑涓被錛?/strong>
(1) CCTexture2D
鍙互鎶婂畠鐪嬫垚涓涓汗鐞嗭紝瀹冩槸cocos2d-x娓叉煋鍥懼艦鐨勯噸瑕佸弬鏁幫紝鐢ㄦ潵璐村浘錛屽洜涓篶ocos2d-x浣跨敤opengl es緇樺埗2d鍥懼艦鐨勶紝瀹冪殑灝哄鏄?鐨刵嬈℃柟銆備竴鑸氳繃浠ヤ笅鏂瑰紡鑾峰緱錛?/p>
1
CCTexture2D* cache = CCTextureCache::sharedTextureCache()->addImage("hero.png");

(2) CCSprite
榪欎釜灝辨槸綺劇伒綾伙紝鏄疌CNode鐨勫瓙綾伙紝瀹冪殑鍐呴儴灝佽浜咰CTexture2D(綰圭悊)錛屽彲浠ラ氳繃涓嬮潰鍑犵鏂瑰紡鍒濆鍖栫簿鐏靛璞°?/p>

1
2
3
4
5
6
7
8
9
10
11
12
//CCTexture2D琛ㄧず綺劇伒鍖呭惈鐨勫浘鐗囷紝鑼冨洿鏄暣寮犲浘鐗?/code>
static CCSprite* spriteWithTexture(CCTexture2D *pTexture);
//CCRect琛ㄧず鍥劇墖鐨勬寚瀹氳寖鍥達紝鍗充粠鍥劇墖鐨勬寚瀹氱煩褰㈠尯鍩熻鍓?/code>
static CCSprite* spriteWithTexture(CCTexture2D *pTexture, const CCRect& rect);
//CCSpriteFrame琛ㄧず綺劇伒鐨勬煇涓甯э紝澶у鏁版儏鍐典笅綺劇伒鏈韓鐨勫浘鐗囨湁澶氬撫銆傚畠鍐呴儴灝佽浜咰CTexture2D鍜孋CRect錛屽彲浠ヤ粠涓涓ぇ鍥劇墖鍙栧嚭涓閮ㄥ垎浣滀負涓甯с?/code>
static CCSprite* spriteWithSpriteFrame(CCSpriteFrame *pSpriteFrame);
//pszSpriteFrameName琛ㄧず甯х殑鍚嶅瓧錛屾牴鎹撫鍚嶄粠鍐呭瓨涓彇鍑篊CSpriteFrame
static


Hiji 2013-03-11 11:04 鍙戣〃璇勮
]]>
鍏充簬C++綾繪垚鍛樺嚱鏁扮殑閲嶈澆銆佽鐩栥侀殣钘忎笌virtual鍏抽敭瀛?/title><link>http://www.tkk7.com/demibug/archive/2013/03/10/396260.html</link><dc:creator>Hiji</dc:creator><author>Hiji</author><pubDate>Sun, 10 Mar 2013 12:06:00 GMT</pubDate><guid>http://www.tkk7.com/demibug/archive/2013/03/10/396260.html</guid><wfw:comment>http://www.tkk7.com/demibug/comments/396260.html</wfw:comment><comments>http://www.tkk7.com/demibug/archive/2013/03/10/396260.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.tkk7.com/demibug/comments/commentRss/396260.html</wfw:commentRss><trackback:ping>http://www.tkk7.com/demibug/services/trackbacks/396260.html</trackback:ping><description><![CDATA[<span style="font-family: Arial; background-color: #ffffff;">鏈榪戠湅<<楂樿川閲廋++>>鏃惰鍒扮殑鍏充簬鎴愬憳鍑芥暟鐨勯噸杞?瑕嗙洊/闅愯棌,鎶婃垜鐨勪竴鐐圭悊瑙e啓鍑烘潵,甯屾湜澶у鎵硅瘎涓庢寚姝?</span><p style="margin: 0cm 0cm 0.0001pt; text-align: justify; font-family: 'Times New Roman'; background-color: #ffffff;">1. <span style="font-family: 瀹嬩綋;">閲嶈澆銆佽鐩栦笌闅愯棌</span></p><p style="margin: 0cm 0cm 0.0001pt; text-align: justify; font-family: 'Times New Roman'; background-color: #ffffff; text-indent: 21pt;">1)<span style="font-family: 瀹嬩綋;">錛庨噸杞斤細鎴愬憳鍑芥暟鍏鋒湁浠ヤ笅鐨勭壒寰佹椂鍙戠敓“閲嶈澆”</span></p><p style="margin: 0cm 0cm 0.0001pt 21pt; text-align: justify; font-family: 'Times New Roman'; background-color: #ffffff; text-indent: 21pt;">A<span style="font-family: 瀹嬩綋;">錛庣浉鍚岀殑鑼冨洿錛堝悓涓涓被涓級</span></p><p style="margin: 0cm 0cm 0.0001pt 21pt; text-align: justify; font-family: 'Times New Roman'; background-color: #ffffff; text-indent: 21pt;">B<span style="font-family: 瀹嬩綋;">錛庡嚱鏁扮殑鍚嶅瓧鐩稿悓</span></p><p style="margin: 0cm 0cm 0.0001pt 21pt; text-align: justify; font-family: 'Times New Roman'; background-color: #ffffff; text-indent: 21pt;">C<span style="font-family: 瀹嬩綋;">錛庡弬鏁扮被鍨嬩笉鍚岋紙涓嶈兘榪涜闅愬紡綾誨瀷杞崲錛?/span></p><p style="margin: 0cm 0cm 0.0001pt 21pt; text-align: justify; font-family: 'Times New Roman'; background-color: #ffffff; text-indent: 21pt;">D<span style="font-family: 瀹嬩綋;">錛?/span>Virtual<span style="font-family: 瀹嬩綋;">鍏抽敭瀛楀彲鏈夊彲鏃?/span></p><p style="margin: 0cm 0cm 0.0001pt; text-align: justify; font-family: 'Times New Roman'; background-color: #ffffff; text-indent: 21pt;">2)<span style="font-family: 瀹嬩綋;">錛庤鐩栵紙涔熷彨“緇ф壙”錛夛細鎸囨淳鐢熺被鍑芥暟瑕嗙洊鍩虹被鍑芥暟錛岀壒寰佹槸錛?/span></p><p style="margin: 0cm 0cm 0.0001pt 21pt; text-align: justify; font-family: 'Times New Roman'; background-color: #ffffff; text-indent: 21pt;">A<span style="font-family: 瀹嬩綋;">錛庝笉鍚岀殑鑼冨洿錛堝垎鍒綅浜庡熀綾諱笌媧劇敓綾諱腑錛?/span></p><p style="margin: 0cm 0cm 0.0001pt 21pt; text-align: justify; font-family: 'Times New Roman'; background-color: #ffffff; text-indent: 21pt;">B<span style="font-family: 瀹嬩綋;">錛庡嚱鏁板悕瀛楃浉鍚?/span></p><p style="margin: 0cm 0cm 0.0001pt 21pt; text-align: justify; font-family: 'Times New Roman'; background-color: #ffffff; text-indent: 21pt;">C<span style="font-family: 瀹嬩綋;">錛庡弬鏁扮浉鍚?/span></p><p style="margin: 0cm 0cm 0.0001pt 21pt; text-align: justify; font-family: 'Times New Roman'; background-color: #ffffff; text-indent: 21pt;">D<span style="font-family: 瀹嬩綋;">錛庡熀綾誨嚱鏁板繀欏繪湁</span>virtual<span style="font-family: 瀹嬩綋;">鍏抽敭瀛?/span></p><p style="margin: 0cm 0cm 0.0001pt; text-align: justify; font-family: 'Times New Roman'; background-color: #ffffff; text-indent: 21pt;">3)<span style="font-family: 瀹嬩綋;">錛庨殣钘忥細鏄寚媧劇敓綾葷殑鍑芥暟灞忚斀浜嗕笌鍏跺悓鍚嶇殑鍩虹被鍑芥暟錛岃鍒欏涓嬶細</span></p><p style="margin: 0cm 0cm 0.0001pt 21pt; text-align: justify; font-family: 'Times New Roman'; background-color: #ffffff; text-indent: 21pt;">A<span style="font-family: 瀹嬩綋;">錛庡鏋滄淳鐢熺被鐨勫嚱鏁頒笌鍩虹被鐨勫嚱鏁板悓鍚嶏紝浣嗘槸鍙傛暟涓嶅悓錛屾鏃朵笉璁烘湁鏃?/span>virtual<span style="font-family: 瀹嬩綋;">鍏抽敭瀛楋紝鍩虹被鐨勫嚱鏁伴兘灝嗚闅愯棌錛屾敞鎰忓埆涓庨噸杞芥販娣嗭級</span></p><p style="margin: 0cm 0cm 0.0001pt 21pt; text-align: justify; font-family: 'Times New Roman'; background-color: #ffffff; text-indent: 21pt;">B<span style="font-family: 瀹嬩綋;">錛庡鏋滄淳鐢熺被鐨勫嚱鏁頒笌鍩虹被鐨勫嚱鏁板悓鍚嶏紝騫朵笖鍙傛暟涔熺浉鍚岋紝浣嗘槸鍩虹被鍑芥暟娌℃湁</span>virtual<span style="font-family: 瀹嬩綋;">鍏抽敭瀛楋紝姝ゆ椂鍩虹被鐨勫嚱鏁拌闅愯棌錛堟敞鎰忓埆涓庤鐩栨販娣嗭級</span></p><p style="margin: 0cm 0cm 0.0001pt; text-align: justify; font-family: 'Times New Roman'; background-color: #ffffff;"> </p><p style="margin: 0cm 0cm 0.0001pt; text-align: justify; font-family: 'Times New Roman'; background-color: #ffffff;">2<span style="font-family: 瀹嬩綋;">錛庣湅涓嬮潰榪欎釜渚嬪瓙浠g爜錛?/span></p><p style="margin: 0cm 0cm 0.0001pt; text-align: justify; font-family: 'Times New Roman'; background-color: #ffffff;"></p><div style="font-family: Arial; border: 1px solid #cccccc; padding: 4px 5px 4px 4px; background-color: #eeeeee; font-size: 13px; width: 995.671875px;"><span style="color: #008080;"> 1</span> #include <iostream><br /><span style="color: #008080;"> 2</span> <span style="color: #0000ff;">using</span> std::cout;<br /><span style="color: #008080;"> 3</span> <span style="color: #0000ff;">using</span> std::endl;<br /><span style="color: #008080;"> 4</span> <br /><span style="color: #008080;"> 5</span> <span style="color: #0000ff;">class</span> Base<br /><span style="color: #008080;"> 6</span> {<br /><span style="color: #008080;"> 7</span> <span style="color: #0000ff;">public</span>:<br /><span style="color: #008080;"> 8</span>     <span style="color: #0000ff;">virtual</span> <span style="color: #0000ff;">void</span> f(<span style="color: #0000ff;">float</span> x){ cout << "Base::f(float) " << x << endl;}<br /><span style="color: #008080;"> 9</span>     <span style="color: #0000ff;">void</span> g(<span style="color: #0000ff;">float</span> x){ std::cout << "Base::g(float) " << x << std::endl;}<br /><span style="color: #008080;">10</span>     <span style="color: #0000ff;">void</span> h(<span style="color: #0000ff;">float</span> x){ std::cout << "Base::h(float) " << x <<std::endl;}<br /><span style="color: #008080;">11</span> };<br /><span style="color: #008080;">12</span> <br /><span style="color: #008080;">13</span> <span style="color: #0000ff;">class</span> Derived : <span style="color: #0000ff;">public</span> Base<br /><span style="color: #008080;">14</span> {<br /><span style="color: #008080;">15</span> <span style="color: #0000ff;">public</span>:<br /><span style="color: #008080;">16</span>     <span style="color: #0000ff;">virtual</span> <span style="color: #0000ff;">void</span> f(<span style="color: #0000ff;">float</span> x){ std::cout << "Derived::f(float) " << x << std::endl;}<br /><span style="color: #008080;">17</span>     <span style="color: #0000ff;">void</span> g(<span style="color: #0000ff;">int</span> x){ std::cout << "Derived::g(int) " << x << std::endl;}<br /><span style="color: #008080;">18</span>     <span style="color: #0000ff;">void</span> h(<span style="color: #0000ff;">float</span> x){ std::cout << "Derived::h(float) " << x << std::endl;}<br /><span style="color: #008080;">19</span> };<br /><span style="color: #008080;">20</span> <br /><span style="color: #008080;">21</span> <span style="color: #0000ff;">void</span> main(<span style="color: #0000ff;">void</span>)<br /><span style="color: #008080;">22</span> {<br /><span style="color: #008080;">23</span>     Derived d;<br /><span style="color: #008080;">24</span>     Base *pb = &d;<br /><span style="color: #008080;">25</span>     Derived *pd = &d;<br /><span style="color: #008080;">26</span> <br /><span style="color: #008080;">27</span>     pb->f(3.14f);<span style="color: #008000;">//</span><span style="color: #008000;">Derived::f(float) 3.14</span><span style="color: #008000;"><br /></span><span style="color: #008080;">28</span>     pd->f(3.14f);<span style="color: #008000;">//</span><span style="color: #008000;">Derived::f(float) 3.14</span><span style="color: #008000;"><br /></span><span style="color: #008080;">29</span> <br /><span style="color: #008080;">30</span>     pb->g(3.14f);<span style="color: #008000;">//</span><span style="color: #008000;">Base::g(float) 3.14</span><span style="color: #008000;"><br /></span><span style="color: #008080;">31</span>     pd->g(3.14f);<span style="color: #008000;">//</span><span style="color: #008000;">Derived::g(int) 3</span><span style="color: #008000;"><br /></span><span style="color: #008080;">32</span> <br /><span style="color: #008080;">33</span>     pb->h(3.14f);<span style="color: #008000;">//</span><span style="color: #008000;">Base:h(float) 3.14</span><span style="color: #008000;"><br /></span><span style="color: #008080;">34</span>     pd->h(3.14f);<span style="color: #008000;">//</span><span style="color: #008000;">Derived::h(float) 3.14</span><span style="color: #008000;"><br /></span><span style="color: #008080;">35</span> }<span style="color: #008080;"><br /></span></div><p style="margin: 0cm 0cm 0.0001pt; text-align: justify; font-family: 'Times New Roman'; background-color: #ffffff;"> </p><p style="margin: 0cm 0cm 0.0001pt; text-align: justify; font-family: 'Times New Roman'; background-color: #ffffff;">3. <span style="font-family: 瀹嬩綋;">瑙i噴</span></p><p style="margin: 0cm 0cm 0.0001pt; text-align: justify; font-family: 'Times New Roman'; background-color: #ffffff; text-indent: 21pt;"><span style="font-family: 瀹嬩綋;">鍦?/span>27<span style="font-family: 瀹嬩綋;">涓?/span>28<span style="font-family: 瀹嬩綋;">琛岋紝媧劇敓綾葷殑</span>Derived::f(float x)<span style="font-family: 瀹嬩綋;">閫氳繃</span>virtual<span style="font-family: 瀹嬩綋;">鍏抽敭瀛楃戶鎵匡紙瑕嗙洊錛変簡鍩虹被鐨?/span>Base::f(float x)<span style="font-family: 瀹嬩綋;">鏂規硶錛屾墍浠ヨ繖閲屾棤璁洪噰鏈夊熀綾繪寚閽堣繕鏄淳鐢熺被鎸囬拡錛屾渶鍚庤皟鐢ㄧ殑鍏跺疄閮芥槸</span>Derived::f(float x)<span style="font-family: 瀹嬩綋;">鏂規硶銆傝繖姝f槸涓鑸儏鍐墊垜浠墍鏈熸湜鐨勩?/span></p><p style="margin: 0cm 0cm 0.0001pt; text-align: justify; font-family: 'Times New Roman'; background-color: #ffffff; text-indent: 21pt;"><span style="font-family: 瀹嬩綋;">鍦?/span>30<span style="font-family: 瀹嬩綋;">琛岋紝鐢變簬鍩虹被鐨?/span>Base::g()<span style="font-family: 瀹嬩綋;">娌℃湁鐢?/span>virtual<span style="font-family: 瀹嬩綋;">鍏抽敭瀛楀0鏄庯紝鎵浠ヨ繖閲屽畠涓嶄細琚淳鐢熺被鐨?/span>Derived::g()<span style="font-family: 瀹嬩綋;">鏂規硶瑕嗙洊銆傛墍浠ラ氳繃鍩虹被鎸囬拡璁塊棶鏃跺彧鑳借闂埌</span>Base::g(float x)<span style="font-family: 瀹嬩綋;">錛岃屽湪</span>31<span style="font-family: 瀹嬩綋;">琛岄氳繃媧劇敓綾繪寚閽堟椂鍙互璁塊棶鐨勬柟娉曟湁</span>Base::g(float x)<span style="font-family: 瀹嬩綋;">鍜?/span>Derived::g(int x)<span style="font-family: 瀹嬩綋;">錛岃繖涓や釜鏂規硶铏界劧鏂規硶鍚嶇浉鍚岃屼笖鍙傛暟涓嶅悓錛堜技涔庯級絎﹀悎閲嶈澆鐨勬爣鍑嗭紝浣嗘槸瀹冧滑鍗村垎灞炰簬涓嶅悓鐨?#8220;鍩?#8221;鍥犳閲嶈澆涓嶄細鍙戠敓錛岃繖鏃?/span>Derived::g(int x)<span style="font-family: 瀹嬩綋;">灝卞彧鑳芥妸</span>Base::g(float x)<span style="font-family: 瀹嬩綋;">“闅愯棌”鎺夈?/span></p><p style="margin: 0cm 0cm 0.0001pt; text-align: justify; font-family: 'Times New Roman'; background-color: #ffffff; text-indent: 21pt;"><span style="font-family: 瀹嬩綋;">鍚屼笂錛屽湪絎?/span>33<span style="font-family: 瀹嬩綋;">琛岄氳繃鍩虹被鎸囬拡鑳借闂殑鏂規硶鍙湁</span>Base::h(float x)<span style="font-family: 瀹嬩綋;">錛岀敱浜庤鏂規硶娌℃湁琚?/span>virtual<span style="font-family: 瀹嬩綋;">鍏抽敭瀛楀0鏄庯紝鎵浠ヤ笉浼氳媧劇敓綾繪柟娉?/span>Derived::h(float x)<span style="font-family: 瀹嬩綋;">“鏇挎崲”錛屽洜姝よ皟鐢ㄧ殑鏄?/span>Base::h(float x)<span style="font-family: 瀹嬩綋;">銆傝屽湪絎?/span>34<span style="font-family: 瀹嬩綋;">琛岄氳繃媧劇敓綾繪寚閽堝彲浠ヨ闂殑鏂規硶鍚屾椂鏈?/span>Base::h(float x)<span style="font-family: 瀹嬩綋;">涓?/span>Derived::h(float x)<span style="font-family: 瀹嬩綋;">錛岃繖浼間箮鍙堝啿紿侊紝鑰岃繖鏃?/span>C++<span style="font-family: 瀹嬩綋;">鐨?#8220;闅愯棌”瑙勫垯鍙戠敓浣滅敤錛屾墍浠ユ淳鐢熺被鏂規硶</span>Derived::h(float x)<span style="font-family: 瀹嬩綋;">鎶婂熀綾繪柟娉?/span>Base::h(float x)<span style="font-family: 瀹嬩綋;">“闅愯棌”錛屼簬鏄?/span>Derived::h(float x)<span style="font-family: 瀹嬩綋;">琚皟鐢ㄣ?/span></p><p style="margin: 0cm 0cm 0.0001pt; text-align: justify; font-family: 'Times New Roman'; background-color: #ffffff; text-indent: 21pt;"> </p><p style="margin: 0cm 0cm 0.0001pt; text-align: justify; font-family: 'Times New Roman'; background-color: #ffffff;">4<span style="font-family: 瀹嬩綋;">錛庢葷粨</span></p><p style="margin: 0cm 0cm 0.0001pt; text-align: justify; font-family: 'Times New Roman'; background-color: #ffffff;">       C++<span style="font-family: 瀹嬩綋;">鐨?#8220;閲嶈澆”銆?#8220;緇ф壙”涓?#8220;闅愯棌”鏈哄埗姣斾竴鑸兂璞′腑鐨勮澶嶆潅錛岃岃繖灝辯獊鏄句簡</span>virtual<span style="font-family: 瀹嬩綋;">鍏抽敭瀛楃殑閲嶈鎬с傛墍浠ュ湪媧劇敓綾誨瓨鍦ㄧ殑鍓嶆彁涓嬩竴錛屼竴瀹氳鎶婂熀綾諱腑鍙兘鍦ㄦ淳鐢熺被涓篃瀹炵幇鐨勬柟娉曠敤</span>virtual<span style="font-family: 瀹嬩綋;">鍏抽敭瀛楀0鏄庛傞櫎闈炲湪鐗規畩鎯呭喌涓嬶紝姣斿闇瑕佹鏌ユ寚閽堢被鍨嬬殑鏃跺欍?/span></p><p style="margin: 0cm 0cm 0.0001pt; text-align: justify; font-family: 'Times New Roman'; background-color: #ffffff;"><br /></p><div style="font-family: Arial; border: 1px solid #cccccc; padding: 4px 5px 4px 4px; background-color: #eeeeee; font-size: 13px; width: 995.671875px;"><span style="color: #008080;"> 1</span> #include <iostream><br /><span style="color: #008080;"> 2</span> <span style="color: #0000ff;">using</span> std::cout;<br /><span style="color: #008080;"> 3</span> <span style="color: #0000ff;">using</span> std::endl;<br /><span style="color: #008080;"> 4</span> <br /><span style="color: #008080;"> 5</span> <span style="color: #0000ff;">class</span> Base<br /><span style="color: #008080;"> 6</span> {<br /><span style="color: #008080;"> 7</span> <span style="color: #0000ff;">public</span>:<br /><span style="color: #008080;"> 8</span>     <span style="color: #0000ff;">void</span> CheckType(<span style="color: #0000ff;">void</span>){ cout << "This's Base Ptr" << endl;}<br /><span style="color: #008080;"> 9</span> };<br /><span style="color: #008080;">10</span> <br /><span style="color: #008080;">11</span> <span style="color: #0000ff;">class</span> Derived : <span style="color: #0000ff;">public</span> Base<br /><span style="color: #008080;">12</span> {<br /><span style="color: #008080;">13</span> <span style="color: #0000ff;">public</span>:<br /><span style="color: #008080;">14</span>     <span style="color: #0000ff;">void</span> CheckType(<span style="color: #0000ff;">void</span>){ cout << "This;s Derived Ptr" << endl;}<br /><span style="color: #008080;">15</span> };<br /><span style="color: #008080;">16</span> <br /><span style="color: #008080;">17</span> <span style="color: #0000ff;">void</span> main(<span style="color: #0000ff;">void</span>)<br /><span style="color: #008080;">18</span> {<br /><span style="color: #008080;">19</span>     Derived d;<br /><span style="color: #008080;">20</span>     Base *pb = &d;<br /><span style="color: #008080;">21</span>     Derived *pd = &d;<br /><span style="color: #008080;">22</span> <br /><span style="color: #008080;">23</span>     pb->CheckType();<span style="color: #008000;">//</span><span style="color: #008000;">This's Base Ptr</span><span style="color: #008000;"><br /></span><span style="color: #008080;">24</span>     pd->CheckType();<span style="color: #008000;">//</span><span style="color: #008000;">This's Derived Ptr</span><span style="color: #008000;"><br /></span><span style="color: #008080;">25</span> }<br /><span style="color: #008080;">26</span> </div><img src ="http://www.tkk7.com/demibug/aggbug/396260.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.tkk7.com/demibug/" target="_blank">Hiji</a> 2013-03-10 20:06 <a href="http://www.tkk7.com/demibug/archive/2013/03/10/396260.html#Feedback" target="_blank" style="text-decoration:none;">鍙戣〃璇勮</a></div>]]></description></item><item><title>Cocos2dx浣跨敤 TexturePacker瀵煎嚭鐨?plisthttp://www.tkk7.com/demibug/archive/2013/03/10/396256.htmlHijiHijiSun, 10 Mar 2013 08:38:00 GMThttp://www.tkk7.com/demibug/archive/2013/03/10/396256.htmlhttp://www.tkk7.com/demibug/comments/396256.htmlhttp://www.tkk7.com/demibug/archive/2013/03/10/396256.html#Feedback0http://www.tkk7.com/demibug/comments/commentRss/396256.htmlhttp://www.tkk7.com/demibug/services/trackbacks/396256.html
  • CCSpriteFrameCache* cache = CCSpriteFrameCache::sharedSpriteFrameCache();  
  •     cache->addSpriteFramesWithFile("test.plist""test.png");  
  •       
  •     /* 鍒涘緩Sprite */  
  •     CCSprite* s1 = CCSprite::createWithSpriteFrame(cache->spriteFrameByName("g_good.png"));  
  •       
  •     s1->setPosition(ccp(100, 100));  
  •     addChild(s1);  
  •       
  •     CCSprite* s2 = CCSprite::createWithSpriteFrame(cache->spriteFrameByName("musicBtn.png"));  
  •       
  •     s2->setPosition(ccp(300, 300));  
  •     addChild(s2); 


  • Hiji 2013-03-10 16:38 鍙戣〃璇勮
    ]]>
    cocos2d涓瑿CCallFunc銆丆CCallFuncN鍜孋CCallFuncND鐨勫尯鍒?/title><link>http://www.tkk7.com/demibug/archive/2013/02/26/395756.html</link><dc:creator>Hiji</dc:creator><author>Hiji</author><pubDate>Tue, 26 Feb 2013 07:36:00 GMT</pubDate><guid>http://www.tkk7.com/demibug/archive/2013/02/26/395756.html</guid><wfw:comment>http://www.tkk7.com/demibug/comments/395756.html</wfw:comment><comments>http://www.tkk7.com/demibug/archive/2013/02/26/395756.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.tkk7.com/demibug/comments/commentRss/395756.html</wfw:commentRss><trackback:ping>http://www.tkk7.com/demibug/services/trackbacks/395756.html</trackback:ping><description><![CDATA[<p style="margin: 0px; padding: 0px; font-family: Helvetica, Tahoma, Arial, sans-serif; line-height: 25.1875px; background-color: #ffffff;">cocos2d涓湁3縐嶅洖璋冩柟寮忥細CCCallFunc銆丆CCallFuncN鍜孋CCallFuncND</p><p style="margin: 0px; padding: 0px; font-family: Helvetica, Tahoma, Arial, sans-serif; line-height: 25.1875px; background-color: #ffffff;">鍏朵腑錛屼粬浠湁浠涔堝尯鍒憿錛?/p><p style="margin: 0px; padding: 0px; font-family: Helvetica, Tahoma, Arial, sans-serif; line-height: 25.1875px; background-color: #ffffff;"> </p><p style="margin: 0px; padding: 0px; font-family: Helvetica, Tahoma, Arial, sans-serif; line-height: 25.1875px; background-color: #ffffff;">榪欓噷鎴戠◢寰葷粨涓嬶紝涓嶅鐨勬榪庤璁哄拰鎷嶇爾錛?/p><p style="margin: 0px; padding: 0px; font-family: Helvetica, Tahoma, Arial, sans-serif; line-height: 25.1875px; background-color: #ffffff;"> </p><p style="margin: 0px; padding: 0px; font-family: Helvetica, Tahoma, Arial, sans-serif; line-height: 25.1875px; background-color: #ffffff;">鐪嬫簮浠g爜鐨別xcute鏂規硶錛屾垜鎬葷粨涓嬮潰3鐐癸細</p><p style="margin: 0px; padding: 0px; font-family: Helvetica, Tahoma, Arial, sans-serif; line-height: 25.1875px; background-color: #ffffff;">1. CCCallFunc</p><p style="margin: 0px; padding: 0px; font-family: Helvetica, Tahoma, Arial, sans-serif; line-height: 25.1875px; background-color: #ffffff;"> </p><p style="margin: 0px; padding: 0px; font-family: Helvetica, Tahoma, Arial, sans-serif; line-height: 25.1875px; background-color: #ffffff;"></p><div class="q0oqyiq" id="" style="font-family: Monaco, 'DejaVu Sans Mono', 'Bitstream Vera Sans Mono', Consolas, 'Courier New', monospace; background-color: #ffffff; width: 679px; margin-left: 9px; padding-right: 1px; padding-bottom: 1px; padding-left: 1px; word-break: break-all; word-wrap: break-word; line-height: 25.1875px;"><div><div style="padding-right: 3px; padding-bottom: 3px; padding-left: 3px; margin: 0px; font-weight: bold;">C浠g爜 <embed wmode="transparent" src="http://wsqwsq000.iteye.com/javascripts/syntaxhighlighter/clipboard_new.swf" width="14" height="15" flashvars="clipboard=-(void)%20execute%0A%7B%0A%09%5BtargetCallback%20performSelector%3Aselector%5D%3B%0A%7D" quality="high" allowscriptaccess="always" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer"> <a href="" title="鏀惰棌榪欐浠g爜" style="color: #108ac6;"><img src="http://wsqwsq000.iteye.com/images/icon_star.png" alt="鏀惰棌浠g爜" style="border: 0px;" /></a></div></div><ol start="1" style="font-size: 1em; line-height: 1.4em; margin-left: 0px; padding-top: 2px; padding-bottom: 2px; border: 1px solid #d1d7dc; color: #2b91af;"><li style="font-size: 1em; margin-left: 38px; padding-right: 0px; border-left-width: 1px; border-left-color: #d1d7dc; background-color: #fafafa; line-height: 18px;">-(<span style="color: #7f0055;">void</span>) execute  </li><li style="font-size: 1em; margin-left: 38px; padding-right: 0px; border-left-width: 1px; border-left-color: #d1d7dc; background-color: #fafafa; line-height: 18px;">{  </li><li style="font-size: 1em; margin-left: 38px; padding-right: 0px; border-left-width: 1px; border-left-color: #d1d7dc; background-color: #fafafa; line-height: 18px;">    [targetCallback performSelector:selector];  </li><li style="font-size: 1em; margin-left: 38px; padding-right: 0px; border-left-width: 1px; border-left-color: #d1d7dc; background-color: #fafafa; line-height: 18px;">}  </li></ol></div><p style="margin: 0px; padding: 0px; font-family: Helvetica, Tahoma, Arial, sans-serif; line-height: 25.1875px; background-color: #ffffff;">CCCallFunc鏄墽琛屽搴旂殑鍥炶皟鏂規硶錛屽叾涓洖璋冩柟娉曚笉鍙甫鍙傛暟銆?/p><p style="margin: 0px; padding: 0px; font-family: Helvetica, Tahoma, Arial, sans-serif; line-height: 25.1875px; background-color: #ffffff;"> </p><p style="margin: 0px; padding: 0px; font-family: Helvetica, Tahoma, Arial, sans-serif; line-height: 25.1875px; background-color: #ffffff;">2. CCCallFuncN</p><p style="margin: 0px; padding: 0px; font-family: Helvetica, Tahoma, Arial, sans-serif; line-height: 25.1875px; background-color: #ffffff;"> </p><p style="margin: 0px; padding: 0px; font-family: Helvetica, Tahoma, Arial, sans-serif; line-height: 25.1875px; background-color: #ffffff;"></p><div class="ykmm8qy" id="" style="font-family: Monaco, 'DejaVu Sans Mono', 'Bitstream Vera Sans Mono', Consolas, 'Courier New', monospace; background-color: #ffffff; width: 679px; margin-left: 9px; padding-right: 1px; padding-bottom: 1px; padding-left: 1px; word-break: break-all; word-wrap: break-word; line-height: 25.1875px;"><div><div style="padding-right: 3px; padding-bottom: 3px; padding-left: 3px; margin: 0px; font-weight: bold;">C浠g爜 <embed wmode="transparent" src="http://wsqwsq000.iteye.com/javascripts/syntaxhighlighter/clipboard_new.swf" width="14" height="15" flashvars="clipboard=-(void)%20execute%0A%7B%0A%09%5BtargetCallback%20performSelector%3Aselector%20withObject%3Atarget%5D%3B%0A%7D" quality="high" allowscriptaccess="always" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer"> <a href="" title="鏀惰棌榪欐浠g爜" style="color: #108ac6;"><img src="http://wsqwsq000.iteye.com/images/icon_star.png" alt="鏀惰棌浠g爜" style="border: 0px;" /></a></div></div><ol start="1" style="font-size: 1em; line-height: 1.4em; margin-left: 0px; padding-top: 2px; padding-bottom: 2px; border: 1px solid #d1d7dc; color: #2b91af;"><li style="font-size: 1em; margin-left: 38px; padding-right: 0px; border-left-width: 1px; border-left-color: #d1d7dc; background-color: #fafafa; line-height: 18px;">-(<span style="color: #7f0055;">void</span>) execute  </li><li style="font-size: 1em; margin-left: 38px; padding-right: 0px; border-left-width: 1px; border-left-color: #d1d7dc; background-color: #fafafa; line-height: 18px;">{  </li><li style="font-size: 1em; margin-left: 38px; padding-right: 0px; border-left-width: 1px; border-left-color: #d1d7dc; background-color: #fafafa; line-height: 18px;">    [targetCallback performSelector:selector withObject:target];  </li><li style="font-size: 1em; margin-left: 38px; padding-right: 0px; border-left-width: 1px; border-left-color: #d1d7dc; background-color: #fafafa; line-height: 18px;">}  </li></ol></div><p style="margin: 0px; padding: 0px; font-family: Helvetica, Tahoma, Arial, sans-serif; line-height: 25.1875px; background-color: #ffffff;"> CCCallFuncN澶氬甫涓涓弬鏁幫紝鑰屽弬鏁版湰韜槸鍔ㄤ綔Aciton鏈韓銆傚氨鍍廢IButton閭f牱錛屾垜浠彲浠selector(btnUpInside:)錛屽甫鐨勫弬鏁板氨鏄疷IButton鏈韓銆?/p><p style="margin: 0px; padding: 0px; font-family: Helvetica, Tahoma, Arial, sans-serif; line-height: 25.1875px; background-color: #ffffff;"> </p><p style="margin: 0px; padding: 0px; font-family: Helvetica, Tahoma, Arial, sans-serif; line-height: 25.1875px; background-color: #ffffff;">3. CCCallFuncND</p><p style="margin: 0px; padding: 0px; font-family: Helvetica, Tahoma, Arial, sans-serif; line-height: 25.1875px; background-color: #ffffff;"> </p><p style="margin: 0px; padding: 0px; font-family: Helvetica, Tahoma, Arial, sans-serif; line-height: 25.1875px; background-color: #ffffff;"></p><div class="80moowq" id="" style="font-family: Monaco, 'DejaVu Sans Mono', 'Bitstream Vera Sans Mono', Consolas, 'Courier New', monospace; background-color: #ffffff; width: 679px; margin-left: 9px; padding-right: 1px; padding-bottom: 1px; padding-left: 1px; word-break: break-all; word-wrap: break-word; line-height: 25.1875px;"><div><div style="padding-right: 3px; padding-bottom: 3px; padding-left: 3px; margin: 0px; font-weight: bold;">C浠g爜 <embed wmode="transparent" src="http://wsqwsq000.iteye.com/javascripts/syntaxhighlighter/clipboard_new.swf" width="14" height="15" flashvars="clipboard=-(void)%20execute%0A%7B%0A%09%5Binvocation_%20setArgument%3A%26target%20atIndex%3A2%5D%3B%0A%09%5Binvocation_%20setArgument%3A%26data%20atIndex%3A3%5D%3B%0A%09%5Binvocation_%20invoke%5D%3B%0A%7D" quality="high" allowscriptaccess="always" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer"> <a href="" title="鏀惰棌榪欐浠g爜" style="color: #108ac6;"><img src="http://wsqwsq000.iteye.com/images/icon_star.png" alt="鏀惰棌浠g爜" style="border: 0px;" /></a></div></div><ol start="1" style="font-size: 1em; line-height: 1.4em; margin-left: 0px; padding-top: 2px; padding-bottom: 2px; border: 1px solid #d1d7dc; color: #2b91af;"><li style="font-size: 1em; margin-left: 38px; padding-right: 0px; border-left-width: 1px; border-left-color: #d1d7dc; background-color: #fafafa; line-height: 18px;">-(<span style="color: #7f0055;">void</span>) execute  </li><li style="font-size: 1em; margin-left: 38px; padding-right: 0px; border-left-width: 1px; border-left-color: #d1d7dc; background-color: #fafafa; line-height: 18px;">{  </li><li style="font-size: 1em; margin-left: 38px; padding-right: 0px; border-left-width: 1px; border-left-color: #d1d7dc; background-color: #fafafa; line-height: 18px;">    [invocation_ setArgument:&target atIndex:2];  </li><li style="font-size: 1em; margin-left: 38px; padding-right: 0px; border-left-width: 1px; border-left-color: #d1d7dc; background-color: #fafafa; line-height: 18px;">    [invocation_ setArgument:&data atIndex:3];  </li><li style="font-size: 1em; margin-left: 38px; padding-right: 0px; border-left-width: 1px; border-left-color: #d1d7dc; background-color: #fafafa; line-height: 18px;">    [invocation_ invoke];  </li><li style="font-size: 1em; margin-left: 38px; padding-right: 0px; border-left-width: 1px; border-left-color: #d1d7dc; background-color: #fafafa; line-height: 18px;">}  </li></ol></div><span style="font-family: Helvetica, Tahoma, Arial, sans-serif; line-height: 25.1875px; background-color: #ffffff;">CCCallFuncND甯?涓弬鏁幫紝涓涓槸鍔ㄤ綔Action鏈韓錛屼竴涓槸浣犺嚜宸卞畾涔夌殑鍥炶皟鍑芥暟鐨勫弬鏁般?/span><img src ="http://www.tkk7.com/demibug/aggbug/395756.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.tkk7.com/demibug/" target="_blank">Hiji</a> 2013-02-26 15:36 <a href="http://www.tkk7.com/demibug/archive/2013/02/26/395756.html#Feedback" target="_blank" style="text-decoration:none;">鍙戣〃璇勮</a></div>]]></description></item><item><title>Cocos2dx 涓枃鏀寔http://www.tkk7.com/demibug/archive/2013/01/15/394268.htmlHijiHijiTue, 15 Jan 2013 11:26:00 GMThttp://www.tkk7.com/demibug/archive/2013/01/15/394268.htmlhttp://www.tkk7.com/demibug/comments/394268.htmlhttp://www.tkk7.com/demibug/archive/2013/01/15/394268.html#Feedback1http://www.tkk7.com/demibug/comments/commentRss/394268.htmlhttp://www.tkk7.com/demibug/services/trackbacks/394268.html

    灝嗛渶瑕佺殑瀛楃涓蹭繚瀛樹簬 strings.xml鏂囦歡涓細

    <?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>title</key>  
        
    <string>鏄敺浜哄氨鍧氭寔20縐?/span></string>  
        
    <key>new_game</key>  
        
    <string>鏂版父鎴?/span></string>  
        
    <key>setting_game</key>  
        
    <string>璁劇疆</string>  
        
    <key>quit_game</key>  
        
    <string>閫鍑?/span></string>  
    </dict>  
    </plist>  
    鐒跺悗鍦ㄤ唬鐮佷腑璇誨彇錛?/span>

    CCDictionary *strings = CCDictionary::createWithContentsOfFile("fonts/strings.xml");

    const char *titleStr = (CCString*)strings->objectForKey("title")->m_sString.c_str();

    ......



    Hiji 2013-01-15 19:26 鍙戣〃璇勮
    ]]>
    Activity.startActivityForResulthttp://www.tkk7.com/demibug/archive/2013/01/01/393686.htmlHijiHijiTue, 01 Jan 2013 15:14:00 GMThttp://www.tkk7.com/demibug/archive/2013/01/01/393686.htmlhttp://www.tkk7.com/demibug/comments/393686.htmlhttp://www.tkk7.com/demibug/archive/2013/01/01/393686.html#Feedback0http://www.tkk7.com/demibug/comments/commentRss/393686.htmlhttp://www.tkk7.com/demibug/services/trackbacks/393686.html闃呰鍏ㄦ枃

    Hiji 2013-01-01 23:14 鍙戣〃璇勮
    ]]>
    閬嶅巻hash maphttp://www.tkk7.com/demibug/archive/2013/01/01/393669.htmlHijiHijiMon, 31 Dec 2012 21:01:00 GMThttp://www.tkk7.com/demibug/archive/2013/01/01/393669.htmlhttp://www.tkk7.com/demibug/comments/393669.htmlhttp://www.tkk7.com/demibug/archive/2013/01/01/393669.html#Feedback0http://www.tkk7.com/demibug/comments/commentRss/393669.htmlhttp://www.tkk7.com/demibug/services/trackbacks/393669.html
    // 閬嶅巻hashmap Itterator< Map.Entry<K,V> >
                    Iterator<Map.Entry<String, String>> iter = wallLayer.properties.entrySet().iterator();
                    while (iter.hasNext()) {
                        Entry<String, String> entry = iter.next();
                        Gdx.app.log(entry.getKey().toString(), entry.getValue().toString());
                    }
                    for (int i = 0; i < wallLayer.tiles.length; i++) {
                        int arr2[] = wallLayer.tiles[i];
                        for (int j = 0; j < arr2.length; j ++)
                        Gdx.app.log("tiles[" + i + "][" + j + "]", Integer.toString(wallLayer.tiles[i][j]));
                    }


    Hiji 2013-01-01 05:01 鍙戣〃璇勮
    ]]>
    主站蜘蛛池模板: 中国china体内裑精亚洲日本| 男男gay做爽爽的视频免费| 日韩精品亚洲aⅴ在线影院| 亚洲熟妇无码一区二区三区| 国产va精品免费观看| 91亚洲精品视频| 免费看美女让人桶尿口| 亚洲黄色免费观看| 蜜臀91精品国产免费观看 | 亚洲av第一网站久章草| 成年女性特黄午夜视频免费看| 日韩免费高清一级毛片| 99re6免费视频| 欧美亚洲精品一区二区| 国产成人无码综合亚洲日韩 | 精品少妇人妻AV免费久久洗澡| 国产免费内射又粗又爽密桃视频 | 亚洲高清专区日韩精品| 午夜免费福利在线| 久爱免费观看在线网站| 美美女高清毛片视频黄的一免费 | MM131亚洲国产美女久久| 欧美在线看片A免费观看| 亚洲色偷偷色噜噜狠狠99| 亚洲日韩一页精品发布| 99国产精品免费观看视频| 免费人成视频在线观看免费| 亚洲成年人电影网站| 亚洲熟妇无码另类久久久| 免费观看a级毛片| 在线永久看片免费的视频| 亚洲AV无码专区国产乱码不卡| 亚洲国产美国国产综合一区二区| 亚洲国产综合人成综合网站| 国产一级a毛一级a看免费视频| 亚洲精品无码久久毛片波多野吉衣| 成人免费无码大片a毛片软件| 最好看的中文字幕2019免费| 亚洲成AV人片高潮喷水| 亚洲精品中文字幕无码AV| 国产亚洲一区二区三区在线观看|