2. LibGDX is ...
open source
cross-platform
Desktop
Web
Smartphone
performant
JNI Wrapper
optimised for Davlik VM
well documented
Wiki, Forum, Blog, JavaDoc, Demos, Videos, ..
3. LibGDX has ...
great tooling
Particle-, Body-, Fonteditor
TMX and TWL support
Texture packer
backends for
Jogl, LWJGL, Angle
SoundTouch, KissFFT
Mpg123, Tremor
nightly builds and regular releases
4. Getting Started - Desktop
1. create Project
2. download and move libGDX to libs/
3. Java Build Path
gdx.jar, gdx-backend-jogl.jar
and the corresponding “-natives.jar“
public class HelloWorldDesktop {
public static void main(String[] argv) {
new JoglApplication(new App(), "Title",
width, height, false/*Gl 2.0*/);
}
}
5. Application
http://libgdx.googlecode.com/svn/wiki/img/application_lifecycle_diagram.png
public class App implements ApplicationListener
{
public void resume() { }
public void resize(int width, int height) { }
public void render(){ }
public void pause(){ }
public void dispose(){ }
public void create(){ }
}
6. Getting Started - Android
1. create Android Project
2. copy libGDX to libs/
3. <uses-sdk minSdkVersion="3" targetSdkVersion="8"/>
4. Java Build Path
gdx.jar, gdx-backend-android.jar
Desktop Project
public class HelloWorldAndroid extends AndroidApplication {
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
initialize(new App(), false /*Gl 2.0*/);
}
}
7. Assets and Input
File API
Classpath, File system
Asset folder data/
AssetManager
Texture-, Fixture-, TileAtlas
Json- and XML Processing
Polling and event-based Input
Remote Input, compass and accelerometer
8. Graphics
OpenGL ES 1.0, 1.1 and 2.0
Shaders, Framebuffer Objects, Mipmaps
Batched and cached sprite rendering
Particle System, TMX tile map rendering
2D scene graph with tweening framework
OBJ and MD5 model loaders
soon FBX/Collada
Key-frame and skeletal animation
Ortographic and perspective camera
9. Miscellaneous
Custom Collections, Sorting
Preferences
Vector, Matrix and Quaternion classes
JNI wrapper of box2d
Shapes, intersection and overlap testing
Vibrator support
WAV, MP3 and OGG support
Playback and recording
AdWhirl, Admob
GDX-JNIGEN