I’m quite new to this and I’ve been struggling with this for days. I’ve been looking for tutorials and I’ve tried batchnodes with no luck.
I’m currently thinkin in use a tick function to update the frames manually but I think it must be a better way.
Code Sample:
class MyActionManager : ActionManager{
public:
void step(float delta);
};
MyActionManager *manager = new MyActionManager
Sprite *node1 = Sprite::create("");
Sprite *node2 = Sprite::create("");
// Setting the Custom ActionManager
node1->setActionManager(manager);
node2->setActionManager(manager);
// Step the animation
manager->step(0.1f); // your own tick function; the delta value meant something, need to input carefully!
I’m not quite sure about this, but this should be the JS version of Ken’s code:
var MyActionManager = cc.ActionManager.extend({
step(delta){
this._super();
}
});
//...
var manager = new MyActionManager();
var node1 = cc.Sprite.create("");
var node2 = cc.Sprite.create("");
// Setting the Custom ActionManager
node1.setActionManager(manager);
node2.setActionManager(manager);
// Step the animation
manager.step(0.1); // your own tick function; the delta value meant something, need to input carefully!