Cette page est affichée en anglais. Une traduction française est en cours.
SkillsMay 5, 2026·3 min de lecture

libGDX — Cross-Platform Java Game Development Framework

A mature, battle-tested Java framework for building 2D and 3D games that deploy to desktop, Android, iOS, and the web from a single codebase.

Prêt pour agents

Cet actif peut être lu et installé directement par les agents

TokRepo expose une commande CLI universelle, un contrat d'installation, le metadata JSON, un plan selon l'adaptateur et le contenu raw pour aider les agents à juger l'adaptation, le risque et les prochaines actions.

Needs Confirmation · 64/100Policy : confirmer
Surface agent
Tout agent MCP/CLI
Type
Skill
Installation
Single
Confiance
Confiance : Established
Point d'entrée
libGDX Overview
Commande CLI universelle
npx tokrepo install fe2b0119-489d-11f1-9bc6-00163e2b0d79

Introduction

libGDX is a free, open-source Java game development framework that lets you write your game once and ship it to Windows, macOS, Linux, Android, iOS, and HTML5. It provides a unified API across platforms so you focus on game logic rather than platform quirks.

What libGDX Does

  • Renders 2D sprites, tilemaps, and particle effects via OpenGL ES
  • Supports 3D rendering with model loading, skeletal animation, and PBR shaders
  • Provides cross-platform audio, input handling, and file I/O abstractions
  • Includes a 2D physics wrapper around Box2D and 3D physics via Bullet
  • Offers UI toolkit (Scene2D) for menus, HUDs, and in-game interfaces

Architecture Overview

libGDX uses a backend-agnostic core module where all game logic resides. Platform-specific backends (LWJGL for desktop, Android SDK, RoboVM/MOE for iOS, GWT for web) implement the same interfaces, enabling a single codebase to target multiple platforms. The framework follows an immediate-mode rendering approach using OpenGL ES 2.0/3.0.

Self-Hosting & Configuration

  • Requires JDK 11+ and Gradle for building projects
  • Use gdx-liftoff to scaffold projects with chosen backends and extensions
  • Configure platform targets in gradle.properties and settings.gradle
  • Add extensions (Box2D, FreeType, Controllers) via Gradle dependencies
  • Android builds need Android SDK; iOS builds need Xcode on macOS

Key Features

  • Single codebase deploys to 6+ platforms including mobile and web
  • Extensive extension ecosystem: AI, physics, networking, UI
  • Mature and stable with over a decade of production use
  • No runtime fees or royalties under the Apache 2.0 license
  • Active community with tutorials, wikis, and third-party tools

Comparison with Similar Tools

  • Godot — Full editor with GDScript; libGDX is code-only and Java-native
  • Unity — Proprietary with C#; libGDX is fully open source and free
  • MonoGame — C#/.NET based; libGDX targets Java/Kotlin developers
  • Bevy — Rust ECS engine, newer; libGDX has a larger ecosystem and longer track record
  • Phaser — JavaScript and web-only; libGDX targets native desktop and mobile too

FAQ

Q: Can I use Kotlin instead of Java? A: Yes. libGDX works with Kotlin out of the box since it runs on the JVM. Many developers prefer Kotlin for its concise syntax.

Q: Is libGDX suitable for 3D games? A: It supports 3D rendering, model loading, and physics via Bullet. However, it lacks a built-in 3D editor, so teams needing visual scene editing may prefer Godot or Unity.

Q: How does HTML5 export work? A: libGDX uses GWT (Google Web Toolkit) to compile Java to JavaScript, producing a browser-playable build with WebGL rendering.

Q: What games have been made with libGDX? A: Notable titles include Slay the Spire (original version), Mindustry, Shattered Pixel Dungeon, and Unciv.

Sources

Fil de discussion

Connectez-vous pour rejoindre la discussion.
Aucun commentaire pour l'instant. Soyez le premier à partager votre avis.

Actifs similaires