-
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). The application will fail the first time. Open the Run Configuration you just created and set the working directory to theandroid/assets/
directory! -
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!
Follow the steps for running the project, but instead of launching via Run as
, launch your configuration via Debug as
. Note that RoboVM currently does not support debugging. Debuggin of the GWT build can be done in the browser as follows:
Run the superDev Gradle task as before. Go to http://localhost:8080/gwt, click on the Dev Mode On
boorkmarklet and hit Compile
. In Chrome, press F12
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 using the Gradle tasks from 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)