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


Java Gdx.app方法代碼示例

本文整理匯總了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);
}
 
開發者ID:ezet,項目名稱:penguins-in-space,代碼行數:17,代碼來源:EffectComponentTest.java

示例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);
}
 
開發者ID:ezet,項目名稱:penguins-in-space,代碼行數:15,代碼來源:InvulnerabilityEffectTest.java

示例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;
}
 
開發者ID:MrStahlfelge,項目名稱:gdx-controllerutils,代碼行數:34,代碼來源:ControllerMappingsTest.java

示例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();
}
 
開發者ID:mbrlabs,項目名稱:gdx-splash,代碼行數:14,代碼來源:SplashScreen.java

示例5: AndroidTextFieldDialog

import com.badlogic.gdx.Gdx; //導入方法依賴的package包/類
public AndroidTextFieldDialog() {
	this.activity = (Activity)Gdx.app;
	load();
}
 
開發者ID:Anuken,項目名稱:Mindustry,代碼行數:5,代碼來源:AndroidTextFieldDialog.java


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