本文整理匯總了Java中com.badlogic.gdx.Gdx.app方法的典型用法代碼示例。如果您正苦於以下問題:Java Gdx.app方法的具體用法?Java Gdx.app怎麽用?Java Gdx.app使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類com.badlogic.gdx.Gdx
的用法示例。
在下文中一共展示了Gdx.app方法的5個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: setup
import com.badlogic.gdx.Gdx; //導入方法依賴的package包/類
@Before
public void setup() {
Gdx.app = mock(Application.class);
engine = mock(PooledEngine.class);
when(engine.createComponent(HealthComponent.class)).thenReturn(new HealthComponent());
when(engine.createComponent(DamageComponent.class)).thenReturn(new DamageComponent());
ServiceLocator.appComponent = mock(AppComponent.class);
when(ServiceLocator.getAppComponent().getAudioService()).thenReturn(mock(AudioService.class));
ServiceLocator.entityComponent = mock(EntityComponent.class);
when(ServiceLocator.getEntityComponent().getEffectTextureFactory()).thenReturn(mock(EffectTextureFactory.class));
entity = mock(Entity.class);
fixture = new EffectComponent();
effect1 = Mockito.spy(BaseEffect.class);
when(effect1.tick(any(PooledEngine.class), any(Entity.class), any(EffectComponent.class), anyFloat())).thenReturn(false, false, false, true);
effect2 = Mockito.spy(BaseEffect.class);
}
示例2: setup
import com.badlogic.gdx.Gdx; //導入方法依賴的package包/類
@Before
public void setup() {
Gdx.app = mock(Application.class);
engine = mock(PooledEngine.class);
when(engine.createComponent(HealthComponent.class)).thenReturn(new HealthComponent());
when(engine.createComponent(DamageComponent.class)).thenReturn(new DamageComponent());
ServiceLocator.appComponent = mock(AppComponent.class);
when(ServiceLocator.getAppComponent().getAudioService()).thenReturn(mock(AudioService.class));
ServiceLocator.entityComponent = mock(EntityComponent.class);
when(ServiceLocator.getEntityComponent().getEffectTextureFactory()).thenReturn(mock(EffectTextureFactory.class));
entity = mock(Entity.class);
fixture = new InvulnerabilityEffect();
effectComponent = mock(EffectComponent.class);
}
示例3: init
import com.badlogic.gdx.Gdx; //導入方法依賴的package包/類
@BeforeClass
public static void init() {
// Note that we don't need to implement any of the listener's methods
Gdx.app = new HeadlessApplication(new ApplicationListener() {
@Override
public void create() {
}
@Override
public void resize(int width, int height) {
}
@Override
public void render() {
}
@Override
public void pause() {
}
@Override
public void resume() {
}
@Override
public void dispose() {
}
});
// Use Mockito to mock the OpenGL methods since we are running headlessly
Gdx.gl20 = Mockito.mock(GL20.class);
Gdx.gl = Gdx.gl20;
}
示例4: launchMainWindow
import com.badlogic.gdx.Gdx; //導入方法依賴的package包/類
private void launchMainWindow() {
// config for main window
Lwjgl3Application app = (Lwjgl3Application) Gdx.app;
Lwjgl3WindowConfiguration config = new Lwjgl3WindowConfiguration();
config.setTitle("GdxSplash");
config.setWindowIcon(Main.WINDOW_ICON);
config.setWindowedMode(1280, 720);
config.setWindowSizeLimits(1, 1, 9999, 9999);
// start main window and close this one
app.newWindow(new MainWindow(loadingTask.getTexture()), config);
window.closeWindow();
}
示例5: AndroidTextFieldDialog
import com.badlogic.gdx.Gdx; //導入方法依賴的package包/類
public AndroidTextFieldDialog() {
this.activity = (Activity)Gdx.app;
load();
}