变色精灵的Cocos2D [英] Color Changing Sprites Cocos2d

查看:107
本文介绍了变色精灵的Cocos2D的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我需要我的精灵过渡到一种颜色到另一个和...喜欢蓝色的色调,然后再青紫色的,但我找不到任何好的行为,我想知道,我应该使用动画?或者是有一个这样的动作Incorporated的?

I need my sprite to transition to one color to another and on and on... like blue tint then green then purple, but i cannot find any good actions for that and am wondering, should i use animations? or is there an incorporated action for this?

推荐答案

您可以使用CCTintTo行动改变精灵的颜色

you can use CCTintTo action to change the color of the sprite

[sprite runAction:[CCTintTo actionWithDuration:2 red:255 green:0 blue:0]];

这篇关于变色精灵的Cocos2D的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