??xml version="1.0" encoding="utf-8" standalone="yes"?>日韩大片b站免费观看直播,一本色道婷婷久久欧美,免费观看又污又黄在线观看国产http://www.aygfsteel.com/demibug/zh-cnTue, 17 Jun 2025 18:36:27 GMTTue, 17 Jun 2025 18:36:27 GMT60- PS 如何去除光晕的黑色背?/title>http://www.aygfsteel.com/demibug/archive/2013/03/20/396721.htmlHijiHijiWed, 20 Mar 2013 04:19:00 GMThttp://www.aygfsteel.com/demibug/archive/2013/03/20/396721.htmlhttp://www.aygfsteel.com/demibug/comments/396721.htmlhttp://www.aygfsteel.com/demibug/archive/2013/03/20/396721.html#Feedback1http://www.aygfsteel.com/demibug/comments/commentRss/396721.htmlhttp://www.aygfsteel.com/demibug/services/trackbacks/396721.html背景色是U黑的?
转到通道面板Q按住Ctrl+Shift键,依次点击U绿蓝三个通道Q得到光晕的选区。选中囑ֱQ按下Ctrl+J键,得到光晕囑ֱ。隐藏背景图层。此时的光晕包含有少量透明的黑底,因ؓ(f)背景是黑Ԍ当把透明的光晕图层放到别的图层上Ӟ合模式改?#8220;滤色”卛_辑ֈ屏蔽黑色背景的目的?br />或者用背景皮擦,但是效果不是很好?/pre>
]]> - cocos2d-x 2.0版本 自适应屏幕分L?/title>http://www.aygfsteel.com/demibug/archive/2013/03/13/396355.htmlHijiHijiTue, 12 Mar 2013 17:25:00 GMThttp://www.aygfsteel.com/demibug/archive/2013/03/13/396355.htmlhttp://www.aygfsteel.com/demibug/comments/396355.htmlhttp://www.aygfsteel.com/demibug/archive/2013/03/13/396355.html#Feedback0http://www.aygfsteel.com/demibug/comments/commentRss/396355.htmlhttp://www.aygfsteel.com/demibug/services/trackbacks/396355.html我用的版本是cocos2d-2.0-x-2.0.4Qcocos2dx-2.0版本对多分L率适配提供了很好的支持Q用v来比1.0版本要简单些Q?.0版本的适配可以参?a target="_blank" style="color: #950000; text-decoration: initial;">q篇博文?br />1. ?.0版本的适配首先需要了解下面这些知识?br />(1)适配{略
2.0版本提供了三U适配{略Q?br />kResolutionNoBorderQ?/span>出屏幕的部分会(x)被裁剪,两侧没有黑边Q铺满屏q,按图片原始比例显C,囄不变形?br />kResolutionShowAllQ?/span>整个游戏界面是可见的Q会(x)按原始比例进行羃放,囄不变形,但两侧可能会(x)留有黑边Q不铺满屏幕?br />kResolutionExactFitQ?/span>整个游戏界面是可见的Q图片可能会(x)q行拉或者压~处理,铺满屏幕Q图片会(x)变Ş?br />可以Ҏ(gu)自己的要求选择?br />(2)VisibleSize和VisibleOrigin
getVisibleSizeQ表C得视?可视区域)的大,如果DesignResolutionSize跟屏q尺怸样大Q则getVisibleSize{于getWinSize?br />getVisibleOriginQ表C可视区域的L(fng)坐标Q这在处理相对位|的时候非常有用,保节点在不同分辨率下的位置一致?br />(3)DesignResolutionSize
DesignResolutionSize是一个比较重要的概念Q其?.0版本的适配?.0版本原理差不多,都是按比例进行羃放。这个DesignResolutionSize表示设计Ҏ(gu)Q就是你的游戏完支持的分L率方案,一般根据图片资源的寸来定Q自适配时会(x)按照q个分L率计出~放因子。因此,q个g应该是动态的Q如果是横屏游戏则高度肯定是铺满屏幕的,宽度也要可能的铺满屏幕Q因此应该选择宽高比最大的作ؓ(f)设计分L率,下面的demo?x)给Z用方法?br />(4)讄相对位置
在游戏中使用相对位置讄坐标的好处是显而易见的Q这样就不需要ؓ(f)每个分L率都定义一套坐标了。首先得定义一些参考点Q引擎的TestCpp例子中就提供了一U方法,以屏q上可视区域?个点作ؓ(f)参考点Q相当于在该矩Ş内写一个米字,q?个点分别是:(x)左上、左、左下、下、右下、右、右上、上、中心?/p>2. 下面来实C个简单的demoQ首先创Z个win32工程Q这个就不详qC?br />(1)创徏一个AppMacros.h文gQ定义了一些宏Q源码如下:(x)
- #ifndef __APPMACROS_H__
- #define __APPMACROS_H__
-
- #include "cocos2d.h"
-
- typedef struct tagResource
- {
- cocos2d::CCSize size;
- char directory[100];
- }Resource;
-
- //可用的资源尺?nbsp;
- static Resource smallResource = { cocos2d::CCSizeMake(480, 320), "iphone" };
- static Resource mediumResource = { cocos2d::CCSizeMake(1024, 768), "ipad" };
- static Resource largeResource = { cocos2d::CCSizeMake(2048, 1536), "ipadhd" };
-
- //设计Ҏ(gu)
- static cocos2d::CCSize smallDesignResolutionSize = cocos2d::CCSizeMake(480.0f, 320.0f);
- static cocos2d::CCSize mediumDesignResolutionSize = cocos2d::CCSizeMake(1024.0f, 768.0f);
- static cocos2d::CCSize largeDesignResolutionSize = cocos2d::CCSizeMake(2048.0f, 1536.0f);
-
- //~放因子Q主要给文字标签使用
- #define SCALE_FACTOR (cocos2d::CCEGLView::sharedOpenGLView()->getDesignResolutionSize().width / smallResource.size.width)
-
- #endif
(2)接下来修改AppDelegate.cpp文g的applicationDidFinishLaunching函数Q添加以下代码:(x)- bool AppDelegate::applicationDidFinishLaunching()
- {
- // initialize director
- CCDirector *pDirector = CCDirector::sharedDirector();
- CCEGLView *pEGLView = CCEGLView::sharedOpenGLView();
- pDirector->setOpenGLView(pEGLView);
-
- CCSize frameSize = pEGLView->getFrameSize();
- float ratio = frameSize.width / frameSize.height;
- float ratio1 = largeDesignResolutionSize.width / largeDesignResolutionSize.height;
- float ratio2 = mediumDesignResolutionSize.width / mediumDesignResolutionSize.height;
- float ratio3 = smallDesignResolutionSize.width / smallDesignResolutionSize.height;
- float d1 = abs(ratio - ratio1);
- float d2 = abs(ratio - ratio2);
- float d3 = abs(ratio - ratio3);
- std::map<float, CCSize> designSize;
- designSize[d1] = largeDesignResolutionSize;
- designSize[d2] = mediumDesignResolutionSize;
- designSize[d3] = smallDesignResolutionSize;
- std::map<float, CCSize>::reverse_iterator iter = designSize.rbegin();
- //得到key最大的Q因此我q里是横屏,所以以高度为基准,Z保~放后宽度能全屏Q所以选取宽高比最大的计方?nbsp;
- CCSize designResolutionSize = iter->second;
-
- //pEGLView->setDesignResolutionSize(designResolutionSize.width, designResolutionSize.height, kResolutionNoBorder);
- pEGLView->setDesignResolutionSize(designResolutionSize.width, designResolutionSize.height, kResolutionShowAll);
- //pEGLView->setDesignResolutionSize(designResolutionSize.width, designResolutionSize.height, kResolutionExactFit);
-
- if (frameSize.height > mediumResource.size.height)
- {
- CCFileUtils::sharedFileUtils()->setResourceDirectory(largeResource.directory);
- pDirector->setContentScaleFactor(largeResource.size.height/designResolutionSize.height);
- }
- else if (frameSize.height > smallResource.size.height)
- {
- CCFileUtils::sharedFileUtils()->setResourceDirectory(mediumResource.directory);
- pDirector->setContentScaleFactor(mediumResource.size.height/designResolutionSize.height);
- }
- else
- {
- CCFileUtils::sharedFileUtils()->setResourceDirectory(smallResource.directory);
- pDirector->setContentScaleFactor(smallResource.size.height/designResolutionSize.height);
- }
-
- pDirector->setDisplayStats(true);
-
- pDirector->setAnimationInterval(1.0 / 60);
-
- CCScene *pScene = HelloWorld::scene();
-
- pDirector->runWithScene(pScene);
-
- return true;
- }
(3)创徏VisibleRect.h和VisibleRect.cpp文gQ封装了获取?个点坐标的函敎ͼ比较单。代码如下:(x)
VisibleRect.h- #ifndef __VISIBLERECT_H__
- #define __VISIBLERECT_H__
-
- #include "cocos2d.h"
- USING_NS_CC;
-
- class VisibleRect
- {
- public:
- static CCRect getVisibleRect();
-
- static CCPoint left();
- static CCPoint right();
- static CCPoint top();
- static CCPoint bottom();
- static CCPoint center();
- static CCPoint leftTop();
- static CCPoint rightTop();
- static CCPoint leftBottom();
- static CCPoint rightBottom();
- private:
- static void lazyInit();
- static CCRect s_visibleRect;
- };
-
- #endif
VisibleRect.cpp
- #include "VisibleRect.h"
-
- CCRect VisibleRect::s_visibleRect;
-
- void VisibleRect::lazyInit()
- {
- if (s_visibleRect.size.width == 0.0f && s_visibleRect.size.height == 0.0f)
- {
- CCEGLView* pEGLView = CCEGLView::sharedOpenGLView();
- s_visibleRect.origin = pEGLView->getVisibleOrigin();
- s_visibleRect.size = pEGLView->getVisibleSize();
- }
- }
-
- CCRect VisibleRect::getVisibleRect()
- {
- lazyInit();
- return CCRectMake(s_visibleRect.origin.x, s_visibleRect.origin.y, s_visibleRect.size.width, s_visibleRect.size.height);
- }
-
- CCPoint VisibleRect::left()
- {
- lazyInit();
- return ccp(s_visibleRect.origin.x, s_visibleRect.origin.y + s_visibleRect.size.height/2);
- }
-
- CCPoint VisibleRect::right()
- {
- lazyInit();
- return ccp(s_visibleRect.origin.x+s_visibleRect.size.width, s_visibleRect.origin.y + s_visibleRect.size.height/2);
- }
-
- CCPoint VisibleRect::top()
- {
- lazyInit();
- return ccp(s_visibleRect.origin.x + s_visibleRect.size.width/2, s_visibleRect.origin.y + s_visibleRect.size.height);
- }
-
- CCPoint VisibleRect::bottom()
- {
- lazyInit();
- return ccp(s_visibleRect.origin.x + s_visibleRect.size.width/2, s_visibleRect.origin.y);
- }
-
- CCPoint VisibleRect::center()
- {
- lazyInit();
- return ccp(s_visibleRect.origin.x + s_visibleRect.size.width/2, s_visibleRect.origin.y + s_visibleRect.size.height/2);
- }
-
- CCPoint VisibleRect::leftTop()
- {
- lazyInit();
- return ccp(s_visibleRect.origin.x, s_visibleRect.origin.y + s_visibleRect.size.height);
- }
-
- CCPoint VisibleRect::rightTop()
- {
- lazyInit();
- return ccp(s_visibleRect.origin.x + s_visibleRect.size.width, s_visibleRect.origin.y + s_visibleRect.size.height);
- }
-
- CCPoint VisibleRect::leftBottom()
- {
- lazyInit();
- return s_visibleRect.origin;
- }
-
- CCPoint VisibleRect::rightBottom()
- {
- lazyInit();
- return ccp(s_visibleRect.origin.x + s_visibleRect.size.width, s_visibleRect.origin.y);
- }
(4)修改HelloWorldScene.cpp的init函数Q用相对位|设|坐标?/span>- bool HelloWorld::init()
- {
- if ( !CCLayer::init() )
- {
- return false;
- }
- CCMenuItemImage *pCloseItem = CCMenuItemImage::create(
- "CloseNormal.png",
- "CloseSelected.png",
- this,
- menu_selector(HelloWorld::menuCloseCallback));
-
- pCloseItem->setPosition(ccpAdd(VisibleRect::rightBottom(),
- ccp(-pCloseItem->getContentSize().width/2, pCloseItem->getContentSize().height/2)));
-
- CCMenu* pMenu = CCMenu::create(pCloseItem, NULL);
- pMenu->setPosition(CCPointZero);
- this->addChild(pMenu, 1);
-
- CCLabelTTF* pLabel = CCLabelTTF::create("Hello World", "Arial", SCALE_FACTOR * 24);
- pLabel->setPosition(ccpAdd(VisibleRect::top(),
- ccp(0, -pLabel->getContentSize().height)));
- this->addChild(pLabel, 1);
-
- CCSprite* pSprite = CCSprite::create("HelloWorld.png");
- pSprite->setPosition(VisibleRect::center());
- this->addChild(pSprite, 0);
-
- CCSprite *pLogoSprite = CCSprite::create("icon.png");
- pLogoSprite->setAnchorPoint( ccp(0, 0.5) );
- pLogoSprite->setPosition(ccpAdd(VisibleRect::left(), ccp(50, 0)));
- this->addChild(pLogoSprite, 0);
-
- return true;
- }
(5)创徏H口Qmain.cpp的主要内容:(x)- AppDelegate app;
- CCEGLView* eglView = CCEGLView::sharedOpenGLView();
- //eglView->setFrameSize(2048, 1536);
- //eglView->setFrameSize(480, 320);
- //eglView->setFrameSize(800, 480);
- //eglView->setFrameSize(1024, 768);
- //eglView->setFrameSize(1280, 800);
- eglView->setFrameSize(1280, 768);
- //eglView->setFrameSize(960, 640);
- eglView->setFrameZoomFactor(0.5f);
-
- int ret = CCApplication::sharedApplication()->run();
OKQ到此ؓ(f)止,代码部分已经完成了,下面看看在各U分辨率和不同策略下的效果图Q?/span>
1. kResolutionShowAll{略Q?/span>
(1)2048×1536
(2)1024×768

(3)480×320

2. kResolutionExactFit{略
1280×768分L?/span>
3. kResolutionNoBorder{略
1280×768分L?br />

demo源码Qhttp://download.csdn.net/detail/zhoujianghai/4847206
本文链接Qhttp://codingnow.cn/cocos2d-x/975.html

]]> - 深入了解CCSpritehttp://www.aygfsteel.com/demibug/archive/2013/03/11/396277.htmlHijiHijiMon, 11 Mar 2013 03:05:00 GMThttp://www.aygfsteel.com/demibug/archive/2013/03/11/396277.htmlhttp://www.aygfsteel.com/demibug/comments/396277.htmlhttp://www.aygfsteel.com/demibug/archive/2013/03/11/396277.html#Feedback0http://www.aygfsteel.com/demibug/comments/commentRss/396277.htmlhttp://www.aygfsteel.com/demibug/services/trackbacks/396277.html阅读全文

]]> - CCsprite学习(fn)W记http://www.aygfsteel.com/demibug/archive/2013/03/11/396276.htmlHijiHijiMon, 11 Mar 2013 03:04:00 GMThttp://www.aygfsteel.com/demibug/archive/2013/03/11/396276.htmlhttp://www.aygfsteel.com/demibug/comments/396276.htmlhttp://www.aygfsteel.com/demibug/archive/2013/03/11/396276.html#Feedback0http://www.aygfsteel.com/demibug/comments/commentRss/396276.htmlhttp://www.aygfsteel.com/demibug/services/trackbacks/396276.html_是游戏中十分重要的组成部分,随处可见Q如Q游戏背景、NPC、h物、道L(fng)。在cocos2d-x引擎中,只要是用囄展示的,基本上需要用精늱?br />1. 首先来了解一下跟_相关的几个类Q?/strong>
(1) CCTexture2D
可以把它看成一个纹理,它是cocos2d-x渲染囑Ş的重要参敎ͼ用来贴图Q因为cocos2d-x使用opengl esl制2d囑Ş的,它的寸?的nơ方。一般通过以下方式获得Q?/p>1 | CCTexture2D* cache = CCTextureCache::sharedTextureCache()->addImage( "hero.png" );
|
(2) CCSprite
q个是_c,是CCNode的子c,它的内部装了CCTexture2D(U理)Q可以通过下面几种方式初始化精灵对象?/p>
1 2 3 4 5 6 7 8 9 10 11 12 | //CCTexture2D表示_包含的图片,范围是整张图?/code>
static CCSprite* spriteWithTexture(CCTexture2D *pTexture);
//CCRect表示囄的指定范_(d)即从囄的指定矩形区域裁?/code>
static CCSprite* spriteWithTexture(CCTexture2D *pTexture, const CCRect& rect);
//CCSpriteFrame表示_的某一帧,大多数情况下_本n的图片有多。它内部装了CCTexture2D和CCRectQ可以从一个大囄取出一部分作ؓ(f)一帧?/code>
static CCSprite* spriteWithSpriteFrame(CCSpriteFrame *pSpriteFrame);
//pszSpriteFrameName表示帧的名字Q根据名从内存中取出CCSpriteFrame
static
|

]]> - 关于C++cL员函数的重蝲、覆盖、隐藏与virtual关键?/title>http://www.aygfsteel.com/demibug/archive/2013/03/10/396260.htmlHijiHijiSun, 10 Mar 2013 12:06:00 GMThttp://www.aygfsteel.com/demibug/archive/2013/03/10/396260.htmlhttp://www.aygfsteel.com/demibug/comments/396260.htmlhttp://www.aygfsteel.com/demibug/archive/2013/03/10/396260.html#Feedback0http://www.aygfsteel.com/demibug/comments/commentRss/396260.htmlhttp://www.aygfsteel.com/demibug/services/trackbacks/396260.html最q看<<高质量C++>>时读到的关于成员函数的重?覆盖/隐藏,把我的一点理解写出来,希望大家批评与指?
1. 重蝲、覆盖与隐藏
1)Q重载:(x)成员函数h以下的特征时发生“重蝲”
AQ相同的范围Q同一个类中)
BQ函数的名字相同
CQ参数类型不同(不能q行隐式cd转换Q?/span>
DQ?/span>Virtual关键字可有可?/span>
2)Q覆盖(也叫“l承”Q:(x)指派生类函数覆盖基类函数Q特征是Q?/span>
AQ不同的范围Q分别位于基cMzcMQ?/span>
BQ函数名字相?/span>
CQ参数相?/span>
DQ基cd数必Lvirtual关键?/span>
3)Q隐藏:(x)是指zcȝ函数屏蔽了与其同名的基类函数Q规则如下:(x)
AQ如果派生类的函C基类的函数同名,但是参数不同Q此时不论有?/span>virtual关键字,基类的函数都被隐藏Q注意别与重载淆)
BQ如果派生类的函C基类的函数同名,q且参数也相同,但是基类函数没有virtual关键字,此时基类的函数被隐藏Q注意别与覆盖淆)
2Q看下面q个例子代码Q?/span>
1 #include <iostream>
2 using std::cout;
3 using std::endl;
4
5 class Base
6 {
7 public:
8 virtual void f(float x){ cout << "Base::f(float) " << x << endl;}
9 void g(float x){ std::cout << "Base::g(float) " << x << std::endl;}
10 void h(float x){ std::cout << "Base::h(float) " << x <<std::endl;}
11 };
12
13 class Derived : public Base
14 {
15 public:
16 virtual void f(float x){ std::cout << "Derived::f(float) " << x << std::endl;}
17 void g(int x){ std::cout << "Derived::g(int) " << x << std::endl;}
18 void h(float x){ std::cout << "Derived::h(float) " << x << std::endl;}
19 };
20
21 void main(void)
22 {
23 Derived d;
24 Base *pb = &d;
25 Derived *pd = &d;
26
27 pb->f(3.14f);//Derived::f(float) 3.14
28 pd->f(3.14f);//Derived::f(float) 3.14
29
30 pb->g(3.14f);//Base::g(float) 3.14
31 pd->g(3.14f);//Derived::g(int) 3
32
33 pb->h(3.14f);//Base:h(float) 3.14
34 pd->h(3.14f);//Derived::h(float) 3.14
35 }
3. 解释
?/span>27?/span>28行,zcȝDerived::f(float x)通过virtual关键字承(覆盖Q了基类?/span>Base::f(float x)Ҏ(gu)Q所以这里无论采有基cL针还是派生类指针Q最后调用的其实都是Derived::f(float x)Ҏ(gu)。这正是一般情冉|们所期望的?/span>
?/span>30行,׃基类?/span>Base::g()没有?/span>virtual关键字声明,所以这里它不会(x)被派生类?/span>Derived::g()Ҏ(gu)覆盖。所以通过基类指针讉K时只能访问到Base::g(float x)Q而在31行通过zcL针时可以讉K的方法有Base::g(float x)?/span>Derived::g(int x)Q这两个Ҏ(gu)虽然Ҏ(gu)名相同而且参数不同Q似乎)W合重蝲的标准,但是它们却分属于不同?#8220;?#8221;因此重蝲不会(x)发生Q这?/span>Derived::g(int x)只能把Base::g(float x)“隐藏”掉?/span>
同上Q在W?/span>33行通过基类指针能访问的Ҏ(gu)只有Base::h(float x)Q由于该Ҏ(gu)没有?/span>virtual关键字声明,所以不?x)被zcL?/span>Derived::h(float x)“替换”Q因此调用的?/span>Base::h(float x)。而在W?/span>34行通过zcL针可以访问的Ҏ(gu)同时?/span>Base::h(float x)?/span>Derived::h(float x)Q这g又冲H,而这?/span>C++?#8220;隐藏”规则发生作用Q所以派生类Ҏ(gu)Derived::h(float x)把基cL?/span>Base::h(float x)“隐藏”Q于?/span>Derived::h(float x)被调用?/span>
4Qȝ
C++?#8220;重蝲”?#8220;l承”?#8220;隐藏”机制比一般想象中的要复杂Q而这q显了virtual关键字的重要性。所以在zcd在的前提下一Q一定要把基cM可能在派生类中也实现的方法用virtual关键字声明。除非在Ҏ(gu)情况下,比如需要检查指针类型的时候?/span>
1 #include <iostream>
2 using std::cout;
3 using std::endl;
4
5 class Base
6 {
7 public:
8 void CheckType(void){ cout << "This's Base Ptr" << endl;}
9 };
10
11 class Derived : public Base
12 {
13 public:
14 void CheckType(void){ cout << "This;s Derived Ptr" << endl;}
15 };
16
17 void main(void)
18 {
19 Derived d;
20 Base *pb = &d;
21 Derived *pd = &d;
22
23 pb->CheckType();//This's Base Ptr
24 pd->CheckType();//This's Derived Ptr
25 }
26

]]> - Cocos2dx使用 TexturePacker导出?plisthttp://www.aygfsteel.com/demibug/archive/2013/03/10/396256.htmlHijiHijiSun, 10 Mar 2013 08:38:00 GMThttp://www.aygfsteel.com/demibug/archive/2013/03/10/396256.htmlhttp://www.aygfsteel.com/demibug/comments/396256.htmlhttp://www.aygfsteel.com/demibug/archive/2013/03/10/396256.html#Feedback0http://www.aygfsteel.com/demibug/comments/commentRss/396256.htmlhttp://www.aygfsteel.com/demibug/services/trackbacks/396256.htmlCCSpriteFrameCache* 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);

]]> - cocos2d中CCCallFunc、CCCallFuncN和CCCallFuncND的区?/title>http://www.aygfsteel.com/demibug/archive/2013/02/26/395756.htmlHijiHijiTue, 26 Feb 2013 07:36:00 GMThttp://www.aygfsteel.com/demibug/archive/2013/02/26/395756.htmlhttp://www.aygfsteel.com/demibug/comments/395756.htmlhttp://www.aygfsteel.com/demibug/archive/2013/02/26/395756.html#Feedback0http://www.aygfsteel.com/demibug/comments/commentRss/395756.htmlhttp://www.aygfsteel.com/demibug/services/trackbacks/395756.htmlcocos2d中有3U回调方式:(x)CCCallFunc、CCCallFuncN和CCCallFuncND
其中Q他们有什么区别呢Q?/p>
q里我稍微ȝ下,不对的欢q讨论和拍砖Q?/p>
看源代码的excuteҎ(gu)Q我ȝ下面3点:(x)
1. CCCallFunc
- -(void) execute
- {
- [targetCallback performSelector:selector];
- }
CCCallFunc是执行对应的回调Ҏ(gu)Q其中回调方法不可带参数?/p>
2. CCCallFuncN
- -(void) execute
- {
- [targetCallback performSelector:selector withObject:target];
- }
CCCallFuncN多带一个参敎ͼ而参数本w是动作Aciton本n。就像UIButton那样Q我们可以@selector(btnUpInside:)Q带的参数就是UIButton本n?/p>
3. CCCallFuncND
- -(void) execute
- {
- [invocation_ setArgument:&target atIndex:2];
- [invocation_ setArgument:&data atIndex:3];
- [invocation_ invoke];
- }
CCCallFuncND?个参敎ͼ一个是动作Action本nQ一个是你自己定义的回调函数的参数?/span>
]]>- Cocos2dx 中文支持http://www.aygfsteel.com/demibug/archive/2013/01/15/394268.htmlHijiHijiTue, 15 Jan 2013 11:26:00 GMThttp://www.aygfsteel.com/demibug/archive/2013/01/15/394268.htmlhttp://www.aygfsteel.com/demibug/comments/394268.htmlhttp://www.aygfsteel.com/demibug/archive/2013/01/15/394268.html#Feedback1http://www.aygfsteel.com/demibug/comments/commentRss/394268.htmlhttp://www.aygfsteel.com/demibug/services/trackbacks/394268.html
需要的字符串保存于 strings.xml文g中:(x)
<?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>是男人就坚持20U?/span></string>
<key>new_game</key>
<string>新游?/span></string>
<key>setting_game</key>
<string>讄</string>
<key>quit_game</key>
<string>退?/span></string>
</dict>
</plist>
然后在代码中dQ?/span>CCDictionary *strings = CCDictionary::createWithContentsOfFile("fonts/strings.xml");
const char *titleStr = (CCString*)strings->objectForKey("title")->m_sString.c_str();
......

]]> - Activity.startActivityForResulthttp://www.aygfsteel.com/demibug/archive/2013/01/01/393686.htmlHijiHijiTue, 01 Jan 2013 15:14:00 GMThttp://www.aygfsteel.com/demibug/archive/2013/01/01/393686.htmlhttp://www.aygfsteel.com/demibug/comments/393686.htmlhttp://www.aygfsteel.com/demibug/archive/2013/01/01/393686.html#Feedback0http://www.aygfsteel.com/demibug/comments/commentRss/393686.htmlhttp://www.aygfsteel.com/demibug/services/trackbacks/393686.html阅读全文

]]> - 遍历hash maphttp://www.aygfsteel.com/demibug/archive/2013/01/01/393669.htmlHijiHijiMon, 31 Dec 2012 21:01:00 GMThttp://www.aygfsteel.com/demibug/archive/2013/01/01/393669.htmlhttp://www.aygfsteel.com/demibug/comments/393669.htmlhttp://www.aygfsteel.com/demibug/archive/2013/01/01/393669.html#Feedback0http://www.aygfsteel.com/demibug/comments/commentRss/393669.htmlhttp://www.aygfsteel.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]));
}

]]>
վ֩ģ壺
찲|
߰|
ǹ|
|
|
|
|
|
|
ʡ|
|
Ҷ|
|
|
|
ɽ|
ά|
Ϫ|
|
ͷ|
³ľ|
ˮ|
Ϋ|
º|
|
|
|
|
|
|
|
|
|
Դ|
ˮ|
|
Ұ|
ֶ|
|
ǹ|
ƺ|