My first attempt at Clash-of-Clans-like (a.k.a. "pixel perfect") touch controls.
If your device has a touchscreen, you can see a demo here.
Yep, the code is a mess. Sorry.
If the window height is greater than the window width (i.e., the device is in portrait mode), then only the top portion of the screen is responsive.