commit 24d78786db3c1dab4466bf4360365b7fca3aee41 Author: bill Date: Mon May 4 11:44:40 2026 -0700 Initial LibGDX project scaffold for ArtLegend Multi-module Gradle setup targeting Android (S-Pen) and Desktop (Wacom/LWJGL3). Includes core game stub, Android launcher with immersive mode, and desktop launcher. Asset directory shared across platforms. Gradle 8.6, Kotlin 1.9.23, LibGDX 1.12.1. diff --git a/android/build.gradle.kts b/android/build.gradle.kts new file mode 100644 index 0000000..2178e2e --- /dev/null +++ b/android/build.gradle.kts @@ -0,0 +1,67 @@ +plugins { + kotlin("android") + id("com.android.application") +} + +val gdxVersion: String by project +val natives: Configuration by configurations.creating + +android { + namespace = "com.artlegend" + compileSdk = 34 + + defaultConfig { + applicationId = "com.artlegend" + minSdk = 26 + targetSdk = 34 + versionCode = 1 + versionName = "0.1.0" + } + + compileOptions { + sourceCompatibility = JavaVersion.VERSION_17 + targetCompatibility = JavaVersion.VERSION_17 + } + + kotlinOptions { + jvmTarget = "17" + } + + sourceSets { + getByName("main") { + assets.srcDirs(rootProject.file("assets")) + jniLibs.srcDirs("libs") + } + } +} + +dependencies { + implementation(project(":core")) + implementation("com.badlogicgames.gdx:gdx-backend-android:$gdxVersion") + natives("com.badlogicgames.gdx:gdx-platform:$gdxVersion:natives-armeabi-v7a") + natives("com.badlogicgames.gdx:gdx-platform:$gdxVersion:natives-arm64-v8a") + natives("com.badlogicgames.gdx:gdx-platform:$gdxVersion:natives-x86") + natives("com.badlogicgames.gdx:gdx-platform:$gdxVersion:natives-x86_64") +} + +tasks.register("copyAndroidNatives") { + doFirst { + natives.files.forEach { jar -> + val outputDir = file("libs") + outputDir.mkdirs() + copy { + from(zipTree(jar)) + into(outputDir) + include("*.so") + eachFile { path = name } + includeEmptyDirs = false + } + } + } +} + +tasks.whenTaskAdded { + if (name.contains("package") || name.contains("assemble") || name.contains("bundle")) { + dependsOn("copyAndroidNatives") + } +} diff --git a/android/src/main/AndroidManifest.xml b/android/src/main/AndroidManifest.xml new file mode 100644 index 0000000..42e28de --- /dev/null +++ b/android/src/main/AndroidManifest.xml @@ -0,0 +1,27 @@ + + + + + + + + + + + + + + + + + + + + diff --git a/android/src/main/kotlin/com/artlegend/AndroidLauncher.kt b/android/src/main/kotlin/com/artlegend/AndroidLauncher.kt new file mode 100644 index 0000000..ff0792a --- /dev/null +++ b/android/src/main/kotlin/com/artlegend/AndroidLauncher.kt @@ -0,0 +1,17 @@ +package com.artlegend + +import android.os.Bundle +import com.badlogic.gdx.backends.android.AndroidApplication +import com.badlogic.gdx.backends.android.AndroidApplicationConfiguration + +class AndroidLauncher : AndroidApplication() { + override fun onCreate(savedInstanceState: Bundle?) { + super.onCreate(savedInstanceState) + val config = AndroidApplicationConfiguration().apply { + useImmersiveMode = true + useGyroscope = false + useAccelerometer = false + } + initialize(ArtLegend(), config) + } +} diff --git a/android/src/main/res/values/strings.xml b/android/src/main/res/values/strings.xml new file mode 100644 index 0000000..850ab7b --- /dev/null +++ b/android/src/main/res/values/strings.xml @@ -0,0 +1,4 @@ + + + ArtLegend + diff --git a/android/src/main/res/values/styles.xml b/android/src/main/res/values/styles.xml new file mode 100644 index 0000000..755c9bd --- /dev/null +++ b/android/src/main/res/values/styles.xml @@ -0,0 +1,4 @@ + + +