I created a AnimatedSprite
class, that draw a specific TextureRegion
. Sometimes I need a tint color effect, so I set (this.color is a Color
field of my AnimatedSprite
):
super.draw(batch, parentAlpha);
batch.setColor(this.color);
batch.draw(this.frames[this.currentFrame], x, y, originX, originY, width, height, scaleX, scaleY, rotation)
batch.setColor(Color.WHITE);
However, when I have an AnimatedSprite
's color set to black or any color, everything else has that color tint. I even try to flush()
, end the batch and begin a new one, etc... but nothing seems to work.
Please help me apply the tint effect correctly. I will appreciate any idea.
draw
method? It looks right, and looks like the Image.java draw method. Maybe something else? Is this.color used elsewhere? – CautiousImage
class after had seen your comment. TheImage
class doesn't even reset the batch's color, so I tried remove it in my code.this.color
is not used elsewhere, and I also give the r g b value instead of entire color instance. However, my entire screen is still tint by a color. – Gyrus