【问题标题】:Increase the width of a sprite through an animation通过动画增加精灵的宽度
【发布时间】:2011-04-04 07:58:00
【问题描述】:

我想知道如何通过动画增加精灵的宽度。

    CCSprite *waterImage = [CCSprite spriteWithFile:@"water.png"];
waterImage.position = ccp(10,20);
waterImage.scaleY = 1.0;//6.5;
[self addChild:waterImage];

我想通过动画在 Y 轴上缩放精灵的图像。请,如果您有任何教程,请与我分享。

【问题讨论】:

    标签: iphone cocos2d-iphone sprite


    【解决方案1】:

    您可以像这样使用 runAction 为图像的缩放设置动画,

    [waterImage runAction:[CCScaleTo actionWithDuration:5 scaleX:6.5 scaleY:1]];
    

    提供 "scaleY:1" 以便图像仅在 x 轴上缩放。

    希望对你有帮助

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2013-08-13
      • 2011-12-01
      • 2014-06-25
      • 1970-01-01
      相关资源
      最近更新 更多