本文整理汇总了Java中itdelatrisu.opsu.ui.UI.init方法的典型用法代码示例。如果您正苦于以下问题:Java UI.init方法的具体用法?Java UI.init怎么用?Java UI.init使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类itdelatrisu.opsu.ui.UI
的用法示例。
在下文中一共展示了UI.init方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: reinit
import itdelatrisu.opsu.ui.UI; //导入方法依赖的package包/类
private void reinit() {
// this used to be in Utils.init
// TODO find a better place for this?
setFPS(targetFPS[targetFPSIndex]);
MusicController.setMusicVolume(OPTION_MUSIC_VOLUME.val / 100f * OPTION_MASTER_VOLUME.val / 100f);
skinservice.loadSkin();
// initialize game images
for (GameImage img : GameImage.values()) {
if (img.isPreload()) {
img.setDefaultImage();
}
}
// TODO clean this up
GameMod.init(width, height);
PlaybackSpeed.init(width, height);
HitObject.init(width, height);
DownloadNode.init(width, height);
UI.init(this);
}
示例2: init
import itdelatrisu.opsu.ui.UI; //导入方法依赖的package包/类
/**
* Initializes game settings and class data.
* @param container the game container
* @param game the game object
*/
public static void init(GameContainer container, StateBasedGame game) {
input = container.getInput();
int width = container.getWidth();
int height = container.getHeight();
// game settings
container.setTargetFrameRate(Options.getTargetFPS());
container.setVSync(Options.getTargetFPS() == 60);
container.setMusicVolume(Options.getMusicVolume() * Options.getMasterVolume());
container.setShowFPS(false);
container.getInput().enableKeyRepeat();
container.setAlwaysRender(true);
container.setUpdateOnlyWhenVisible(false);
// record OpenGL version
ErrorHandler.setGlString();
// calculate UI scale
GameImage.init(width, height);
// create fonts
try {
Fonts.init();
} catch (Exception e) {
ErrorHandler.error("Failed to load fonts.", e, true);
}
// load skin
Options.loadSkin();
// initialize game images
for (GameImage img : GameImage.values()) {
if (img.isPreload())
img.setDefaultImage();
}
// initialize game mods
GameMod.init(width, height);
// initialize playback buttons
PlaybackSpeed.init(width, height);
// initialize hit objects
HitObject.init(width, height);
// initialize download nodes
DownloadNode.init(width, height);
// initialize UI components
UI.init(container, game);
// build user list
UserList.create();
// initialize user button
UserButton.init(width, height);
// warn about software mode
if (((Container) container).isSoftwareMode()) {
UI.getNotificationManager().sendNotification(
"WARNING:\n" +
"Running in OpenGL software mode.\n" +
"You may experience severely degraded performance.\n\n" +
"This can usually be resolved by updating your graphics drivers.",
Color.red
);
}
}