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

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

问题描述

我需要我的精灵从一种颜色过渡到另一种颜色,然后不断地......就像蓝色,然后是绿色,然后是紫色,但我找不到任何好的动作,我想知道,我应该使用动画吗?或者是否有针对此的合并行动?

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天全站免登陆