Skip to content

Latest commit

 

History

History
48 lines (37 loc) · 969 Bytes

README.md

File metadata and controls

48 lines (37 loc) · 969 Bytes

NPM

react-native-virtual-joystick

simple React Native virtual joystick

Installation

npm install react-native-virtual-joystick

Usage

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>;

License

MIT


Made with create-react-native-library