cocos2d-js icon indicating copy to clipboard operation
cocos2d-js copied to clipboard

Is cc.ActionInterval and similar must be extendable in JSB?

Open IgorMats opened this issue 9 years ago • 8 comments

Because they are missing in jsb config file.

IgorMats avatar Oct 29 '14 02:10 IgorMats

ActionInterval cannot be extended in jsb now. For the update function written in js will not be invoked in c++, unless you make your modification in C++.

zhaijialong avatar Oct 30 '14 02:10 zhaijialong

Is ActionInterval should be extendable? I can work with it.

IgorMats avatar Oct 30 '14 12:10 IgorMats

Hmm, I'm not sure. schedule can be an alternative in most cases. @pandamicro How about your opinion?

zhaijialong avatar Oct 30 '14 12:10 zhaijialong

Hi, @IgorMats, scheduled tasks is our suggest way to have customized actions. The thing is, if we make ActionInterval extendable, we should make other actions extendable also. But we can't add a bunch of script served code into update functions of all actions in Cocos2d-x for now. That's the main limit of JS Bindings and sorry for the inconvenience.

pandamicro avatar Oct 30 '14 15:10 pandamicro

If many people have this requirement, we should consider it. How about add a ExtendableActionInterval or some thing similar which is a subclass of cocos2d::ActionInterval written in C++, and can invoke js function. Bind it in JSB, so we can entend it in js.

zhaijialong avatar Oct 30 '14 15:10 zhaijialong

Good idea, that is an option, and we can save a lot of work with a macro, as all such extended actions should have almost same codes.

pandamicro avatar Oct 30 '14 15:10 pandamicro

@joshuastray Right! I also need dev some action in JS , but i can't extend cc.ActionInterval. @pandamicro Please! support it! Thank and thank you very munch!

dkthach avatar May 21 '15 05:05 dkthach

any update on this?

araker avatar Mar 15 '16 09:03 araker