• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

C++ CLOSURE函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了C++中CLOSURE函数的典型用法代码示例。如果您正苦于以下问题:C++ CLOSURE函数的具体用法?C++ CLOSURE怎么用?C++ CLOSURE使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。



在下文中一共展示了CLOSURE函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。

示例1: initActor

GameScene::GameScene()
{
	//create game actor
	_game = new Game;
	_game->init();
	_game->attachTo(_view);

	//Game Actor would have own Clock.
	//clock is internal time of each Actor
	//by default own clock has only Stage
	//clock could be paused and all children of this Actor would be paused to
	_game->setClock(new Clock);

	//create menu button 
	spActor btn = initActor(new MyButton,
		arg_resAnim = res::ui.getResAnim("menu"),
		arg_anchor = Vector2(0.5f, 0.5f),
		arg_attachTo = _view);
	
	//align it to top right
	btn->setX(_view->getWidth() - btn->getWidth()/2);
	btn->setY(btn->getHeight()/2);

	//handle click to menu
	btn->addEventListener(TouchEvent::CLICK, CLOSURE(this, &GameScene::onEvent));

	//subscribe to Hidden Event from GameMenu
	GameMenu::instance->addEventListener(GameScene::HiddenEvent::EVENT, CLOSURE(this, &GameScene::onEvent));
}
开发者ID:luiseduardohdbackup,项目名称:oxygine-framework,代码行数:29,代码来源:GameScene.cpp


示例2: CLOSURE

 void DebugActor::onAdded2Stage()
 {
     _dragging = false;
     _stage->addEventListener(TouchEvent::MOVE, CLOSURE(this, &DebugActor::onDAEvent));
     _stage->addEventListener(TouchEvent::TOUCH_DOWN, CLOSURE(this, &DebugActor::onDAEvent));
     _stage->addEventListener(TouchEvent::TOUCH_UP, CLOSURE(this, &DebugActor::onDAEvent));
 }
开发者ID:Yahor10,项目名称:oxygine-framework,代码行数:7,代码来源:DebugActor.cpp


示例3: addEventListener

MyButton::MyButton()
{
    //pressed button should be RED
    addEventListener(TouchEvent::TOUCH_DOWN, CLOSURE(this, &MyButton::onEvent));
    addEventListener(TouchEvent::TOUCH_UP, CLOSURE(this, &MyButton::onEvent));
    addEventListener(TouchEvent::CLICK, CLOSURE(this, &MyButton::onEvent));
}
开发者ID:pixelpicosean,项目名称:lesser-panda-oxygine,代码行数:7,代码来源:MyButton.cpp


示例4: _getStage

    void DebugActor::showTouchedActor(bool show)
    {
        _getStage()->removeEventListener(TouchEvent::TOUCH_DOWN, CLOSURE(this, &DebugActor::onEvent));
        _showTouchedActor = show;
        if (show)
            _getStage()->addEventListener(TouchEvent::TOUCH_DOWN, CLOSURE(this, &DebugActor::onEvent));

        spActor btn = getChild("finger");
    }
开发者ID:pixelpicosean,项目名称:lesser-panda-oxygine,代码行数:9,代码来源:DebugActor.cpp


示例5: setTouchChildrenEnabled

MyButton::MyButton()
{
	setTouchChildrenEnabled(false);


    //pressed button should be RED
    addEventListener(TouchEvent::TOUCH_DOWN, CLOSURE(this, &MyButton::onEvent));
    addEventListener(TouchEvent::TOUCH_UP, CLOSURE(this, &MyButton::onEvent));
    addEventListener(TouchEvent::CLICK, CLOSURE(this, &MyButton::onEvent));
}
开发者ID:oxygine,项目名称:oxygine-game,代码行数:10,代码来源:MyButton.cpp


示例6: destroy

    void Draggable::init(Actor* actor)
    {
        destroy();

        _singleDrag = false;
        _actor = actor;
        _dragClient = actor;

        actor->addEventListener(TouchEvent::TOUCH_DOWN, CLOSURE(this, &Draggable::onEvent));
        actor->addEventListener(TouchEvent::TOUCH_UP, CLOSURE(this, &Draggable::onEvent));
    }
开发者ID:ivlevAstef,项目名称:PrototypeCarGame,代码行数:11,代码来源:Draggable.cpp


示例7: getRoot

	void DebugActor::showTouchedActor(bool show)
	{
		getRoot()->removeEventListener(TouchEvent::TOUCH_DOWN, CLOSURE(this, &DebugActor::onEvent));
		_showTouchedActor = show;
		if (show)
			getRoot()->addEventListener(TouchEvent::TOUCH_DOWN, CLOSURE(this, &DebugActor::onEvent));

		spActor btn = getChild("finger");
		btn->removeTweens(true);
		if (show)
			btn->addTween(Actor::TweenAlpha(0), 300, 999999, true);
	}
开发者ID:huangyt,项目名称:oxygine-framework,代码行数:12,代码来源:DebugActor.cpp


