How do you tell libgdx to use a specific color for transparency?

感情迁移 提交于 2019-12-13 04:38:18

问题


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

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!