Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

GdxSetup: Update generated main class to look more modern #7353

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
Binary file not shown.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Original file line number Diff line number Diff line change
@@ -1,25 +1,30 @@
package %PACKAGE%;

import com.badlogic.gdx.ApplicationAdapter;
import com.badlogic.gdx.Gdx;
import com.badlogic.gdx.graphics.Texture;
import com.badlogic.gdx.graphics.g2d.SpriteBatch;
import com.badlogic.gdx.math.Vector2;
import com.badlogic.gdx.utils.ScreenUtils;

public class %MAIN_CLASS% extends ApplicationAdapter {
SpriteBatch batch;
Texture img;
Vector2 imgPos = new Vector2();

@Override
public void create () {
batch = new SpriteBatch();
img = new Texture("badlogic.jpg");
img = new Texture("logo_dark.png");
imgPos.x = (Gdx.graphics.getWidth() - img.getWidth()) / 2f;
imgPos.y = (Gdx.graphics.getHeight() - img.getHeight()) / 2f;
}

@Override
public void render () {
ScreenUtils.clear(1, 0, 0, 1);
ScreenUtils.clear(0.14f, 0.14f, 0.14f, 1);
batch.begin();
batch.draw(img, 0, 0);
batch.draw(img, imgPos.x, imgPos.y);
batch.end();
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -270,7 +270,7 @@ public void build (ProjectBuilder builder, String outputDir, String appName, Str
}

// Assets
project.files.add(new ProjectFile("assets/badlogic.jpg", assetPath + "/badlogic.jpg", false));
project.files.add(new ProjectFile("assets/logo_dark.png", assetPath + "/logo_dark.png", false));

// android project
if (builder.modules.contains(ProjectType.ANDROID)) {
Expand Down