This will guide you through the steps of coding a plugin.
This tutorial aims to aid your understanding of what Scale and Offset are.