All Projects → caibou → RockerView

caibou / RockerView

Licence: other
A game controller view

Programming Languages

java
68154 projects - #9 most used programming language

Projects that are alternatives of or similar to RockerView

Nintendoextensionctrl
Arduino library for communicating with Nintendo extension controllers
Stars: ✭ 67 (+219.05%)
Mutual labels:  controller, joystick
Segacontroller
Arduino library to read Sega Genesis (Mega Drive) and Master System (Mark III) controllers.
Stars: ✭ 55 (+161.9%)
Mutual labels:  controller, joystick
Unswitch
🕹 A tiny event handler for Switch controllers!
Stars: ✭ 574 (+2633.33%)
Mutual labels:  controller, joystick
stick
Platform-agnostic asynchronous gamepad, joystick and flightstick library for the Rust Programming Language
Stars: ✭ 41 (+95.24%)
Mutual labels:  controller, joystick
MVVM-Design-Pattern-Demo
An Xcode 9 project written in Swift 4 code designed using the MVVM design pattern, truly extolling the virtues of MVVM over MVC.
Stars: ✭ 31 (+47.62%)
Mutual labels:  controller
PSPi-1000-Version-4
https://othermod.com/pspi-1000-version-4/
Stars: ✭ 39 (+85.71%)
Mutual labels:  joystick
d3-graph-controller
A TypeScript library for visualizing and simulating directed, interactive graphs.
Stars: ✭ 106 (+404.76%)
Mutual labels:  controller
stadiacontroller
Command line application that emulates an Xbox 360 controller from a wired Stadia controller on Windows.
Stars: ✭ 142 (+576.19%)
Mutual labels:  controller
FCND-Term1-P3-3D-Quadrotor-Controller
Udacity Flying Car Nanodegree - Term 1 - Project 3 - 3D Quadrotor Controller
Stars: ✭ 31 (+47.62%)
Mutual labels:  controller
mi-360
Xbox360 controller emulation for Xiaomi Gamepad, with vibration support
Stars: ✭ 118 (+461.9%)
Mutual labels:  joystick
ArduinoJoystickWithFFBLibrary
An Arduino Joystick Library With Force Feedback Feature
Stars: ✭ 128 (+509.52%)
Mutual labels:  joystick
DualSenseWindows UE4
Unreal Engine 4 port of the Windows API for the PS5 DualSense controller created at Ohjurot/DualSense-Windows
Stars: ✭ 25 (+19.05%)
Mutual labels:  controller
kube-code-generator
Kubernetes code generator docker image
Stars: ✭ 60 (+185.71%)
Mutual labels:  controller
MyDemos
💾 Demo 集合 . 黑发不知勤学早,白首方悔读书迟.
Stars: ✭ 64 (+204.76%)
Mutual labels:  joystick
SPX-GC
SPX is a graphics control client for live video productions and live streams using CasparCG, OBS, vMix, or similar software.
Stars: ✭ 178 (+747.62%)
Mutual labels:  controller
xbox360-controller-manager
Turn OFF your wireless xbox 360 controller on PC and see the battery status of the connected controllers.
Stars: ✭ 38 (+80.95%)
Mutual labels:  controller
Model-Predictive-Control
Udacity Self-Driving Car Engineer Nanodegree. Project: Model Predictive Control
Stars: ✭ 50 (+138.1%)
Mutual labels:  controller
php-mvc
Mini framework para aplicaciones PHP con el patrón MVC
Stars: ✭ 35 (+66.67%)
Mutual labels:  controller
OMJoystick
This is the JoyStick UI library for SwiftUI.
Stars: ✭ 15 (-28.57%)
Mutual labels:  joystick
helm-controller
A simple way to manage helm charts with a Custom Resource Definitions in k8s.
Stars: ✭ 49 (+133.33%)
Mutual labels:  controller

RockerView

Download

这是一个游戏手柄方向键的自定义View。

JoystickView DirectionView

开始

Gradle 3.0及以上

implementation 'me.caibou.android:rockerview:1.0.0'

Gradle 3.0以下

compile 'me.caibou.android:rockerview:1.0.0'

使用

JoystickView

<me.caibou.rockerview.JoystickView
        android:id="@+id/joystick_control"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        app:layout_constraintBottom_toBottomOf="parent"
        app:layout_constraintEnd_toEndOf="parent"
        app:layout_constraintStart_toStartOf="parent"
        app:layout_constraintTop_toTopOf="parent"
                               
        app:edge_radius="65dp"
        app:stick_color="#f52504"
        />

属性

  • edge_radius:外边框的半径
  • stick_color:摇杆的颜色

设置角度改变回调

joystickView.setAngleUpdateListener(new JoystickView.OnAngleUpdateListener() {
  	@Override
    public void onAngleUpdate(double angle, int action) {
    	if (action == JoystickView.ACTION_RELEASE){
	    tvAngle.setText("");
        } else {
            tvAngle.setText(getString(R.string.angle, angle));
        }
    }
});

DirectionView

<me.caibou.rockerview.DirectionView
        android:id="@+id/direct_control"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        app:layout_constraintEnd_toEndOf="parent"
        app:layout_constraintHorizontal_bias="parent"
        app:layout_constraintStart_toStartOf="parent"
        app:layout_constraintTop_toTopOf="parent"
        
	app:edge_radius="65dp"
        app:button_outside_circle_radius="60dp"
        app:button_side_width="40dp"
	app:indicator_color="#f52504"
	/>

属性

  • edge_radius:外边框的半径
  • button_outside_circle_radius:方向按钮外切圆的半径
  • button_side_width:方向按钮的边长
  • indicator_color:手指按下之后指示器的颜色

设置方向改变回调

directionView.setDirectionChangeListener(new DirectionView.DirectionChangeListener() {
	@Override
    public void onDirectChange(DirectionView.Direction direction) {
    	tvAngle.setText(direction.toString());
    }
});

License

Copyright 2017 caibou.

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at

    http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].