问题
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.
So my question is, is there a way to make libgdx treat a color as transparency, and if there is, how?
回答1:
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.
来源:https://stackoverflow.com/questions/22116033/how-do-you-tell-libgdx-to-use-a-specific-color-for-transparency