當前位置: 首頁>>代碼示例>>Java>>正文


Java ApplicationListener類代碼示例

本文整理匯總了Java中com.badlogic.gdx.ApplicationListener的典型用法代碼示例。如果您正苦於以下問題:Java ApplicationListener類的具體用法?Java ApplicationListener怎麽用?Java ApplicationListener使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。


ApplicationListener類屬於com.badlogic.gdx包,在下文中一共展示了ApplicationListener類的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: init

import com.badlogic.gdx.ApplicationListener; //導入依賴的package包/類
@BeforeClass
public static void init() {
    // Note that we don't need to implement any of the listener's methods
    application = new HeadlessApplication(new ApplicationListener() {
        @Override public void create() {}
        @Override public void resize(int width, int height) {}
        @Override public void render() {}
        @Override public void pause() {}
        @Override public void resume() {}
        @Override public void dispose() {}
    });

    // Use Mockito to mock the OpenGL methods since we are running headlessly
    Gdx.gl20 = Mockito.mock(GL20.class);
    Gdx.gl = Gdx.gl20;
}
 
開發者ID:AndreFCruz,項目名稱:feup-lpoo-armadillo,代碼行數:17,代碼來源:GameTest.java

示例2: createApplicationListener

import com.badlogic.gdx.ApplicationListener; //導入依賴的package包/類
@Override
public ApplicationListener createApplicationListener () {
        return new GftGame();
}
 
開發者ID:B4sileus,項目名稱:guitar-finger-trainer,代碼行數:5,代碼來源:HtmlLauncher.java

示例3: createApplicationListener

import com.badlogic.gdx.ApplicationListener; //導入依賴的package包/類
@Override
 public ApplicationListener createApplicationListener () {
  RavTech ravtech = new RavTech(new HtmlEngineConfiguration());
  HookApi.addHook("onBoot", new Hook() {
		  @Override
		  public void run() {
			  RavTech.files.loadAsset("map.scene", Scene.class);
			  RavTech.files.finishLoading();
			  RavTech.currentScene = RavTech.files.getAsset("map.scene", Scene.class);
		  }
	  });
  HookApi.addHook("onUpdate", new Hook() {
	int i = 0;
	@Override
	public void run() {
		i++;
		GameObject.find("Camera").transform.setLocalPosition(0, (float)(Math.sin(i * 0.01) * 5));
	}
});

    return ravtech;
 }
 
開發者ID:Quexten,項目名稱:RavTech,代碼行數:23,代碼來源:HtmlLauncher.java

示例4: createApplicationListener

import com.badlogic.gdx.ApplicationListener; //導入依賴的package包/類
@Override
 public ApplicationListener createApplicationListener() {
     instance = this;
     setLogLevel(LOG_NONE);
     setLoadingListener(new LoadingListener() {
         @Override
         public void beforeSetup() {

         }

         @Override
         public void afterSetup() {
             scaleCanvas();
             setupResizeHook();
         }
     });

     Net.setClientProvider(new WebsocketClient());
     
     Mindustry.platforms = new PlatformFunction(){
     	DateTimeFormat format = DateTimeFormat.getFormat("EEE, dd MMM yyyy HH:mm:ss");

@Override
public String format(Date date){
	return format.format(date);
}

@Override
public String format(int number){
	return NumberFormat.getDecimalFormat().format(number);
}

@Override
public void openLink(String link){
	Window.open(link, "_blank", "");
}
     };
     
     return new Mindustry();
 }
 
開發者ID:Anuken,項目名稱:Mindustry,代碼行數:41,代碼來源:HtmlLauncher.java

示例5: createApplicationListener

import com.badlogic.gdx.ApplicationListener; //導入依賴的package包/類
@Override
public ApplicationListener createApplicationListener () {
        return new Game(new Advertisements() {
                @Override
                public void showAds() {

                }
        });
}
 
開發者ID:MrGussio,項目名稱:EarthInvadersGDX,代碼行數:10,代碼來源:HtmlLauncher.java

示例6: run

import com.badlogic.gdx.ApplicationListener; //導入依賴的package包/類
@Override
protected void run(ApplicationListener applicationListener) {
  HeadlessApplicationConfiguration config = new HeadlessApplicationConfiguration();
  config.renderInterval = -1; // internal loop called from within create()
  
  new HeadlessApplication(applicationListener, config);
}
 
開發者ID:RedTroop,項目名稱:Cubes_2,代碼行數:8,代碼來源:ServerCompatibility.java

示例7: run

import com.badlogic.gdx.ApplicationListener; //導入依賴的package包/類
@Override
protected void run(ApplicationListener applicationListener) {
	AndroidApplicationConfiguration config = new AndroidApplicationConfiguration();
	config.useAccelerometer = false;
	config.useCompass = false;
	config.useWakelock = true;
	config.useImmersiveMode = true;
	androidLauncher.initialize(applicationListener, config);
}
 
開發者ID:RedTroop,項目名稱:Cubes_2,代碼行數:10,代碼來源:AndroidCompatibility.java

示例8: init

import com.badlogic.gdx.ApplicationListener; //導入依賴的package包/類
@BeforeClass
public static void init() {
    // Note that we don't need to implement any of the listener's methods
    Gdx.app = new HeadlessApplication(new ApplicationListener() {
        @Override
        public void create() {
        }

        @Override
        public void resize(int width, int height) {
        }

        @Override
        public void render() {
        }

        @Override
        public void pause() {
        }

        @Override
        public void resume() {
        }

        @Override
        public void dispose() {
        }
    });

    // Use Mockito to mock the OpenGL methods since we are running headlessly
    Gdx.gl20 = Mockito.mock(GL20.class);
    Gdx.gl = Gdx.gl20;
}
 
