当前位置: 首页>>代码示例>>Java>>正文


Java MockInput类代码示例

本文整理汇总了Java中com.badlogic.gdx.backends.headless.mock.input.MockInput的典型用法代码示例。如果您正苦于以下问题:Java MockInput类的具体用法?Java MockInput怎么用?Java MockInput使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


MockInput类属于com.badlogic.gdx.backends.headless.mock.input包,在下文中一共展示了MockInput类的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: init

import com.badlogic.gdx.backends.headless.mock.input.MockInput; //导入依赖的package包/类
/**
 * Initializes a headless GDX platform for testing.
 */
public static synchronized void init() {
    if (Gdx.gl instanceof MockGL) {
        // Already initialized
        return;
    }

    HeadlessNativesLoader.load();
    Gdx.app = new GdxAppStub();
    Gdx.files = new HeadlessFiles();
    Gdx.net = new HeadlessNet();
    Gdx.graphics = new MockGraphics();
    Gdx.gl20 = MockGL.newInstance();
    Gdx.gl = Gdx.gl20;
    Gdx.audio = new MockAudio();
    Gdx.input = new MockInput();
}
 
开发者ID:anonl,项目名称:nvlist,代码行数:20,代码来源:HeadlessGdx.java

示例2: HeadlessApplication

import com.badlogic.gdx.backends.headless.mock.input.MockInput; //导入依赖的package包/类
public HeadlessApplication(ApplicationListener listener, HeadlessApplicationConfiguration config) {
	if (config == null)
		config = new HeadlessApplicationConfiguration();
	
	HeadlessNativesLoader.load();
	this.listener = listener;
	this.files = new HeadlessFiles();
	this.net = new HeadlessNet();
	// the following elements are not applicable for headless applications
	// they are only implemented as mock objects
	this.graphics = new MockGraphics();
	this.audio = new MockAudio();
	this.input = new MockInput();

	Gdx.app = this;
	Gdx.files = files;
	Gdx.net = net;
	Gdx.audio = audio;
	Gdx.graphics = graphics;
	Gdx.input = input;
	
	renderInterval = config.renderInterval > 0 ? (long)(config.renderInterval * 1000000000f) : (config.renderInterval < 0 ? -1 : 0);
	
	initialize();
}
 
开发者ID:basherone,项目名称:libgdxcn,代码行数:26,代码来源:HeadlessApplication.java

示例3: HeadlessMini2DxGame

import com.badlogic.gdx.backends.headless.mock.input.MockInput; //导入依赖的package包/类
public HeadlessMini2DxGame(GameContainer game, HeadlessMini2DxConfig config) {
	setApplicationLogger(new HeadlessApplicationLogger());
	
	this.config = config;
	listener = new HeadlessGameWrapper(game, config.gameIdentifier);

	this.files = new HeadlessFiles();
	this.net = new HeadlessNet();
	// the following elements are not applicable for headless applications
	// they are only implemented as mock objects
	this.graphics = new Mini2DxMockGraphics(config);
	this.audio = new MockAudio();
	this.input = new MockInput();
	initialiseLibGDX();
	if(config.runGame) {
		launchGame();
	} else {
		listener.create();
	}
}
 
开发者ID:mini2Dx,项目名称:mini2Dx,代码行数:21,代码来源:HeadlessMini2DxGame.java


注:本文中的com.badlogic.gdx.backends.headless.mock.input.MockInput类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。