本文整理汇总了Java中com.badlogic.gdx.ApplicationAdapter类的典型用法代码示例。如果您正苦于以下问题:Java ApplicationAdapter类的具体用法?Java ApplicationAdapter怎么用?Java ApplicationAdapter使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
ApplicationAdapter类属于com.badlogic.gdx包,在下文中一共展示了ApplicationAdapter类的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: joiningAdapter
import com.badlogic.gdx.ApplicationAdapter; //导入依赖的package包/类
private ApplicationListener joiningAdapter() {
return new ApplicationAdapter() {
TcpServerInterface server;
ClientGame game;
@Override
public void create() {
server = new TcpServerInterface(new Log("tcp"), settings.serverIP, settings.port);
game = new ClientGame(settings, server);
game.start();
}
@Override
public void render() {
game.render();
}
@Override
public void dispose() {
game.kill();
}
};
}
示例2: createFont
import com.badlogic.gdx.ApplicationAdapter; //导入依赖的package包/类
public void createFont(final File fntFile, final String name, final int size, final boolean isBold, final boolean isItalic) {
final JFrame frame = new JFrame() {{
pack();
setDefaultCloseOperation(WindowConstants.DISPOSE_ON_CLOSE); // IMPORTANT
}};
frame.getContentPane().add(new MyLwjglCanvas(new ApplicationAdapter() {
private final UnicodeFont unicodeFont = new UnicodeFont(Font.decode(name), size, isBold, isItalic);
@Override
public void create() {
unicodeFont.setMono(false);
unicodeFont.setPaddingTop(PADDING);
unicodeFont.setPaddingRight(PADDING);
unicodeFont.setPaddingBottom(PADDING);
unicodeFont.setPaddingLeft(PADDING);
unicodeFont.setPaddingAdvanceX(-2 * PADDING);
unicodeFont.setPaddingAdvanceY(-2 * PADDING);
unicodeFont.setGlyphPageWidth(1024);
unicodeFont.setGlyphPageHeight(512);
unicodeFont.setRenderType(UnicodeFont.RenderType.Java);
List effects = unicodeFont.getEffects();
effects.add(new ColorEffect(Color.white));
unicodeFont.addGlyphs(CHARACTERS);
try {
FileUtil.createNewFile(fntFile);
new BMFontUtil(unicodeFont).save(fntFile);
} catch (Throwable ex) {
ex.printStackTrace();
}
if ("studio".equals(System.getProperty("featurea.launcher"))) {
frame.dispose();
} else {
frame.setVisible(false);
}
}
}).getCanvas());
}
示例3: hostingAdapter
import com.badlogic.gdx.ApplicationAdapter; //导入依赖的package包/类
private ApplicationListener hostingAdapter() {
return new ApplicationAdapter() {
LocalServerInterface localInterface;
TcpServerWrapper wrapper;
ClientGame game;
@Override
public void create() {
SessionConfig sessionConfig = new SessionConfig(settings.teamsOn);
Log serverLog = new Log("server");
Log tcpLog = new Log("tcp");
localInterface = ServerThread.startServer(serverLog, sessionConfig);
wrapper = new TcpServerWrapper(tcpLog, localInterface, settings.port);
wrapper.start();
game = new ClientGame(settings, localInterface);
game.start();
}
@Override
public void render() {
game.render();
}
@Override
public void dispose() {
game.kill();
localInterface.shutdown();
wrapper.shutdown();
}
};
}
示例4: GdxAppStub
import com.badlogic.gdx.ApplicationAdapter; //导入依赖的package包/类
public GdxAppStub() {
appListener = new ApplicationAdapter() {
};
}