K-4U/Hydraulicraft — pull request #27 by Vswe (2014-01-14 18:54:02+00:00)
Title: Made item transformation animate in the incinerator

There you go. It is well commented and is easy to use as well.

There's just one single line in the Incinerator interface that calls the rendering (in the IconRenderer). You simply supply it with the x, y (z) coordinates, the two items, the percentage and whether the transformation should wobble or not. Currently the wobble is set to be active every second time (so you can see both versions). That's why there's a to-do there, simply set the last parameter to true(for wobble) or false(for smooth).

Since the rendering code is in its own utility class it is very easy if you want to use it in the washer as well. Couldn't seem to open the interface though. Did you remove the washer's interface? :/

The rendering code might seem a bit long but half of it is just comments. Also, many of the lines are doing the same thing (like code that does similar things for x and y coordinates as well as the target coordinates and the source coordinates).

Here's a short description of how it works.
1. Grab the icons from the 2 items
2. Calculate the alpha value for both items depending on the percentage
3. Calculate the size for the icons depending on the percentage
4 To make it wobble, introduce some rounding off errors on purpose
5. Render the two icons on top of each other

By doing it like this the dust icon will fade out and decrease in size while the ingot will fade in and decrease in size.