This is a version of @-BlueO-'s mobile joystick that I have adapted for compatibility with 8-directional controls. It will move when you use the arrow keys and can also convert your touch motions into 8-directional controls. I have NOT removed the ability to move like in the original, I just improved it and am using 8-directional controls as an example. I also made the area you can move it in smaller and added the ability to detect if you are on the edge.
I am making this for a project I am "working on" (maybe not actually working on).