Home > other >  Get the elves rotation Angle cocos2dx
Get the elves rotation Angle cocos2dx

Time:09-25

I recently in learning cocosdx, encounter a problem,
My demand is to rotate, after the completion of the rotation, rotation Angle,

Program the following
Sprite * sp=Sprite: : create (" arrow2. PNG ");
Sp - & gt; SetPosition (300, 300);
AddChild (sp);
ActionInterval * rotateto=rotateto: : create (5-90);
Sp - & gt; RunAction (rotateto);
Float Angle=sp - & gt; GetRotation ();
The log (" jiao du shi % f ", Angle).

After running, elf finished rotation, already output logs, display Angle is 0.0000,

What is the reason? And if you want to realize my needs what method can be used to solve? Thank you
This program is an experiment, in my needs, rotation Angle is uncertain,

CodePudding user response:

Code logic problem,

CodePudding user response:

In the same frame for less than, of course,

CodePudding user response:

When you print is to create a point of view, want to get after turning point of view, and print must be get after turning Angle, Angle of rotation Angle and you can to get on CCSequence, gain perspective on CCCallfuncN inside the callback function; Of course you also can directly access by a timer
  • Related