today I added the so called TextureSourceDecorators.
In the example below actually a implementation of the a abstract class TextureSourceDecorators called OutlineTextureSourceDecorator i used. What this class does it to draw a 1px colored line to the edge of the Texture right before it is sent to the GPU.
Without OutlineTextureSourceDecorator:
With OutlineTextureSourceDecorator
While I think this is primarily useful for debugging purposes as you can influence the appearance of Textures through code.
I can also think of some useful things to do with it, like add some color-highlight to a sprite. For example think of a RTS (Real-Time-Strategdy) game where the tanks have a little team-color-indicator or so. So you wouldn't have to put tank-sprites in all possible team-colors into your project.
Code-wise this is very simple. Where you had sth like this before:
Using java Syntax Highlighting
- this.mBoxFaceTextureRegion = TextureRegionFactory.createFromAsset(this.mTexture, this, "gfx/face_box.png", 0, 0);
Parsed in 0.030 seconds, using GeSHi 1.0.8.4
You'd now do this:
Using java Syntax Highlighting
- this.mBoxFaceTextureRegion = TextureRegionFactory.createFromSource(this.mTexture, new OutlineTextureSourceDecorator(new AssetTextureSource(this, "gfx/face_box.png"), Color.RED), 0, 0);
Parsed in 0.030 seconds, using GeSHi 1.0.8.4
Changeset: http://code.google.com/p/andengine/sour ... 78bf768aee
Best Regards,
Nicolas

