當前位置: 首頁>>代碼示例>>Java>>正文


Java ApplicationAdapter類代碼示例

本文整理匯總了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();
        }
    };
}
 
開發者ID:thorinii,項目名稱:MountainRangePvP,代碼行數:25,代碼來源:Main.java

示例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());
}
 
開發者ID:dmitrykolesnikovich,項目名稱:featurea,代碼行數:38,代碼來源:FontCreator.java

示例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();
        }
    };
}
 
開發者ID:thorinii,項目名稱:MountainRangePvP,代碼行數:35,代碼來源:Main.java

示例4: GdxAppStub

import com.badlogic.gdx.ApplicationAdapter; //導入依賴的package包/類
public GdxAppStub() {
    appListener = new ApplicationAdapter() {
    };
}
 
開發者ID:anonl,項目名稱:nvlist,代碼行數:5,代碼來源:GdxAppStub.java


注:本文中的com.badlogic.gdx.ApplicationAdapter類示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。