開發者ID:MrStahlfelge,項目名稱:gdx-controllerutils,代碼行數:34,代碼來源:ControllerMappingsTest.java

示例9: run

import com.badlogic.gdx.ApplicationListener; //導入依賴的package包/類
@Override
protected void run(ApplicationListener applicationListener) {
  AndroidApplicationConfiguration config = new AndroidApplicationConfiguration();
  config.useAccelerometer = false;
  config.useCompass = false;
  config.useWakelock = true;
  config.useImmersiveMode = true;
  androidLauncher.initialize(applicationListener, config);
}
 
開發者ID:RedTroop,項目名稱:Cubes,代碼行數:10,代碼來源:AndroidCompatibility.java

示例10: initialize

import com.badlogic.gdx.ApplicationListener; //導入依賴的package包/類
@Override
public void initialize(ApplicationListener listener, AndroidApplicationConfiguration config){
    //Las siguientes dos lines son necesaria para poder añadir markers de la manera que ARToolKit lo maneja
    AssetHelper assetHelper = new AssetHelper(getAssets());
    assetHelper.cacheAssetFolder(this, "Data");

    mainLayout = new FrameLayout(this);
    config.r = 8;
    config.g = 8;
    config.b = 8;
    config.a = 8;

    //Configuraciones basicas
    requestWindowFeature(Window.FEATURE_NO_TITLE);
    getWindow().addFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN);
    getWindow().setFormat(PixelFormat.TRANSLUCENT);
    getWindow().addFlags(WindowManager.LayoutParams.FLAG_KEEP_SCREEN_ON);
    setRequestedOrientation(ActivityInfo.SCREEN_ORIENTATION_LANDSCAPE);

    gameView = initializeForView(listener, config);

    if(graphics.getView() instanceof SurfaceView){
        SurfaceView glView = (SurfaceView)graphics.getView();
        glView.getHolder().setFormat(PixelFormat.TRANSLUCENT);
    }

    setContentView(mainLayout);
}
 
開發者ID:GLUD,項目名稱:trascendentAR,代碼行數:29,代碼來源:ARLauncher.java

示例11: createApplicationListener

import com.badlogic.gdx.ApplicationListener; //導入依賴的package包/類
@Override
public ApplicationListener createApplicationListener () {
        return new JGame();
}
 
開發者ID:MusicDev33,項目名稱:JGame,代碼行數:5,代碼來源:HtmlLauncher.java

示例12: createApplicationListener

import com.badlogic.gdx.ApplicationListener; //導入依賴的package包/類
@Override
public ApplicationListener createApplicationListener () {
        return new GdxArtemisGame();
}
 
開發者ID:DaanVanYperen,項目名稱:odb-dynasty,代碼行數:5,代碼來源:HtmlLauncher.java

示例13: SwingTestRunner

import com.badlogic.gdx.ApplicationListener; //導入依賴的package包/類
public SwingTestRunner() {
        logger.info("Starting application");


        LwjglApplicationConfiguration configuration = new LwjglApplicationConfiguration();
        configuration.width = 1200;
        configuration.height = 900;
        configuration.samples = 4;

        logger.info("Config is: {}x{}", configuration.width, configuration.height);

        ApplicationListener app = new WheelRenderer();
        lwjglCanvas = new LwjglCanvas(app, configuration);


        logger.info("Application listener used is {}", app.getClass());

        setName("Test frame ooo");

        JButton b = new JButton("lol");
        b.addActionListener(e -> {
            logger.info("Button clicked");
//            ((WheelRenderer) app).doStuff();
//            lwjglCanvas.stop();
//            getContentPane().remove(lwjglCanvas.getCanvas());
        });

        Container c = getContentPane();
        lwjglCanvas.getCanvas().setBounds(0, 0, 1200, 900);
        b.setBounds(900, 0, 100, 900);
        c.add(lwjglCanvas.getCanvas(), BorderLayout.LINE_START);
        c.add(b, BorderLayout.CENTER);

        pack();
        setVisible(true);
        setSize(1300, 900);
        setDefaultCloseOperation(DISPOSE_ON_CLOSE);

    }
 
開發者ID:Matsemann,項目名稱:eamaster,代碼行數:40,代碼來源:SwingTestRunner.java

示例14: sizeChanged

import com.badlogic.gdx.ApplicationListener; //導入依賴的package包/類
void sizeChanged (int width, int height) {
	if (isMac) {
		glfwShowWindow(window); // This is required to refresh the NSOpenGLContext on OSX!
	}
	width = Math.max(1, width);
	height = Math.max(1, height);
	this.width = width;
	this.height = height;
	Gdx.gl.glViewport(0, 0, width, height);
	ApplicationListener listener = Gdx.app.getApplicationListener();
	if (listener != null) listener.resize(width, height);
	requestRendering();
}
 
開發者ID:Arcnor,項目名稱:gdx-backend-jglfw,代碼行數:14,代碼來源:JglfwGraphics.java

示例15: run

import com.badlogic.gdx.ApplicationListener; //導入依賴的package包/類
public static void run(final Class<? extends ApplicationListener> cl, ExecutorService executor) {
   executor.submit(new Callable<Integer>() {

      @Override
      public Integer call() throws Exception {
         return process.exec(AppRunner.class, cl);
      }

   });
}
 
開發者ID:bitbrain,項目名稱:braingdx,代碼行數:11,代碼來源:AppRunner.java


注:本文中的com.badlogic.gdx.ApplicationListener類示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。