Return to Cocos2dx Playback Library

how to change pictures in the animation

Questions related to Cocos2dx playback library should be asked here.

how to change pictures in the animation

Postby hedewei2015 » May 3rd, 2016, 8:23 am

I hope to replace a picture in GAF animation.
If possible, How to implement in the code? :D
User avatar
hedewei2015
 
Posts: 1
Joined: May 3rd, 2016, 8:15 am

Re: how to change pictures in the animation

Postby Dmitry Bushtets » May 5th, 2016, 6:01 am

Hi!

You can do this in different ways.
  1. You can create different images in one MovieClip timeline. Provide linkage name to this MovieClip and
    Code: Select all
    auto subobject = gafObject->getObjectByName("linkage_name");
    subobject->gotoAndStop(frame); // or subobject->playSequence("named_sequence");

  2. You can create empty MovieClip with linkage name. Then
    Code: Select all
    auto subobject = gafObject->getObjectByName("linkage_name");
    subobject->addChild(cocos_node); // here you can add any cocos node

If these methods didin't help you, please describe you problem more precisely. Maybe we bring you some more ideas ;)
User avatar
Dmitry Bushtets
 
Posts: 86
Joined: August 11th, 2014, 1:31 am

Return to Cocos2dx Playback Library

Who is online

Users browsing this forum: No registered users and 1 guest