本文整理汇总了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);
}
}
示例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);
}
}
示例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);
}
示例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);
}