Comments (9)
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.
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.
Hello, this was fixed in
61a0925
from cocos2dxgafplayer.
@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.
- 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);
}
}
- Scroll to the peacock animation
- Let the peacock move to the left of the screen and open its feathers
- Press play / pause button
- Press play / pause button again
- Notice that there is a flicker of the peacock with open feathers before the animation begins from the original location
from cocos2dxgafplayer.
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.
Hi!
I've commit small fix for your issue.
Thank you
P.S. 3529e1b
from cocos2dxgafplayer.
@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.
Fixed also,
Thanks
from cocos2dxgafplayer.
Thank You :)
from cocos2dxgafplayer.
Related Issues (13)
- build error HOT 1
- Example project throws compile errors HOT 2
- The `GAFAnimatedObject` gets rendered behind every other on-screen object
- CMake config lack c++11 flags HOT 2
- Moving the "GAFAnimatedObject" produces a flicker. HOT 3
- play audio in gafplayer
- get gaf file's reference files HOT 3
- Could not decode "Library/CMakeLists.txt" with "UTF-8"-encoding. Editing not possible.
- gotoAndStop(idx) and gotoAndPlay(idx) start frame '0' doesn't match Flash logic
- GL call increase endless HOT 4
- How to use GAF in Cocos Creator?
- Filter shader reloading after losing GL context HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from cocos2dxgafplayer.