CocosBuilder Animations not running

152 Views Asked by At

I'm creating a simple animation with CocosBuilder that just moves a CCLayerColor from top right to bottom left and for some reason the animations will not perform. I have the timeline set to auto play and over a duration of 2 seconds. I have a class that splits up all layers and then adds those layers to a CCScrollLayer. I'm just wondering if the problem is when i remove the layers from the scene and add then to the CCScrollLayer that the animations are removed and in turn not performed.

CCScene* scene = [CCBReader sceneWithNodeGraphFromFile:@"Untitled.ccbi"];

self.scrollLayer = [[CCScrollLayer alloc] init];
  CCLayer* child = [[scene children] objectAtIndex:0];
  for (CCNode* layer in [child children]) {

    [layer removeFromParent];
    [self.scrollLayer addChild:layer];
    [layer resumeSchedulerAndActions];
  }

  [self.scrollLayer updatePages];
  self.scrollLayer.delegate = self;
  [self addChild:self.scrollLayer];

I can see the CCLayerColor object added to the screen but its just not animating.

i've added some custom code to the CCScrollLayer to deal with the situation but i'm just confused as to why the animations are not performing. any help would be great!

EDIT: Maybe a better question would be in CocosBuilder are the actions on the timeline directly linked to the object performing the action or somehow linked through the scene to that object?

1

There are 1 best solutions below

1
On

Perhaps you forgot to add the scrollLayer as child?

[self addChild:self.scrollLayer];

In the sample code the node created from a ccbi is not referenced either. Maybe you aren't actually using it?