当前位置: 首页>>代码示例>>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;未经允许,请勿转载。