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


Java Application.ApplicationType方法代碼示例

本文整理匯總了Java中com.badlogic.gdx.Application.ApplicationType方法的典型用法代碼示例。如果您正苦於以下問題:Java Application.ApplicationType方法的具體用法?Java Application.ApplicationType怎麽用?Java Application.ApplicationType使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在com.badlogic.gdx.Application的用法示例。


在下文中一共展示了Application.ApplicationType方法的8個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: touchDown

import com.badlogic.gdx.Application; //導入方法依賴的package包/類
@Override
public boolean touchDown(int screenX, int screenY, int pointer, int button) {
    Application.ApplicationType type = Gdx.app.getType();

    switch (type) {
        case Android:
        case iOS:
            NhgInput input = pointerInputsMap.get(pointer);
            touchDownPointer(input, pointer);
            break;

        case Desktop:
            MouseSourceType sourceType = MouseSourceType.fromButtonCode(button);
            NhgInput mouseInput = mouseInputsMap.get(sourceType);
            touchDownMouse(mouseInput, sourceType);
            break;
    }

    return false;
}
 
開發者ID:MovementSpeed,項目名稱:nhglib,代碼行數:21,代碼來源:InputHandlerOld.java

示例2: touchUp

import com.badlogic.gdx.Application; //導入方法依賴的package包/類
@Override
public boolean touchUp(int screenX, int screenY, int pointer, int button) {
    Application.ApplicationType type = Gdx.app.getType();

    switch (type) {
        case Android:
        case iOS:
            NhgInput input = pointerInputsMap.get(pointer);
            touchUpPointer(input);
            break;

        case Desktop:
            MouseSourceType sourceType = MouseSourceType.fromButtonCode(button);
            NhgInput mouseInput = mouseInputsMap.get(sourceType);
            touchUpMouse(mouseInput);
            break;
    }

    return false;
}
 
開發者ID:MovementSpeed,項目名稱:nhglib,代碼行數:21,代碼來源:InputHandlerOld.java

示例3: getGlobalPrefix

import com.badlogic.gdx.Application; //導入方法依賴的package包/類
private static String getGlobalPrefix() {
	StringBuilder stringBuilder = new StringBuilder();
	Application.ApplicationType type = Compatibility.get().getApplicationType();
	if (type != Application.ApplicationType.Desktop
			|| Settings.getBooleanSettingValue(Settings.GRAPHICS_SIMPLE_SHADER)) {
		stringBuilder.append("#define simpleOperations\n");
	} else {
		stringBuilder.append("#version 130\n");
	}
	return stringBuilder.toString();
}
 
開發者ID:RedTroop,項目名稱:Cubes_2,代碼行數:12,代碼來源:WorldShaderProvider.java

示例4: getGlobalPrefix

import com.badlogic.gdx.Application; //導入方法依賴的package包/類
private static String getGlobalPrefix() {
  StringBuilder stringBuilder = new StringBuilder();
  Application.ApplicationType type = Compatibility.get().getApplicationType();
  if (type != Application.ApplicationType.Desktop || Settings.getBooleanSettingValue(Settings.GRAPHICS_SIMPLE_SHADER)) {
    stringBuilder.append("#define simpleOperations\n");
  } else {
    stringBuilder.append("#version 130\n");
  }
  return stringBuilder.toString();
}
 
開發者ID:RedTroop,項目名稱:Cubes,代碼行數:11,代碼來源:WorldShaderProvider.java

示例5: artifactByAppType

import com.badlogic.gdx.Application; //導入方法依賴的package包/類
private static String artifactByAppType(final Application.ApplicationType type) {
    if (type == Application.ApplicationType.Android) {
        return "android";
    }
    if (type == Application.ApplicationType.iOS) {
        return "ios";
    }
    if (type == Application.ApplicationType.Desktop) {
        return "desktop";
    }
    return "unknown_type";
}
 
開發者ID:TomGrill,項目名稱:gdx-facebook,代碼行數:13,代碼來源:ReflectionLoader.java

示例6: PrintDebugInformation

import com.badlogic.gdx.Application; //導入方法依賴的package包/類
static public void PrintDebugInformation() {
    long javaHeap = Gdx.app.getJavaHeap();
    long nativeHeap = Gdx.app.getNativeHeap();
    Application.ApplicationType appType = Gdx.app.getType();

    Gdx.app.log(DebugTag, "------ Debug informations ------");
    Gdx.app.log(DebugTag, "Java Heap : " + (javaHeap / 1000000f));
    Gdx.app.log(DebugTag, "Native Heap : " + (nativeHeap / 1000000f));
    Gdx.app.log(DebugTag, "Application Type : " + appType.toString());
    Gdx.app.log(DebugTag, "--------------------------------");
}
 
開發者ID:Drusy,項目名稱:Wisper,代碼行數:12,代碼來源:Debug.java

示例7: updateRunning

import com.badlogic.gdx.Application; //導入方法依賴的package包/類
private void updateRunning(float deltaTime) {
    if (Gdx.input.justTouched()) {
        guiCam.unproject(touchPoint.set(Gdx.input.getX(), Gdx.input.getY(), 0));

        if (pauseBounds.contains(touchPoint.x, touchPoint.y)) {
            state = GAME_PAUSED;
            pauseSystems();
            Assets.click.play();
            return;
        }
    }

    Application.ApplicationType appType = Gdx.app.getType();
    currentTime += deltaTime;

    reducePower(PowerComponent.MAX_POWER / PowerComponent.DURATION * deltaTime);

    // should work also with Gdx.input.isPeripheralAvailable(Peripheral.Accelerometer)
    float accelX = 0.0f;

    if (appType == Application.ApplicationType.Android || appType == Application.ApplicationType.iOS) {
        if (Math.abs(Gdx.input.getAccelerometerX()) > 0.8f)
            accelX = Gdx.input.getAccelerometerX();
        if (Gdx.input.isTouched() && !(missileBounds.contains(touchPoint.x, touchPoint.y)))
            playerShoot();
        if (Gdx.input.justTouched() && (missileBounds.contains(touchPoint.x, touchPoint.y)))
            missileShoot();
    } else {
        if (Gdx.input.isKeyPressed(Input.Keys.A)) accelX = 2.0f;
        if (Gdx.input.isKeyPressed(Input.Keys.D)) accelX = -2.0f;
        if (Gdx.input.isKeyPressed(Input.Keys.W)) playerShoot();
        if (Gdx.input.isKeyJustPressed(Input.Keys.SPACE)) missileShoot();
    }


    engine.getSystem(PlayerSystem.class).setAccelX(accelX);

    if (level.state == Level.LEVEL_STATE_GAME_OVER) {
        state = GAME_OVER;
        pauseSystems();

        Assets.musicGame.stop();
    }

    if (level.state == Level.LEVEL_STATE_GAME_WON) {
        state = GAME_WON;
        pauseSystems();

        Assets.musicGame.stop();
        Assets.musicWin.play();
    }

    //Kill off any dead entities
    for (Entity e : deadEntities) {
        playerPowerup(e);
        engine.removeEntity(e);
    }
    deadEntities.clear();
}
 
開發者ID:DevelopersGuild,項目名稱:rebel-invader,代碼行數:60,代碼來源:GameScreen.java

示例8: getType

import com.badlogic.gdx.Application; //導入方法依賴的package包/類
public Application.ApplicationType getType()
{
  return Application.ApplicationType.Android;
}
 
開發者ID:isnuryusuf,項目名稱:ingress-indonesia-dev,代碼行數:5,代碼來源:AndroidApplication.java


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