THIS IS WORK AND CODE WAS CREATED BY LERG FOR CORONA SDK/ LUA USE. I DID NOT ADD ANYTHING TO THIS BUT TO UPDATE THE MODULE FOR GFX2. ALL CREDIT GOES TO LERG FOR CREATING THE ORIGINAL CODE. I HAVE GOTTEN A LOT OF MILEAGE OUT OF THIS SO I THOUGHT I'D POST IT FOR OTHERS TO USE.
To use, input the following in your main.lua file: