Return to Cocos2dx Playback Library

Animation is not running in cocos2dx 3.8

Questions related to Cocos2dx playback library should be asked here.

Animation is not running in cocos2dx 3.8

Postby Gautam Kumar » May 16th, 2016, 4:13 am

Hi
I have a .gaf file converted from GAF converter. When I am using it in cocos2dx, the animation is not showing and size of the GAFObject is Size(0,0). Here is the code:
auto asset = GAFAsset::create("slot_machine/bonus candy.gaf", nullptr);
auto machine = asset->createObjectAndRun(true);
machine->setPosition(this->getContentSize()/2);
log("GAF-machine # x:%f, y:%f, W:%f, H:%f", machine->getPositionX(), machine->getPositionX(), machine->getContentSize().height, machine->getContentSize().width);
addChild(machine, 100);

And also I am attaching bonus candy.swf file.
Attachments

bonus candy.swf [ 33.65 KiB | Viewed 12912 times ]

User avatar
Gautam Kumar
 
Posts: 15
Joined: May 16th, 2016, 3:43 am

Re: Animation is not running in cocos2dx 3.8

Postby Dmitry Bushtets » May 16th, 2016, 6:36 am

Hmm, I need more info to reproduce this bug.
Now I have:
Code: Select all
GAF-machine # x:576.000000, y:576.000000, W:149.149994, H:148.649994


Which branch do you use?

P.S. And maybe you need to check
Code: Select all
object->setPosition(this->getContentSize()/2);
. getContentSize() can return (0,0)
User avatar
Dmitry Bushtets
 
Posts: 86
Joined: August 11th, 2014, 1:31 am

Re: Animation is not running in cocos2dx 3.8

Postby Gautam Kumar » May 17th, 2016, 7:30 am

I was using "Stale branches (gaf_4_develop_multiple_objects)". But after your reply I downloaded project form "Active branches (gaf_5_develop)". But I am not able to even build this one. The error that it is showing is "cocos2d.h" file not found. I have added the cocos2dx 3.8 Library to this project. Please help me how can I move ahead or if you have any fully working project link please give me. As earlier I got fully working slot machine project.
User avatar
Gautam Kumar
 
Posts: 15
Joined: May 16th, 2016, 3:43 am

Re: Animation is not running in cocos2dx 3.8

Postby Dmitry Bushtets » May 17th, 2016, 11:43 pm

Hi!
Error with "cocos2d.h" means that you need to check "Header Include paths"
Please note, that Gaf Lib should be in "external" folder of cocos.
User avatar
Dmitry Bushtets
 
Posts: 86
Joined: August 11th, 2014, 1:31 am

Re: Animation is not running in cocos2dx 3.8

Postby Gautam Kumar » May 18th, 2016, 3:48 am

Finally I am able to run the project with latest "GAF Library" and "Cocos2dx 3.8". But my initial problem is still there. I am really running out of ideas. So here I am giving you a dropbox url of entire project that i am trying to run. Please have a look and fix the issues. I shall highly be obliged to you.
https://www.dropbox.com/s/3yvhhgn717au4yu/TestG.zip?dl=0
User avatar
Gautam Kumar
 
Posts: 15
Joined: May 16th, 2016, 3:43 am

Re: Animation is not running in cocos2dx 3.8

Postby Dmitry Bushtets » May 18th, 2016, 6:24 am

You are not using "latest GAF library".
Please check GAF.h in your project ->
Code: Select all
#define GAF_VERSION 4.0

Please checkout this branch https://github.com/CatalystApps/Cocos2d ... _5_develop
User avatar
Dmitry Bushtets
 
Posts: 86
Joined: August 11th, 2014, 1:31 am

Re: Animation is not running in cocos2dx 3.8

Postby Gautam Kumar » May 18th, 2016, 11:22 pm

Thanks.. thanks a ton. Now every thing working fine.. :) :) :)
User avatar
Gautam Kumar
 
Posts: 15
Joined: May 16th, 2016, 3:43 am

Return to Cocos2dx Playback Library

Who is online

Users browsing this forum: No registered users and 1 guest