Imaging effects in my original Old Style Game Framework was more “involved” to get it to work. I had to make it as an added feature of the Animation class, by creating the ImageFx class. Effects that dealt with color changes; brightening, darkening, changing color, etc, involved more complicated procedures and using a BufferedImageOp object to do the operation. Rotating the image involved using the AffinsTransform class. One thing about this class is that you had to be careful where the “center” of the rotation is; if you move the object and then try to rotate it, you get a different effect than rotating it and then moving.
LibGDX, with the underlying LWJGL framework underneath it, makes much of this trivial. The SpriteBatch’s draw method has arguments for rotating, shrinking and enlarging, cropping and even flipping the image horizontally and/or vertically.
public void draw(TextureRegion region, float x, float y, float originX, float originY, float width, float height, float scaleX, float scaleY, float rotation)
public void draw(Texture texture, float x, float y, float originX, float originY, float width, float height, float scaleX, float scaleY, float rotation, int srcX, int srcY, int srcWidth, int srcHeight, boolean flipX, boolean flipY)
The use of the booleans to flip the image can also be achieved by using the method that takes U and V values and reversing them. I demonstrated this in my second video on still image rendering. Coloring and translucency effects are done by setting the color on the SpriteBatch.
SpriteBatch.setColor(new Color(red, green, blue, translucency or alpha));
In my framework, I integrated this within the BaseAnimation class. Using a framework, takes away all the hard work in making a game.