示例8: addRef

    void WebImage::load(const std::string& url)
    {
        _image->setResAnim(0);

        _http = HttpRequestTask::create();
        if (!_http)
            return;
        _http->setUrl(url);
        _http->run();

        addRef();//protect actor for delete
        _http->addEventListener(AsyncTask::COMPLETE, CLOSURE(this, &WebImage::loaded));
        _http->addEventListener(AsyncTask::ERROR, CLOSURE(this, &WebImage::error));
    }
开发者ID:Yahor10,项目名称:oxygine-framework,代码行数:14,代码来源:WebImage.cpp


示例9: _sliding

    SlidingActor::SlidingActor():
        _sliding(false),
        _rad(_defaultTouchThreshold),
        _maxSpeed(250),
        _downTime(0),
        _lastTime(0), _current(0), _lastIterTime(0)
    {
        _clip = new ClipRectActor;
        _clip->addEventListener(TouchEvent::TOUCH_DOWN, CLOSURE(this, &SlidingActor::_newEvent));
        _clip->addEventListener(TouchEvent::TOUCH_UP, CLOSURE(this, &SlidingActor::_newEvent));
        _clip->addEventListener(TouchEvent::MOVE, CLOSURE(this, &SlidingActor::_newEvent));

        addChild(_clip);
    }
开发者ID:HaoDongGuo,项目名称:oxygine-framework,代码行数:14,代码来源:SlidingActor.cpp


示例10: e2fd

value* e2fd(value* in)
{
  value a;
  CLOSURE ("e2fd");
  a = caml_callback(*closure, *in);
  return fcl_wrap(a);
}
开发者ID:xoolive,项目名称:facile,代码行数:7,代码来源:interface_c.c


示例11: fd2e

value* fd2e(value* in)
{
  value a;
  CLOSURE ("fd2e");
  a = caml_callback(*closure, *in);
  return fcl_wrap(a);
}
开发者ID:xoolive,项目名称:facile,代码行数:7,代码来源:interface_c.c


示例12: arith_mul

value* arith_mul(value* val1, value* val2)
{
  value a;
  CLOSURE("arith_mul");
  a = caml_callback2(*closure, *val1, *val2);
  return fcl_wrap(a);
}
开发者ID:xoolive,项目名称:facile,代码行数:7,代码来源:interface_c.c


示例13: swap

spTween Jewel::swap(const Vector2& pos)
{
    _swaping = true;
    spTween tween = _view->addTween(Actor::TweenPosition(pos), 500);
    tween->addDoneCallback(CLOSURE(this, &Jewel::swapped));
    return tween;
}
开发者ID:pixelpicosean,项目名称:lesser-panda-oxygine,代码行数:7,代码来源:Jewel.cpp


示例14: sorting_sort

value* sorting_sort(value* in)
{
  value a;
  CLOSURE ("Sorting.sort");
  a = caml_callback(*closure, *in);
  return fcl_wrap(a);
}
开发者ID:xoolive,项目名称:facile,代码行数:7,代码来源:interface_c.c


示例15: interval_ismember

value* interval_ismember(value* in, int inf, int sup)
{
  value a;
  CLOSURE ("Interval.is_member");
  a = caml_callback3(*closure, *in, Val_int(inf), Val_int(sup));
  return fcl_wrap(a);
}
开发者ID:xoolive,项目名称:facile,代码行数:7,代码来源:interface_c.c


示例16: val_interval

value* val_interval(int i, int j)
{
  value v;
  CLOSURE("Fd.interval");
  v = caml_callback2(*closure, Val_int(i), Val_int(j));
  return fcl_wrap(v);
}
开发者ID:xoolive,项目名称:facile,代码行数:7,代码来源:interface_c.c


示例17: cstr_and

value* cstr_and(value* in1, value* in2)
{
  value a;
  CLOSURE ("Cstr.and");
  a = caml_callback2(*closure, *in1, *in2);
  return fcl_wrap(a);
}
开发者ID:xoolive,项目名称:facile,代码行数:7,代码来源:interface_c.c


示例18: cstr_post

int cstr_post(value* in)
{
  value v;
  CLOSURE ("Cstr.post");
  v = caml_callback_exn(*closure, *in);
  return Is_exception_result(v);
}
开发者ID:xoolive,项目名称:facile,代码行数:7,代码来源:interface_c.c


示例19: cstr_ge

value* cstr_ge(value* in1, value* in2)
{
  value a;
  CLOSURE ("ge");
  a = caml_callback2(*closure, *in1, *in2);
  return fcl_wrap(a);
}
开发者ID:xoolive,项目名称:facile,代码行数:7,代码来源:interface_c.c


示例20: arith_abs

value* arith_abs(value* val1)
{
  value a;
  CLOSURE("arith_abs");
  a = caml_callback(*closure, *val1);
  return fcl_wrap(a);
}
开发者ID:xoolive,项目名称:facile,代码行数:7,代码来源:interface_c.c



注:本文中的CLOSURE函数示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C++ CLR函数代码示例发布时间:2022-05-30
下一篇:
C++ CLOG函数代码示例发布时间:2022-05-30
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap