I'd like to do an animation of the type of runAction introduced.

Asked 2 years ago, Updated 2 years ago, 72 views

I'm a beginner in the program.

There is something like the type of runAction that is introduced on this site. http://brbranch.jp/blog/201309/cocos2d-x/cocos2d-x_animation2/

I was introduced above in Sprite, a game I made myself. I'd like to add an animation called "Extend the Ripples". When I wrote the program on Cocos2d-x (Ver3.3), I couldn't see it working.

がCCRipple 3D などは seems to have been prepared in advance for Cocos2d-x. Do I have to prepare a header file separately? Is it necessary to do something special?Please let me know.

cocos2d-x

2022-09-29 22:19

1 Answers

I am also studying programming.

This seemed to work up to the Cocos2d-x v2 series, but
From v3, the Ripple 3D action must be NodeGrid.
Below is the code that we have verified that it actually works.

//Create sprite
Sprite*fish=Sprite::create("orangeFish.png");
fish->setPosition (Vec2 (320,568));

// rippling animation creation
Ripple 3D* action = Ripple 3D::create (6, cocos2d::Size (150,150), Vec2 (640/2, 1136/2), 500, 7,100);

// NodeGrid creation
NodeGrid*nodeGrid=NodeGrid::create();
nodeGrid->addChild(fish);
nodeGrid->runAction(action);

This ->addChild(nodeGrid);

Ripple 3D Animation


2022-09-29 22:19

If you have any answers or tips


© 2024 OneMinuteCode. All rights reserved.