LIBGDX Environment Construction

Source: Internet
Author: User
Tags libgdx

1: Environment construction:

(1) First enter the official website,http://libgdx.badlogicgames.com/download.html Click on the releases below, to download the latest version can be. This is for us to develop the use of the jar and so library, if we are purely development, do not want to see the source code, then download this one.

(2) Source code download:

Click Source on the top page to go to the GitHub Libgdx homepage andhttps://github.com/libgdx/libgdx find the download zip on the right to download it.

Source reading, using source Insight can be.

Down we unzip (1) Download the compressed file down.

The directory is:


Catalogue Description:

Armeabi armeabi-v7a developed so library for mobile phones

Docs for Documentation

Extensions extended three-party library

Sources Jar Source Code

x86 Windows Development Library

Ios Apple Development Library

The following jar package is the jar library file we need to introduce

One of the Gdx-setup.jar has developed a graphical interface for our operations.

(3) Download Java environment setup.

Go to the homepage to find the latest JDK for download http://www.oracle.com/technetwork/java/javase/downloads/index.html, download it and install it

(4) Go to the Android homepage to download the latest SDK package to download the ECLIPSE-JAVA-HELIOS-SR2-WIN32 environment. Eclipse has been developing a development environment for Android behind us.

After doing this, our preparation environment is complete. We started the demo operation, familiar with the engine.

Double-click the Gdx-setup.jar file and the following interface appears:


Here we make a selection, set our package name, class name, generate path, where the Android SDK is set to our Android SDK home directory. Then we can choose the platform, by default is all checked, if only want to do android, remove the tick except android .

Click Build, at this time the first generation will be longer, because the system to go down the need for the jar Library, my side for the first time to use about minutes, the final generation success.

This generates only the Android version, the specific directory is:

The Androi directory is:

Now that we are really developing in the core directory,theandroid directory exists just to build the Android platform framework.

We're going to beEclipsewillAndroidCatalog Import, here's a problem that's been generated.Lib, so we need toGdx-jarand theGdx-backend-android.jarput inLibsdirectory, and then we need toCorecompile configuration toAndroidenvironment inside, my side of the operation is tocore\srcCopy the file below to theandroid\srcIn the development of the inside.

2 demo View:

Src\com\mygdx\game\android inside the androidlauncher.java main interface, we open to see:

public class Androidlauncher extends Androidapplication {@Overrideprotected void onCreate (Bundle savedinstancestate) { Super.oncreate (savedinstancestate); androidapplicationconfiguration config = new androidapplicationconfiguration (); Initialize (new Mygdxgame (), config);}}


Key functions:

Initialize (new Mygdxgame (), config);


So we're going to mount our main game class.

We open the main class



Key functions:

Render () This function will be called all the time, and all of our game propulsion is done here.

Down I say the whole process:

System inAndroidschema of the masterActivityinside, usingInitializeto inherit anApplicationadapterobject is hooked up, so after that, the systemInitializeinside WillAndroidabove theGlview, input, key, file, network, etc. initialization is complete, and then theGlviewof theOndrawframeIt's been called to register incoming snooping.Renderfunction. Ondrawframemechanism isAndroidprovided, has been called, to render, to drive the game process.

So down, when we develop the game, remember that we have been in a big loop, there has been a render call, that way, then we can just focus on the render , we actually develop, is to be carried out around this render , concrete can wait for the next section to explain.

Let's go over the engine frame in this section:

Website location:Https://github.com/libgdx/libgdx/wiki/Modules-overview

Let's say the game development ideas:

In a large loop, use the time to drive the game process, use touch, keys, or time to push the scene, process, Render, jump, and update the data.

The architecture provided in LIBGDX is:

The game class stage class and actor class.

Game to switch scenes, stage class for rendering, and processing messages, actor for stage actors, responsible for performance, change their behavior, display, thus the entire game implementation.


After doing so, you can build the apk to the phone to see the effect.




LIBGDX Environment Construction

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.