Starter classes
A starter class defines the entry point (starting point) of a LibGDX application. It is specifically written for a certain platform. Usually, these kinds of classes are very simple and mostly consist of not more than a few lines of code to set certain parameters that apply to the corresponding platform. Think of them as a kind of bootup sequence for each platform. Once booting is finished, the LibGDX framework hands over control from the starter class (for example, the demo-desktop
project) to your shared application code (for example, the demo
/demo-core
project) by calling different methods from the ApplicationListener
interface that the MyDemo
class implements. Remember that the MyDemo
class is where the shared application code begins.
We will now take a look at each of the starter classes that were generated during the project setup.
Running the demo application on a desktop
The starter class for the desktop application is called Main.java
. The following listing is Main...