Is there any way to make a sprite darker or lighter in AndEngine? I dont want to use the alpha thing. Nor I want to loose the texture/design of the image.
One way in 2D Android to do darken or perhaps even to make it lighter is to use the lighting color filters:
Paint myPaint = new Paint(Paint.ANTI_ALIAS_FLAG); myPaint.setColorFilter(new LightingColorFilter(Color.rgb(120, 176, 209),0));
public LightingColorFilter (int mul, int add) Since: API Level 1 Create a color filter that multiplies the RGB channels by one color, and then adds a second color, pinning the result for each component to [0..255]. The alpha components of the mul and add arguments are ignored.
However, this can a bit diminish the color detail on the sprite.
For my opinion you have to use setColor method of the sprite to make it darker and lighter. To make darker sprite you have to use
sprite.setColor(180f / 255f, 180f / 255f, 180f / 255f);
To make lighter sprite again you have to use
sprite.setColor(1f, 1f, 1f);