-
Notifications
You must be signed in to change notification settings - Fork 0
Hello world
Importing an existing project will help demonstrate the structure of a libgdx project, and also serves as an introduction into the development workflow.
All that is required is Eclipse with the Android SDK installed. Go to the Android SDK Instructions webpage for more details.
Download the helloworld.zip
source code at downloads page.
In Eclipse, go to File -> Import... -> General -> Existing Projects Into Workspace. In the Import Projects screen, click Select archive file, and browse to the helloworld.zip
. After that, make sure the gdx-helloworld
and gdx-helloworld-android
projects are found and selected, then click Finish.
The first project we'll look at, gdx-helloworld
, is where the game's code is located. You can run it as a stand-alone Java Desktop application, that is, it requires no simulator or Android handset. To run the application, in your Package Explorer view, right click on the gdx-helloworld
folder, select Run As -> Java Application. If a dialog pops up, asking for the main class, select HelloWorldDesktop
. The Hello World
desktop application should start up:
The gdx-helloworld-android
project adds a thin layer of code ontop of gdx-helloworld
to allow it to run on an Android device. If you look at its src
source directory, you'll see that it contains very code. That's because the project references everything from gdx-helloworld
. To run the application, in your Package Explorer view, right-click on the gdx-helloworld-android
folder and select Run As -> Android Application. At this point, the application will be loaded and run on a compatible simulator (i.e. Android Virtual Device), or a Android device connected to the computer:
Since the Android simulator is too slow to properly test games with, being able to run the game as a desktop application helps streamline the development process. Developers avoid having to load the game onto a device every time they want to preview it. Furthermore, a team of developers and designers can more quickly test and share changes with one another.
You can experiment with this process by making some changes to gdx-helloworld
project, then running it as a desktop application. When you're happy with the end result, see how your changes look on Android when by running gdx-helloworld-android
. A more pain-free development process is just one of the advantages of libgdx. Keep an eye out for upcoming tutorials about the different features of libgdx.
-
Developer's Guide
- Introduction
- Goals & Features
- Community & Support
- Contributing
- Games Built with Libgdx
- Prerequisites
- Gradle Project Setup, Running, Debugging and Packaging
- Project Setup, Running & Debugging
- Third Party Services
- Working from Source
- Using libgdx with other JVM languages
- The Application Framework
- A Simple Game
- File Handling
- Networking
- Preferences
- Input Handling
- Memory Management
- Audio
-
Graphics
- Configuration & Querying Graphics ??
- Fullscreen & VSync
- Continuous & Non-Continuous Rendering
- Clearing the Screen
- Take a Screenshot
- OpenGL ES Support * Configuration & Querying OpenGL ?? * Direct Access ?? * Utility Classes * Rendering Shapes * Textures & TextureRegions * Meshes * Shaders * Frame Buffer Objects
- 2D Graphics * SpriteBatch, TextureRegions, and Sprite * 2D Animation * Clipping, with the use of ScissorStack * Orthographic camera * Mapping Touch Coordinates ?? * Viewports * NinePatches * Bitmap Fonts * Distance field fonts * Using TextureAtlases * Pixmaps * Packing Atlases Offline * Packing Atlases at Runtime * 2D Particle Effects * Tile Maps * scene2d * scene2d.ui * Skin
- 3D Graphics * Quick Start * Models * Material and environment * 3D animations and skinning * Importing Blender models in LibGDX * Perspective Camera ?? * Picking ??
- Managing Your Assets
- Utilities
-
Math Utilities
- Interpolation
- Vectors, Matrices, Quaternions
- Circles, Planes, Rays, etc.
- Path interface & Splines
- Bounding Volumes ??
- Intersection & Overlap Testing ??
- Physics
- Tools
- Extensions
- Deploying your Application
- Building Libgdx ??
- Known Issues
- Articles
- Deprecated (May be outdated)