Game Development Stack Exchange is a question and answer site for professional and independent game developers. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I am making a 2d platformer in java using the slick2d engine. I only use 2 colors: black and white. I want to implement a feature were i invert the colors of certain entities. However i can't find a way to do this. Anyone knows of an easy way or function?

share|improve this question
Are the entities loaded from file or drawn by in java? Both cases would support Tinting however I unsure if tinting black with white would work :) – AbstractChaos Aug 8 '12 at 15:49
The graphics are loaded from spritesheets. – Malthe Lange Aug 8 '12 at 15:59

Try this on white one first, add this Color test = new Color(0f,1f,0f); then in your render method using your sprite sheet do.


//draw sprites


If this works then you could simply have a single sprite sheet (of all white) and color it anyway you wish.

Hope it helps

share|improve this answer
I tried using the above on one of my enemies' animation: if(manager.inverted && verticalDir == LEFT){ Color test = new Color(0f, 1f, 0f); moving.getCurrentFrame().startUse(); test.bind(); moving.getCurrentFrame().draw(position.x, position.y); moving.getCurrentFrame().endUse(); } It just stopped my entities from being rendered at all P.S: I can't get the code tags to work on this site – Malthe Lange Aug 8 '12 at 21:43
@MaltheLange could you post your render code? – AbstractChaos Aug 9 '12 at 9:23

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.