cc.Tween is great but

I installed the cocos creator 2.0.9 and try to use the tween library in typescript.

It looks like you forgot to add to the creator.d.ts file the cc.Tween constructor.
It should look like this:

constructor(target?: cc.Node);

Also, you for got to add a signature to target:

target(): void;

Should look like this:

target(target: cc.Node): void;

Please add them to the next release because without them we cannot compile the script,
and addd them manually is a little bit messy…

Keep up the good work!!!

Yes and there are a lot of other typings missing for it as well

I made a post on the pullrequest on git, but no response

1 Like
    var placeWallTween:cc.Tween = new cc.Tween()
    .target(this.node)
    .by(0.5, {scale: 0.5, position: cc.v2({x: posX})}, {progress: null, easing: 'easeOutQuad'})
    .start()

This code snippet works fine for me. Hope it helps

It helps a lot but this is not the issue :slight_smile:
The issue is that the creator.d.ts file does not support some of the functionalities.
I had to dig down into it and fix it on my own way.

2 Likes

This topic was automatically closed 24 hours after the last reply. New replies are no longer allowed.