本文整理汇总了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;
}
示例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;
}
示例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();
}
示例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();
}
示例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";
}
示例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, "--------------------------------");
}
示例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();
}
示例8: getType
import com.badlogic.gdx.Application; //导入方法依赖的package包/类
public Application.ApplicationType getType()
{
return Application.ApplicationType.Android;
}