How to make a onscreen JoyStick that operates according to mouse inputsand movements?

i am trying to make an onscreen joyStick. For that i searches many examples but they all were on input touches ans what i wanted was according to mouse position and inputs like i this image. Any one have code here? _/_

2337161--157980--hqdefault.jpg

Almost any of those onscreen virtual joysticks designed for touches ought to work with mouse movements as well. It’s possible you may have to tweak the code a bit to make use of mouse events rather than touch events, but this is a fairly minor change.

You don’t see this much because it’s a horrible UI. But it’s entirely possible.

So any reference from you ( @JoeStrout ) ?