since a recent version of AndEngine, you can now use ColorKeying (remove a specific color or even color-range from a TextureSource) with the ColorKeyTextureSourceDecorator.
This is how it looks like:
For the above screenshot, these are the lines of code that make the difference.
Left, original version:
Using java Syntax Highlighting
- this.mChromaticCircleTextureRegion = TextureRegionFactory.createFromSource(this.mTexture, baseTextureSource, 0, 0);
Parsed in 0.029 seconds, using GeSHi 1.0.8.4
Right, colorkeyed version (here only the red segment is removed):
Using java Syntax Highlighting
- /* We will remove the red segment from the chromatic circle. */
- final int colorKeyRed = Color.rgb(255, 0, 51); // Color of the red segment.
- final ColorKeyTextureSourceDecorator colorKeyedTextureSource = new ColorKeyTextureSourceDecorator(baseTextureSource, colorKeyRed);
- this.mChromaticCircleColorKeyedTextureRegion = TextureRegionFactory.createFromSource(this.mTexture, colorKeyedTextureSource, 128, 0);
Parsed in 0.032 seconds, using GeSHi 1.0.8.4
Hope this helps some of you
Best Regards,
Nicolas
