I had the same problem as you, and after the recommendations I implemented it and also opened it as a library.
https://github.com/plattysoft/Leonids
It is very easy to use and also very light.
You probably figured it out, since the question is quite old, but I hope that it will be useful to other people with the same problem.
source share