开发者

How to draw Ropes using cocos2d texture programming

开发者 https://www.devze.com 2023-04-09 08:58 出处:网络
I am new to cocos2d framework but I have good experience in iPhone application programming. We can draw lines between 2 points using ccDrawLine command. What I need to do is draw a Rope which connects

I am new to cocos2d framework but I have good experience in iPhone application programming. We can draw lines between 2 points using ccDrawLine command. What I need to do is draw a Rope which connects the two points similar to ccDrawLine

The rope is straight. I have a png of the rope image which is horizontal.

What I thought was using Open GL Texture to create a Texture which has the above mentioned image and then drawing line with the same. But I donno wher开发者_StackOverflow社区e to start and how to proceed. Please Help


Check out this tutorial in Cocos2d site: http://www.cocos2d-iphone.org/archives/1112, which shows you how to setup ropes between two points using a custom class called VRope. You should be able to download the code, and replace the rope.png with your texture.

Cheers, Pras.

0

精彩评论

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

关注公众号