每次需要的时候 都是查一下 粘贴过来 麻烦死了
能不能整合一下?
你看 as3的设计就很方便 只有一种参数
playButton.addEventListener(MouseEvent.CLICK, playMovie);
function playMovie(event:MouseEvent):void
{
this.play();
}
相信和我一样觉得麻烦不在少数吧!
每次需要的时候 都是查一下 粘贴过来 麻烦死了
能不能整合一下?
你看 as3的设计就很方便 只有一种参数
playButton.addEventListener(MouseEvent.CLICK, playMovie);
function playMovie(event:MouseEvent):void
{
this.play();
}
相信和我一样觉得麻烦不在少数吧!
团藏,3.0 推荐使用回调有以下几种,挑您熟悉的使用吧!
// in v3.0 (short version)
auto action1 = CallFunc::create( CC_CALLBACK_0(MyClass::callback_0,this));
auto action2 = CallFunc::create( CC_CALLBACK_0(MyClass::callback_1,this, additional_parameters));
// in v3.0 (long version)
auto action1 = CallFunc::create( std::bind( &MyClass::callback_0, this));
auto action2 = CallFunc::create( std::bind( &MyClass::callback_1, this, additional_parameters));
// in v3.0 you can also use lambdas or any other "Function" object
auto action1 = CallFunc::create(
&](){
auto s = Director::sharedDirector()->getWinSize();
auto label = LabelTTF::create("called:lambda callback", "Marker Felt", 16);
label->setPosition(ccp( s.width/4*1,s.height/2-40));
this->addChild(label);
} );
```
谢谢版主回复
我的意思是类似这种的
NotificationCenter::getInstance()->addObserver(this,
callfuncO_selector(Light::switchStateChanged), MSG_SWITCH_STATE, NULL);
void Light::switchStateChanged(Object* obj)
ControlButton* headButton = CommonTools::addButton(“90058.png”, this, cccontrol_selector(AddFriend::headClick) );
void AddFriend::xinClick(Object *pSender, Control::EventType event)
还有这个的
this->scheduleOnce( schedule_selector( GuestData::timeup ) , time - nowtime );
这就有三种要记的
以后引擎越来越大 要记的越来越多 个人觉得这个应该统一一下.
好的。团藏,你的意思是回调的宏太多了记不住。。。要对宏进行统一。
这里selector是根据功能区分。
至于统一这个我已记录。会给引擎组反馈过去做参考。
十分感谢 偶尔e网事 !