-
Notifications
You must be signed in to change notification settings - Fork 0
Gradle and Intellij IDEA
You just generated your libgdx project, now it's time to start developing its guts in Intellij IDEA! Before you can import your project into Eclipse, make sure you setup your development environment!
Go to Import Project
, navigate to your project folder and select the build.gradle
file. Hit OK
. In the next dialog, leave all settings as they are and hit OK
again. Intellij IDEA will now import your project. This can take a while on the first time, as it downloads the Gradle wrapper and some dependencies.
-
Desktop:
Run -> Edit Configurations...
, click the plus (+) button and selectApplication
. Set theName
toDesktop
.Set the fieldUse classpath of module
todesktop
, then click on the button of theMain class
field and select theDesktopLauncher
class. Set theWorking directory
to yourandroid/assets/
folder! ClickApply
and thenOK
. You have now created a run configuration for your desktop project. You can now select the configuration and run it. - Android: A configuration for the Android project should be automatically created on project import. As such, you only have to select the configuration and run it!
-
iOS:
Run -> Edit Configurations...
, click the plus (+) button and selectGradle
. Set theName
toiOS
, set theGradle Project
toios
, set theTasks
tolaunchIPhoneSimulator
(alternatives arelaunchIPadSimulator
andlaunchIOSDevice
for provisioned devices). ClickApply
and thenOK
. You have now created a run configuration for your iOS project. You can now select the configuration and run it. The first run will take a bit longer as RoboVM has to compile the entire JDK for iOS. Subsequent runs will compile considerably faster!
-
HTML:
Run -> Edit Configurations...
, click the plus (+) button and selectGradle
. Set theName
toHTML
, set theGradle Project
togwt
, set theTasks
tosuperDev
. ClickApply
and thenOK
. You have now created a run configuration for your iOS project. You can now select the configuration and run it. 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 the run (Play) button, launch your configuration via the debug (bug) button. 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 task within Intellij IDEA. 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)