markiewiczjakub / joystick

A simple joystick component for webapp using pure TypeScript. It can be used as control element.
https://markiewiczjakub.github.io/joystick/demo/
MIT License
2 stars 0 forks source link

make the joystick circle button smaller #2

Open xubo92 opened 7 months ago

xubo92 commented 7 months ago

Hi @markiewiczjakub

Thanks a lot for your project! It helps much with my personal project of a control car.

I had a question that how to reduce the size of the inside joystick circle, for example reducing its radius. I suppose there should be something needs to be changed in the js file but I wasn't sure where. Could you please point it out?

Thanks!

Best, Xubo

markiewiczjakub commented 6 months ago

https://github.com/markiewiczjakub/joystick/blob/master/src/CanvasHandler.ts

In this exact file you can find this.circleRadius property in constructor. The value that you are looking for is this.circleRadius.joystick.