libgdx actor 透明问题

遇到一个问题,自定义的Actor在使用batch.draw时,其他Actor设置的透明影响到了这个Actor

 

处理方法为

在自定义Actor中 draw方法中 绘制前,加入

Color color = batch.getColor();
        batch.setColor(color.r, color.g, color.b, parentAlpha);
batch.draw(xxx...)

问题解决。

posted @ 2015-07-12 15:08  带狗狗带  Views(387)  Comments(0Edit  收藏  举报