From 2fedcfb8b0e9798d0a3982d8fcb900d8f958f778 Mon Sep 17 00:00:00 2001 From: Jevon Wright Date: Wed, 9 Sep 2026 14:07:45 +1200 Subject: [PATCH] Cleanup README, replace badge to Mvnrepository --- README.md | 37 ++++++++++++++++++++----------------- 1 file changed, 20 insertions(+), 17 deletions(-) diff --git a/README.md b/README.md index e07b3f0..1a836ef 100644 --- a/README.md +++ b/README.md @@ -11,37 +11,40 @@ Use game controllers with ease in your libGDX games. The recommended way to use gdx-controllers is via dependency management with Gradle or Maven. Artifacts are available in [Snapshot Repository](https://oss.sonatype.org/content/repositories/snapshots/com/badlogicgames/gdx-controllers/) and Maven Central. -[![Sonatype Nexus (Releases)](https://img.shields.io/nexus/r/com.badlogicgames.gdx-controllers/gdx-controllers-core?nexusVersion=2&server=https%3A%2F%2Foss.sonatype.org&label=release)](https://search.maven.org/artifact/com.badlogicgames.gdx-controllers/gdx-controllers-core) -[![Sonatype Nexus (Snapshots)](https://img.shields.io/nexus/s/com.badlogicgames.gdx-controllers/gdx-controllers-core?server=https%3A%2F%2Foss.sonatype.org&label=snapshot)](https://oss.sonatype.org/#nexus-search;gav~com.badlogicgames.gdx-controllers~gdx-controllers-core) +[![MvnRepository](https://badges.mvnrepository.com/badge/com.badlogicgames.gdx-controllers/gdx-controllers-core/badge.svg?label=MvnRepository)](https://mvnrepository.com/artifact/com.badlogicgames.gdx-controllers/gdx-controllers-core) *project-root/build.gradle:* - ext { - gdxControllersVersion = '2.0.1' // see badges above for latest versions - } +```kotlin +ext { + gdxControllersVersion = '2.2.4' // see badges above for latest versions +} +``` Add the following dependencies: #### core: -``` +```kotlin implementation "com.badlogicgames.gdx-controllers:gdx-controllers-core:$gdxControllersVersion" ``` #### desktop: -``` +```kotlin implementation "com.badlogicgames.gdx-controllers:gdx-controllers-desktop:$gdxControllersVersion" ``` This will automatically fetch the [underlying SDL-based natives and Java wrappers](https://github.com/libgdx/Jamepad). If you want to use a newer version, add the dependency yourself: - implementation("com.badlogicgames.jamepad:jamepad:$jamepadVersion") { - exclude group: 'com.badlogicgames.gdx', module: 'gdx-jnigen-loader' - } +```kotlin +implementation("com.badlogicgames.jamepad:jamepad:$jamepadVersion") { + exclude group: 'com.badlogicgames.gdx', module: 'gdx-jnigen-loader' +} +``` Make sure to check the [compatibility doc](https://github.com/libgdx/gdx-controllers/wiki/Compatibility) when doing so. #### android: -``` +```kotlin implementation "com.badlogicgames.gdx-controllers:gdx-controllers-android:$gdxControllersVersion" ``` Proguard setting: @@ -50,26 +53,26 @@ Proguard setting: ``` #### ios: -``` +```kotlin implementation "com.badlogicgames.gdx-controllers:gdx-controllers-ios:$gdxControllersVersion" ``` `robovml.xml` needs the following lines added to `forceLinkClasses` and `frameworks`: -``` +```xml com.badlogic.gdx.controllers.IosControllerManager .... - GameController +GameController ``` If you forget to explicitly link the framework, no game controller will show up. #### html: -``` +```kotlin implementation "com.badlogicgames.gdx-controllers:gdx-controllers-core:$gdxControllersVersion:sources" implementation "com.badlogicgames.gdx-controllers:gdx-controllers-gwt:$gdxControllersVersion:sources" ``` You also need to add the following file to your GdxDefinition.gwt.xml in your html project: -``` +```xml - + ``` ### Building from source