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