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