Giter Site home page Giter Site logo

Comments (8)

Stephane-D avatar Stephane-D commented on July 21, 2024 3

Basically yeah as it stays on the last frame but I completely understand the problem with that.. I will make a change to let the frameChangeCallback still happen on animationDone change state:-)

from sgdk.

Stephane-D avatar Stephane-D commented on July 21, 2024 2

Just added SPR_setAnimationLoop(..) method to disable auto animation loop.
So using that with SPR_getAnimationDone(..) is enough to get the sprite properly handled when animation is done avoiding potential first frame display glitch

from sgdk.

Stephane-D avatar Stephane-D commented on July 21, 2024 1

having getAnimationDone() returning TRUE earlier would prevent the full animation to happen (1 missing frame tick).
What miss now is just a way to disable the automatic animation looping so we don't have this issue.
Having a isLastAnimationFrame() method could be helpful but i rather prefer a no loop option :)

from sgdk.

RodrigoMedeirosRS avatar RodrigoMedeirosRS commented on July 21, 2024 1

Man you are amazing! I rebuild my MARSDEV poiting to SGDK master, and use the new SPR_setAnimationLoop method to disable the loop, now everthing is running perfectly with the SPR_getAnimationDone! Thank you so much!

from sgdk.

RodrigoMedeirosRS avatar RodrigoMedeirosRS commented on July 21, 2024

The problem is that the function is not returning when the animation done, but rather when it restarts, which causes flickering.

Notice in the video when I use the function, the animation is displayed in full, and the change only occurs after the first frame is repeated.

The problem is that you are not identifying the end of the animation but its beginning.

from sgdk.

RodrigoMedeirosRS avatar RodrigoMedeirosRS commented on July 21, 2024

Thanks for the tip! Everthing is running fine now :)

from sgdk.

D0NM avatar D0NM commented on July 21, 2024

I checked the source,
so, now, when the animation with DISABLED LOOPING is done,
you do not trigger any callback on the frame change.
Am I right?

from sgdk.

Stephane-D avatar Stephane-D commented on July 21, 2024

I checked the source, so, now, when the animation with DISABLED LOOPING is done, you do not trigger any callback on the frame change. Am I right?

I modified the code so you will receive a last frame change call on animation end even when animation loop is disabled, necessary to get the ANIMATION_DONE state in the callback even if the frame didn't really changed.

from sgdk.

Related Issues (20)

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.