Intro to LibGDX

Joseph Kavanagh
4 min readJan 30, 2017

--

What is it?

LibGDX is a framework for developing JVM (java virtual machine) based games or applications. The developers themselves don’t really consider libGDX a full game engine in the popular sense. Rather a framework that allows optional lower level access to things like input devices, OpenGL and file systems with the goal being more control and flexibility for the user (you). So to sum libGDX up in a couple of words I would call it a flexible, code driven, game development framework.

A little History

LibGDX was started in 2009 by Mario Zechner as a personal Android game framework called AFX. Mario wanted an easy way to prototype the games he was creating without having to spend the time deploying them to Android. So he modified his framework to run both on android and desktop environments. This was kind of the foundation of libGDX.

It took 4 years to get to the 1.0 release. During that time libGDX became a fleshed out cross platform game framework. With support for IOS, Windows, Mac OS X, Linux and Android. It got an open source license and the source code was migrated over to GitHub. This led to many more people contributing to the project and over this period of time a lot of new features and extensions were added.

After 1.0 there has been a steady stream of updates with the latest release, libGDX 1.9.5, releasing on December 11, 2016. In December of 2015 libGDX even had its own game jam which drew in 83 submissions. On its website it currently has over 4000 games in the gallery. This gallery showcases games made in libGDX and I think it really demonstrates that libGDX has become a popular framework for game development.

Key Features

-Open Source

LibGDX is licensed under the Apache 2.0 License. This is a permissive license meaning you can modify and distribute the source code of libGDX freely provided you include the original license text. In terms of games you make with libGDX, you are free to sell the games you make and don’t have to give anything back to the libGDX creators.

-Cross Platform

A major draw or “selling point” of libGDX is its cross platform publishing capability. One of the core principles of the framework is the ability to write your code once and with minimal additional code have your application run on IOS, Android, HTML, Windows or Linux. It’s able to do this through its multiple back-end libraries that take your code and interpret it for the specific operating system you want to deploy to. The grand idea being that you won’t have to have a lot of platform specific code for your application.

From what I have read online the HTML back-end can be difficult to use and I wouldn’t recommend using libGDX if you plan to only develop for web. Though as an added platform to publish on it’s doable.

There was recently a set back to the cross platform publishing easiness of libGDX. Their back-end technology to publish on IOS, RoboVM, was killed off by Microsoft when they bought RoboVM’s parent company Xamerin. This has led to two new back-ends for publishing on IOS. Both work at the moment, though they haven’t been around that long and may need some time to be brought fully up to date with new IOS features.

-Extensions

LibGDX has a many extensions available right from its own setup application. These add things like 2D physics, AI frameworks and level editors. They extend the functionality of the framework. For example, if you need 3D physics in your game, you just need to include the Bullet physics extension when you create your project instead of programing something like that from scratch.

Getting started

To follow along with the upcoming blog posts and to begin messing around with the libGDX framework you will need to make sure you have a few things. First you will need an IDE. I will be using Eclipse though libGDX also supports Android Studio, Intellij IDEA and NetBeans. Second you’re going to need at least JDK (Java Development Kit) 7 installed. The third thing is Gradle integration, which I believe comes built in with the Java version of Eclipse neon. Next we will need both the Android SDK and the ADT Plugin for Eclipse. Finally, we can’t forget the libGDX project setup application. And that’s it! I will talk in a lot more detail on setting this up in my next blog. Keep in mind that this setup does not allow for publishing on IOS unless your using a Mac.

I hope this introduction gave you a feel of what libGDX is and its capabilities. In my next blog I will be going through the setup of libGDX and creating a small example application. Thanks for reading!

--

--