com.badlogic.gdx.ApplicationAdapter Java Examples

The following examples show how to use com.badlogic.gdx.ApplicationAdapter. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: DialogSceneComposerJavaBuilder.java    From skin-composer with MIT License 6 votes vote down vote up
public static String generateJavaFile() {
    nodeClassName = ClassName.get(rootActor.packageString + "." + rootActor.classString, "BasicNode");
    
    TypeSpec.Builder typeSpec = TypeSpec.classBuilder(rootActor.classString)
            .addModifiers(Modifier.PUBLIC)
            .superclass(ApplicationAdapter.class)
            .addField(Skin.class, "skin", javax.lang.model.element.Modifier.PRIVATE)
            .addField(Stage.class, "stage", Modifier.PRIVATE)
            .addMethod(createMethod())
            .addMethod(renderMethod())
            .addMethod(resizeMethod())
            .addMethod(disposeMethod());
    
    if (rootActor.hasChildOfTypeRecursive(SimTree.class)) {
        typeSpec.addType(basicNodeType());
    }

    JavaFile javaFile = JavaFile.builder(rootActor.packageString, typeSpec.build())
            .indent("    ")
            .build();
    
    return javaFile.toString();
}
 
Example #2
Source File: DtdSchemaGenerator.java    From gdx-vfx with Apache License 2.0 5 votes vote down vote up
public static void main(String[] args) {
    Lwjgl3ApplicationConfiguration config = new Lwjgl3ApplicationConfiguration();
    config.disableAudio(true);
    config.setWindowedMode(1, 1);
    config.setTitle("");
    config.setInitialBackgroundColor(Color.VIOLET);

    new Lwjgl3Application(new ApplicationAdapter() {
        private Skin skin;

        @Override
        public void create() {
            skin = createSkin();
            LmlUtils.saveDtdSchema(new LmlParserBuilder(new DefaultLmlData())
                            .syntax(new CommonLmlSyntax())
                            .skin(skin)
                            .build(),
                    Gdx.files.local("demo/dtd/common.dtd"));
            Gdx.app.exit();
        }

        @Override
        public void dispose() {
            skin.dispose();
            skin = null;
        }
    }, config);
}
 
Example #3
Source File: AOTextureGenerator.java    From Cubes with MIT License 5 votes vote down vote up
public static void main(final String[] args) {
  new HeadlessApplication(new ApplicationAdapter() {
    @Override
    public void create() {
      generate(Gdx.files.absolute(new File("ao-texture.png").getAbsolutePath()));
      System.exit(0);
    }
  });
}