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


Java PauseMenu類代碼示例

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


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

示例1: update

import ethanjones.cubes.graphics.menus.PauseMenu; //導入依賴的package包/類
@Override
public void update() {
  if (back) {
    back = false;
    Menu current = Adapter.getMenu();

    if (current instanceof MainMenu) {
      Adapter.quit();
      return;
    }

    if (current instanceof PauseMenu) {
      Adapter.gotoMainMenu();
      return;
    }

    if (Cubes.getClient() != null || Cubes.getServer() != null || current == null) {
      Adapter.setMenu(new PauseMenu());
      return;
    }

    Menu prev = MenuManager.getPrevious(current);
    if (prev == null) return;
    Adapter.setMenu(prev);
  }
}
 
開發者ID:RedTroop,項目名稱:Cubes,代碼行數:27,代碼來源:AndroidCompatibility.java

示例2: update

import ethanjones.cubes.graphics.menus.PauseMenu; //導入依賴的package包/類
@Override
public void update() {
	if (back) {
		back = false;
		Menu current = Adapter.getMenu();

		if (current instanceof MainMenu) {
			Adapter.quit();
			return;
		}

		if (current instanceof PauseMenu) {
			Adapter.gotoMainMenu();
			return;
		}

		if (Cubes.getClient() != null || Cubes.getServer() != null || current == null) {
			Adapter.setMenu(new PauseMenu());
			return;
		}

		Menu prev = MenuManager.getPrevious(current);
		if (prev == null)
			return;
		Adapter.setMenu(prev);
	}
}
 
開發者ID:RedTroop,項目名稱:Cubes_2,代碼行數:28,代碼來源:AndroidCompatibility.java

示例3: render

import ethanjones.cubes.graphics.menus.PauseMenu; //導入依賴的package包/類
@Override
public void render() {
	frameStart = System.nanoTime();
	if (shouldReturn()) {
		return;
	}
	if (worldReady) {
		Adapter.setMenu(null);
		worldReady = false;
	}
	if (Gdx.input.isKeyJustPressed(Input.Keys.ESCAPE) && !(Adapter.getMenu() instanceof WorldLoadingMenu)) {
		if (InventoryManager.isInventoryOpen()) {
			InventoryManager.hideInventory();
		} else if (Adapter.getMenu() instanceof PauseMenu) {
			Adapter.setMenu(null);
		} else {
			Adapter.setMenu(new PauseMenu());
		}
	}
	Performance.start(PerformanceTags.CLIENT_FRAME);

	ClientDebug.frameStart();

	long diff = nextTickTime - System.currentTimeMillis();

	renderDiff(diff);

	this.update();
	inputChain.beforeRender();
	renderer.render();
	inputChain.afterRender();
	Performance.stop(PerformanceTags.CLIENT_FRAME);
}
 
開發者ID:RedTroop,項目名稱:Cubes_2,代碼行數:34,代碼來源:CubesClient.java

示例4: render

import ethanjones.cubes.graphics.menus.PauseMenu; //導入依賴的package包/類
@Override
public void render() {
  frameStart = System.nanoTime();
  if (shouldReturn()) return;
  if (worldReady) {
    Adapter.setMenu(null);
    worldReady = false;
  }
  if (Gdx.input.isKeyJustPressed(Input.Keys.ESCAPE) && !(Adapter.getMenu() instanceof WorldLoadingMenu)) {
    if (InventoryManager.isInventoryOpen()) {
      InventoryManager.hideInventory();
    } else if (Adapter.getMenu() instanceof PauseMenu) {
      Adapter.setMenu(null);
    } else {
      Adapter.setMenu(new PauseMenu());
    }
  }
  Performance.start(PerformanceTags.CLIENT_FRAME);

  ClientDebug.frameStart();
  
  long diff = nextTickTime - System.currentTimeMillis();
  if (diff < -16) {
    int change = 1 + (int) (-(diff + 16)  / tickMS);
    behindTicks += change;
    nextTickTime += change * tickMS;
    diff = nextTickTime - System.currentTimeMillis();
  }
  if (diff < 2) {
    tick();
    nextTickTime += tickMS;
  } else if (behindTicks > 0) {
    tick();
    behindTicks--;
  }
  if (behindTicks >= (1000 / tickMS)) {
    Log.warning("Skipping " + behindTicks + " ticks");
    behindTicks = 0;
    nextTickTime += behindTicks * tickMS;
  }
  
  this.update();
  inputChain.beforeRender();
  renderer.render();
  inputChain.afterRender();
  Performance.stop(PerformanceTags.CLIENT_FRAME);
}
 
開發者ID:RedTroop,項目名稱:Cubes,代碼行數:48,代碼來源:CubesClient.java


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