你怎么知道libgdx使用特定的颜色,透明度? [英] How do you tell libgdx to use a specific color for transparency?

查看:611
本文介绍了你怎么知道libgdx使用特定的颜色,透明度?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我用GraphicsGale,它不支持透明度。在容易解决这个问题的办法是只使用一个非常难看的颜色(#808040在我的情况),并使用透明度。我一直没能找到一种方法如何,虽然这样做在libgdx。当然,我可以通过GIMP拉并填写透明度,但它会是不错的直摸出GraphicsGale的。

I use GraphicsGale and it doesn't support transparency. The easy fix for this problem is to just use a really ugly color (#808040 in my case) and use that for transparency. I haven't been able to find a way how to do this in libgdx though. I can of course just pull it through GIMP and fill in the transparency, but it would be nice to work straight out of GraphicsGale.

所以我的问题是,有没有一种方法,使libgdx对待颜色的透明度,如果有,怎么了?

So my question is, is there a way to make libgdx treat a color as transparency, and if there is, how?

推荐答案

我模块化我的做法在透明更换颜色,这是我的ImageMagick的脚本:

I modularized my approach at replacing the color with transparency, here's my ImageMagick script:

#!/bin/bash

rm -rf x-android/assets/*
cp -r assets/* x-android/assets

cd x-android/assets
for f in `find . -name "*.png"`
do
    convert $f -transparent '#808040' $f
done

不是一个直接的答案,但它工作的方式更好。

Not a direct answer, but it works way better.

这篇关于你怎么知道libgdx使用特定的颜色,透明度?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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