开发者

Grey out sprite in AS3?

开发者 https://www.devze.com 2022-12-10 22:51 出处:网络
开发者_运维问答Is there an easy way to grey out a sprite?I\'m disabling a button, and I know how to do that, but wants to convey that in the GUI.You can apply the ColorMatrixFilter to your Sprite with
开发者_运维问答

Is there an easy way to grey out a sprite? I'm disabling a button, and I know how to do that, but wants to convey that in the GUI.


You can apply the ColorMatrixFilter to your Sprite with the approximate values that makes color greyscaled.

sprite.filters = [ new ColorMatrixFilter([0.3086, 0.6094, 0.0820, 0, 0, 0.3086, 0.6094, 0.0820, 0, 0, 0.3086, 0.6094, 0.0820, 0, 0, 0, 0, 0, 1, 0]) ];
0

精彩评论

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