你怎么知道libgdx使用特定的颜色,透明度?

你怎么知道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.