There are many times where it may be useful to have the mouse position in the program. Perhaps you want an object to follow the mouse, perhaps you want something to happen based on the mouse position, such as a graphic effect.
In this recipe, we're going to create a program that makes our sprite change its graphic effects based on the mouse position.
Start off by creating a new file and importing a new sprite. In our case, we've imported Monkey1 with the white background.
We're going to apply two effects, one based on the mouse's horizontal direction, another based on the mouse's vertical direction. Follow along with these steps: