simple React Native virtual joystick
npm install react-native-virtual-joystick
import { GestureHandlerRootView } from 'react-native-gesture-handler';
import { JoyStick } from 'react-native-virtual-joystick';
// ...
<GestureHandlerRootView
style={{ flex: 1, alignItems: 'center', justifyContent: 'center' }}
>
<JoyStick
wrapperColor="#808080"
nippleColor="#D3D3D3"
wrapperRadius={60}
nippleRadius={20}
borderWidth={5}
onMove={(data) => {
console.log(data);
}}
onTouchDown={(data) => {
console.log(data);
}}
onTouchUp={(data) => {
console.log(data);
}}
/>
</GestureHandlerRootView>;
MIT
Made with create-react-native-library