cocos2d / cocos2d-html5

Cocos2d for Web Browsers. Built using JavaScript.
https://www.cocos.com
3.07k stars 902 forks source link

Ability to get Frame of the animation #1050

Open pekayatt opened 11 years ago

pekayatt commented 11 years ago

To add method to get the actual frame of an animation. I will try to create a pull request for the changes I have made into my own lib, but is really easy to add a method getNextFrame() on the ActionInterval.js

minggo commented 11 years ago

@pekayatt What will be getNextFrame used?

pekayatt commented 11 years ago

I use it to get in which frame an animation is, and then trigger an action.

minggo commented 11 years ago

Ok, it seems it is needed. Let's add it.

minggo commented 11 years ago

Oh. Do you want to get current frame or next frame?

pekayatt commented 11 years ago

I am using the next frame, but either one of it will do the work.. On Aug 5, 2013 12:55 AM, "minggo" notifications@github.com wrote:

Oh. Do you want to get current frame or next frame?

— Reply to this email directly or view it on GitHubhttps://github.com/cocos2d/cocos2d-html5/issues/1050#issuecomment-22085953 .

minggo commented 11 years ago

So, i think adding getCurrentFrame seems more sensible.

pekayatt commented 11 years ago

I agreed! Just need to see if JSB will be working, since I had did an pull request with the getNextFrame for the Cocos2d-x.. On Aug 5, 2013 1:01 AM, "minggo" notifications@github.com wrote:

So, i think adding getCurrentFrame seems more sensible.

— Reply to this email directly or view it on GitHubhttps://github.com/cocos2d/cocos2d-html5/issues/1050#issuecomment-22086050 .

pandamicro commented 9 years ago

@minggo it seems we haven't added getCurrentFrame function in Animation, will we do it soon ?

minggo commented 9 years ago

Yep, it seems we forgot it. I have created an issue in cocos2d-x https://github.com/cocos2d/cocos2d-x/issues/10085.

pandamicro commented 9 years ago

Thanks, I added a task in JS repo too

WenhaiLin commented 9 years ago

Done: https://github.com/cocos2d/cocos2d-html5/pull/2981