使用CCRibbon画线

CCRibbon is used to create line drawing effects using the image you specify for drawing paths or aimlines or trajectories.
First you create CCRibbon with width , image , length , color and fade parameters
ccColor4B myColor = ccc4(255255255150);

CCRibbon *ribbon = [CCRibbon ribbonWithWidth:10 image:@"green.png" length:10.0 color:myColor fade:0.7f];

Then we add it as a child:

[self addChild:ribbon z:8];

If you run the application now you will not see anything because you didn’t add any points yet to the CCRibbon so lets add 2 points

[
ribbon addPointAt:ccp(10,10) width:10];

[
ribbon addPointAt:ccp(15,15) width:10];

You cannot remove individual points but you can remove the CCRibbon from its parent

[
self removeChild:ribbon cleanup:YES];

Now Run and watch the results


评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值