本文整理匯總了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);
}