Added hello world libGDX example.
This commit is contained in:
parent
bd923f1a76
commit
37fa029e9e
31
core/src/love/distributedrebirth/demo4d/MainScreen.java
Normal file
31
core/src/love/distributedrebirth/demo4d/MainScreen.java
Normal file
|
@ -0,0 +1,31 @@
|
||||||
|
package love.distributedrebirth.demo4d;
|
||||||
|
|
||||||
|
import com.badlogic.gdx.ApplicationAdapter;
|
||||||
|
import com.badlogic.gdx.graphics.g2d.BitmapFont;
|
||||||
|
import com.badlogic.gdx.graphics.g2d.SpriteBatch;
|
||||||
|
import com.badlogic.gdx.utils.ScreenUtils;
|
||||||
|
|
||||||
|
public class MainScreen extends ApplicationAdapter {
|
||||||
|
SpriteBatch batch;
|
||||||
|
BitmapFont font;
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void create () {
|
||||||
|
batch = new SpriteBatch();
|
||||||
|
font = new BitmapFont();
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void render () {
|
||||||
|
ScreenUtils.clear(1, 0, 0, 1);
|
||||||
|
batch.begin();
|
||||||
|
font.draw(batch, "Hello World.", 33, 33);
|
||||||
|
batch.end();
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void dispose () {
|
||||||
|
batch.dispose();
|
||||||
|
font.dispose();
|
||||||
|
}
|
||||||
|
}
|
|
@ -0,0 +1,12 @@
|
||||||
|
package love.distributedrebirth.demo4d.desktop;
|
||||||
|
|
||||||
|
import com.badlogic.gdx.backends.lwjgl.LwjglApplication;
|
||||||
|
import com.badlogic.gdx.backends.lwjgl.LwjglApplicationConfiguration;
|
||||||
|
import love.distributedrebirth.demo4d.MainScreen;
|
||||||
|
|
||||||
|
public class DesktopLauncher {
|
||||||
|
public static void main (String[] arg) {
|
||||||
|
LwjglApplicationConfiguration config = new LwjglApplicationConfiguration();
|
||||||
|
new LwjglApplication(new MainScreen(), config);
|
||||||
|
}
|
||||||
|
}
|
Loading…
Reference in a new issue