AS3 色调位图
我有一个正在处理的项目的精灵表,我需要能够更改图像的色调,以便我可以寻找空间。该图像上有一些简单的纹理,但将以 5 种不同的颜色显示。我附加了一张图片来准确了解我在说什么:http://i42.tinypic.com/29443l5。 png
我试图在生成的精灵上使用它来达到我想要的效果:
var c:ColorTransform = new ColorTransform();
c.color = 0xf30909;
transform.colorTransform = c;
但是我把所有东西都变成了红色,而不是我想要的。我正在为 AIR 进行构建,因此无法导入 fl.motion.Color 包(或者至少 Flash Builder 4.5 没有它)。我知道如何才能达到预期的效果吗?谢谢。
I have a spritesheet for a project I am working on and I need to be able to change the tint of the image so I can se space. The image has some simple texture on it but it will be displayed in 5 different colors. I attached an image to see exactly what I am talking about: http://i42.tinypic.com/29443l5.png
I tried to achieve my desired effect using this on the resulting sprite:
var c:ColorTransform = new ColorTransform();
c.color = 0xf30909;
transform.colorTransform = c;
But I get everything red, not as I want. I am building for AIR so the package fl.motion.Color can't be imported (or at least Flash Builder 4.5 does not have it). Any idea on how I can achieve the desired effect? Thanks.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
只是为了完整性......
Just for the sake of completeness...
color
属性设置偏移,即它使ColorTransform
将颜色值添加到图像中。您可能想要使用Multiplier
属性。请参阅 ColorTransform 文档。The
color
property sets the offset, i.e. it makes theColorTransform
add the color value to your image. You probably want to use theMultiplier
properties. See ColorTransform documentation.