当前位置: 首页>>代码示例>>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;未经允许,请勿转载。