Giter Club home page Giter Club logo

Comments (9)

SmartCat avatar SmartCat commented on September 28, 2024

Hello!
Could you please provide more info?
I've changed GafFeatures class in Examples to test this issue.
I stop and hide animation A on frame 200. On click I start animation B.
It seems that I missed some condition - no flickers.
https://drive.google.com/file/d/0ByYIXG-tjt6AdlZzdC1ER21GRDA/view?usp=sharing

from cocos2dxgafplayer.

blalc avatar blalc commented on September 28, 2024

Hi,

I've more than one animation in a single GAF file.

Scenario 1:
I play one animation in that file and stop it midway and hide it. Then I again play the same animation in the same GAF file and show it. The frame on which this animation was stopped is visible in a flicker before that animation starts fresh.

Scenario 2:
I play one animation in that file and stop it midway and hide it. Then I play another animation in the same GAF file and show it. The frame on which the first animation was stopped is visible in a flicker before the second animation starts fresh.

Modified GafFeatures Class in Examples
This is also reproducible with a GAF file with only one animation in it, like those in Examples. I've also changed GafFeatures class in Examples to better explain this issue. I stop and hide a running animation on pause button callback, and I start and show the same animation on play button callback. Note that for animations that do not move around the screen the issue is hard to notice unless watching very closely. But, if you go to the lion and cub animation included in Examples and press pause(which stops and hides the animation) button when the cub is away from lion, and then press play(which starts and shows the animation) you'll be able to see the frame on which the animation was stopped in a flicker before the lion and cub animation starts fresh.
Link to the modified GafFeatures class
https://drive.google.com/folderview?id=0B8XTo1j-Gqt2OGlEaDdZNHJDN28&usp=sharing

from cocos2dxgafplayer.

SmartCat avatar SmartCat commented on September 28, 2024

Hello, this was fixed in
61a0925

from cocos2dxgafplayer.

abdulwasay avatar abdulwasay commented on September 28, 2024

@SmartCat
This is still easily reproducible on the release-gaf-5 branch. I have looked at the code and the changes made in the commit mentioned above are still present. I think the code changes do not fix the issue.

Steps to reproduce.

  1. Replace the playpause function in GafFeatures.cpp with the following function
void GafFeatures::playpause(cocos2d::Ref*)
{
    if (!m_objects || !m_objects->count())
    {
        return;
    }

    GAFObject *object = (GAFObject *)m_objects->getObjectAtIndex(0);

    if (object->getIsAnimationRunning())
    {
        object->stop();
        object->setVisible(false);
    }
    else
    {
        object->start();
        object->setVisible(true);
    }
}
  1. Scroll to the peacock animation
  2. Let the peacock move to the left of the screen and open its feathers
  3. Press play / pause button
  4. Press play / pause button again
  5. Notice that there is a flicker of the peacock with open feathers before the animation begins from the original location

from cocos2dxgafplayer.

abdulwasay avatar abdulwasay commented on September 28, 2024

@SmartCat

object->setFrame(0); 

after stopping the animation solves the issue for me.

Maybe I misunderstood how stop and start is supposed to work?

from cocos2dxgafplayer.

SmartCat avatar SmartCat commented on September 28, 2024

Hi!
I've commit small fix for your issue.
Thank you

P.S. 3529e1b

from cocos2dxgafplayer.

abdulwasay avatar abdulwasay commented on September 28, 2024

@SmartCat
Thank You.
I found the same issue in the playSequence method in GAFObject.cpp

Perhaps changing the following line from

m_currentFrame = m_isReversed ? (e - 1) : (s);

to

m_currentFrame = m_isReversed ? (e - 1) : (s);
setFrame(m_currentFrame);

would fix this as well.

from cocos2dxgafplayer.

SmartCat avatar SmartCat commented on September 28, 2024

Fixed also,
Thanks

from cocos2dxgafplayer.

abdulwasay avatar abdulwasay commented on September 28, 2024

Thank You :)

from cocos2dxgafplayer.

Related Issues (13)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.