-
Notifications
You must be signed in to change notification settings - Fork 0
Gradle and Eclipse
You just generated your libgdx project, now it's time to start developing its guts in Eclipse! Before you can import your project into Eclipse, make sure you setup your development environment!
Go to File -> Import -> Gradle -> Gradle Project
, click Browse and navigate to the root folder of your project, then click Build Model
. After a while, you'll see a root project and subprojects (android, core, desktop, gwt, ios). Select all the projects and click Finish
. Note that this process can take a minute or two the first time you do it, as Gradle and some dependencies will be downloaded in the background.
-
Desktop: Right click the desktop project,
Run As -> Java Application
. Select the desktop starter class (e.g. DesktopLauncher.java). -
Android: make sure you have a device connected and that it shows up in DDMS (see Android Developer Guide). Right click your Android project,
Run As -> Android Application
. -
iOS RoboVM: Right click the robovm project,
Run As -> iOS Device App
to run on a connected device, orRun As -> iOS Simulator App
to run on the iOS simulator. If you run on a device, you need to provision it to be able to deploy to it! -
HTML5: Right click the gwt project,
Run As -> Gradle Build ...
. SelectsuperDev
mode from the list, clickApply
andRun
. You can now follow the build process in the console. This will take a while, as your Java code is compiled to Javascript. Once you see the messageThe code server is ready
, fire up your browser and go to http://localhost:9876. Drag theDev Mode On
bookmarklet to your browser bar. You only have to do this once! Next, go to http://localhost:8080/gwt. This is your app running in the browser! When you change any of your Java code, just click theDev Mode On
bookmarklet while you are on the site and the server at port 9876 will recompile your code and reload the page!
-
Desktop: Right click the desktop project,
Debug As -> Java Application
. Select the desktop starter class (e.g. Main.java). Set breakpoints where you need them, hot swap code (edit & save while debugging) to quickly test changes without restarting the app. -
Android: assuming you have a device connected,
Debug As -> Android Application
. Hot swapping is not supported, but you can use the DDMS perspective to check your memory usage, profile your application and so on. Refer to the Android Development Guide for more information. - iOS RoboVM: debugging is currently not supported by RoboVM
-
HTML5: Right click the gwt project,
Run As -> Gradle Build ...
. SelectsuperDev
mode from the list, clickApply
andRun
. You can now follow the build process in the console. This will take a while, as your Java code is compiled to Javascript. Once you see the messageThe code server is ready
, fire up your browser and go to http://localhost:9876. Drag theDev Mode On
bookmarklet to your browser bar. You only have to do this once! Next, go to http://localhost:8080/gwt. This is your app running in the browser! Click on theDev Mode On
boorkmarklet and hitCompile
. In Chrome, pressF12
to bring up the developer tools, go to the sources tab and find the Java file you want to debug. Set breakpoints, step and inspect variables using the power of source maps!
It's easiest to package your application from the command line, or use Gradle task within Eclipse. To see the relevant Gradle tasks, check the Gradle command line documentation.
-
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)