0

I'm applying an impulse to a sprite and I currently have an arrow behind the sprite to show which direction the sprite will be shot. But what I want to do is scale the arrow on its x axis to show the power of the impulse. How would I do this? I know how to scale on the x axis but how would I relate this to the touch, to do the impulse in using cgpoint in touchbegan and touchmoved. I want to do this OR show a guide line that will show the path the sprite will travel when the touch has ended. Thanks I'm using spacemanager for the physics.

4

1 回答 1

0

我设法缩放要触摸的箭头,我只是得到了触摸之间的距离,使其更小并限制了缩放。这是我的代码

arrow.scaleX = ccpDistance(birdPosition, pt1)/50;
    if (arrow.scaleX > 1.0) {
        arrow.scaleX = 1.0;
    }

如果有人知道指南,我仍然喜欢看到并比较两者。谢谢

于 2012-11-28T11:45:52.577 回答