I everybody,
I'm trying to draw an animation with an alpha value but it doesn't work... The image still render without alpha !
Here is my code :
Code:
public class SimpleAnimation extends Animation {
public static final int FRAME_TIME = 100;
private SpriteSheet sheet;
public SimpleAnimation(SpriteSheet sheet, int nbrFrames) {
this.sheet = sheet;
init(nbrFrames);
}
private void init(int nbrFrames) {
for (int i = 0; i < nbrFrames; i++) {
addFrame(sheet.getSprite(i, 0), FRAME_TIME);
}
setAutoUpdate(false);
}
public void reset() {
setCurrentFrame(0);
}
public void setAlpha(float alpha) {
sheet.setAlpha(alpha);
}
}
And i do this :
Code:
SimpleAnimation animation = new SimpleAnimation(sheet, 8);
animation.setAlpha(0.75f);
[...]
// On the render method
animation.draw(vector.getX(), vector.getY());
Can anybody explain to me what's wrong ?
Thanks a lot.