0
我用Oxygine框架和whem我嘗試將事件偵聽器添加到一個精靈它給了我這個錯誤使用閉幕Oxygine C++事件監聽器錯誤
時,這是我
類#include "MainActor.h"
#include "Utils.h"
#include "Map.h"
#include "Hero.h"
#include "res.h"
#include <iostream>
using namespace oxygine;
spHero hero;
MainActor::MainActor(): _world(0) {
setSize(getStage()->getSize());
spMap map = new Map("map.xml", "Sprites.png");
addChild(map);
_world = new b2World(b2Vec2(0, 10));
hero = new Hero(100, 10, 0, 100,
res::resources.getResAnim("hero_idle_up"), _world, getSize()/2,
0.6);
addChild(hero);
map->addEventListener(TouchEvent::CLICK, CLOSURE(this,
&MainActor::Move));
}
void MainActor::Move(Event* ev) {
TouchEvent* tev = safeCast<TouchEvent*>(ev);
hero->addTween(TweenPosition(tev->localPosition), 1000);
}
,並在此線它給出如下因素誤差
map->addEventListener(TouchEvent::CLICK, CLOSURE(this, &MainActor::Move));
錯誤:沒有重載函數「細節:: CreateClosure」的實例相匹配的參數列表。