Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/tichise/omjoystick
This is the JoyStick UI library for SwiftUI.
https://github.com/tichise/omjoystick
cocoapods joystick joystick-library spm swift swiftpackage swiftpackagemanager swiftui ui
Last synced: 15 days ago
JSON representation
This is the JoyStick UI library for SwiftUI.
- Host: GitHub
- URL: https://github.com/tichise/omjoystick
- Owner: tichise
- License: mit
- Created: 2020-09-06T06:03:53.000Z (about 4 years ago)
- Default Branch: master
- Last Pushed: 2024-03-05T05:23:07.000Z (9 months ago)
- Last Synced: 2024-04-24T08:29:34.719Z (7 months ago)
- Topics: cocoapods, joystick, joystick-library, spm, swift, swiftpackage, swiftpackagemanager, swiftui, ui
- Language: Swift
- Homepage:
- Size: 106 KB
- Stars: 18
- Watchers: 4
- Forks: 7
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
### OMJoystick ![CocoaPods Version](https://img.shields.io/cocoapods/v/OMJoystick.svg?style=flat) ![Platform](https://img.shields.io/cocoapods/p/OMJoystick.svg?style=flat) ![License](https://img.shields.io/cocoapods/l/OMJoystick.svg?style=flat)
This is the JoyStick UI library for SwiftUI.
### Image
![image](https://user-images.githubusercontent.com/43707/92986397-65c81e00-f4f5-11ea-95fe-f308df819b8e.png)### Examples
#### Swift
Simple
```html
import SwiftUI
import OMJoystickstruct ContentView: View {
var body: some View {
OMJoystick(colorSetting: ColorSetting()) { (joyStickState, stickPosition) in
}
}
}
```Customize
```html
import SwiftUI
import OMJoystick
import SFSafeSymbolsstruct ContentView: View {
let iconSetting = IconSetting(
leftIcon: Image(systemSymbol: .arrowLeft),
rightIcon: Image(systemSymbol: .arrowRight),
upIcon: Image(systemSymbol:.arrowUp),
downIcon: Image(systemSymbol: .arrowDown)
)
let colorSetting = ColorSetting(subRingColor: .red, bigRingNormalBackgroundColor: .green, bigRingDarkBackgroundColor: .blue, bigRingStrokeColor: .yellow)
var body: some View {
GeometryReader { geometry in
VStack(alignment: .center, spacing: 5) {
OMJoystick(isDebug: true, iconSetting: self.iconSetting, colorSetting: ColorSetting(), smallRingRadius: 70, bigRingRadius: 120
) { (joyStickState, stickPosition) in
}.frame(width: 315, height: 315)
}
}
}
}struct ContentView_Previews: PreviewProvider {
static var previews: some View {
ContentView()
}
}
```### Installation (CocoaPods)
`pod 'OMJoystick'`### CocoaPods URL
[OMJoystick on CocoaPods.org](https://cocoapods.org/pods/OMJoystick)### License
OMJoystick is available under the MIT license. See the LICENSE file for more info.