开发者

need help in understanding CCMoveTo?

I have downloaded the sample demo and trying to understand it.but Stuck on following code

id actionMove = [CCMoveTo actionWithDuration:actualDuration position:ccp(-target.contentSize.width/2, actualY)];
id actionMoveDone = [CCCallFuncN actionWithTarget:self  selector:@selector(spriteMoveFinished:)];
[target runAction:[CCSequence actions:actionMove, actionMoveDone, nil]];

How CCMoveTo moves object from one location to another as thi开发者_开发百科s object moves from left to right.


How CCMoveTo moves object from one location to another as this object moves from left to right.

not like left to right?

If the object(sprites) anywhere and you are willing to moveto some position from current position

example

current sprite position

(100,100)

then if you use CCMoveTo with (200,200) then it will move to (200,200)

then if you use CCMoveBy with (200,200) then it will move to

currentposition+neededposition

so (100+200,100,200) which implies (300,300);

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