当前位置: 首页>>代码示例>>Java>>正文


Java ApplicationType.Android方法代码示例

本文整理汇总了Java中com.badlogic.gdx.Application.ApplicationType.Android方法的典型用法代码示例。如果您正苦于以下问题:Java ApplicationType.Android方法的具体用法?Java ApplicationType.Android怎么用?Java ApplicationType.Android使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在com.badlogic.gdx.Application.ApplicationType的用法示例。


在下文中一共展示了ApplicationType.Android方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: show

import com.badlogic.gdx.Application.ApplicationType; //导入方法依赖的package包/类
@Override
public void show () {
	font = new BitmapFont(Gdx.files.internal("fonts/font.fnt"));
	cache = font.getCache();

	if (Gdx.app.getType() == ApplicationType.Android)
		font.getData().setScale(2);
	polygonBatch = new PolygonSpriteBatch();
	camera = new OrthographicCamera(Gdx.graphics.getWidth(), Gdx.graphics.getHeight());

	Pixmap pixMap = new Pixmap(1, 1, Format.RGB565);
	pixMap.setColor(Color.WHITE);
	pixMap.fill();
	emptyTexture = new Texture(pixMap);
	pixMap.dispose();
}
 
开发者ID:Quexten,项目名称:RavTech,代码行数:17,代码来源:RemoteEditLoadingScreen.java

示例2: FinishScene

import com.badlogic.gdx.Application.ApplicationType; //导入方法依赖的package包/类
public FinishScene(Application app) {
    setFillParent(true);

    Label label = new Label("You have beaten this level!", app.getGuiSkin());
    add(label);
    row().padTop(175.f);

    Label label1;
    Label label2;

    if (Gdx.app.getType() != ApplicationType.Android) {
        label1 = new Label("Press Space or click left to go to the next level", app.getGuiSkin());
        label2 = new Label("Press Escape to go back to menu", app.getGuiSkin());
    } else {
        label1 = new Label("Touch the screen to go to the next level", app.getGuiSkin());
        label2 = new Label("Press the back button to go back to the menu", app.getGuiSkin());
    }

    add(label1);
    row().padTop(75.f);
    add(label2);

    pack();

    setColor(1, 1, 1, 0);
}
 
开发者ID:AlexAUT,项目名称:Kroniax,代码行数:27,代码来源:FinishScene.java

示例3: PauseScene

import com.badlogic.gdx.Application.ApplicationType; //导入方法依赖的package包/类
public PauseScene(Application app) {
    setFillParent(true);

    Label label1;
    Label label2;

    if (Gdx.app.getType() != ApplicationType.Android) {
        label1 = new Label("Press Space or press Left to resume the game", app.getGuiSkin());
        label2 = new Label("Press Escape to go back to the menu", app.getGuiSkin());
    } else {
        label1 = new Label("Touch the screen to resume the game", app.getGuiSkin());
        label2 = new Label("Press the back button to go back to the menu", app.getGuiSkin());
    }

    add(new Label("Game paused", app.getGuiSkin()));
    row().padTop(150.f);

    add(label1);
    row().padTop(75.f);
    add(label2);

    pack();

    setColor(1, 1, 1, 0);
}
 
开发者ID:AlexAUT,项目名称:Kroniax,代码行数:26,代码来源:PauseScene.java

示例4: ModalScene

import com.badlogic.gdx.Application.ApplicationType; //导入方法依赖的package包/类
public ModalScene(Application app) {
    setFillParent(true);

    mText = new Label("No Text set yet", app.getGuiSkin());
    mText.setWrap(true);
    add(mText).width(900);
    row().padTop(175.f);

    Label label1;

    if (Gdx.app.getType() != ApplicationType.Android) {
        label1 = new Label("Press Space or click left to resume the game", app.getGuiSkin());
    } else {
        label1 = new Label("Touch the screen to resume the game", app.getGuiSkin());
    }

    add(label1);

    pack();

    setColor(1, 1, 1, 0);
}
 
开发者ID:AlexAUT,项目名称:Kroniax,代码行数:23,代码来源:ModalScene.java

示例5: CrashedScene

import com.badlogic.gdx.Application.ApplicationType; //导入方法依赖的package包/类
public CrashedScene(Application app) {
    setFillParent(true);

    Label label1;
    Label label2;

    if (Gdx.app.getType() != ApplicationType.Android) {
        label1 = new Label("Press Space or press Left to start again from the last checkpoint", app.getGuiSkin());
        label2 = new Label("Press Escape to go back to menu", app.getGuiSkin());
    } else {
        label1 = new Label("Touch the screen to start again from the last checkpoint", app.getGuiSkin());
        label2 = new Label("Press the back button to go back to the menu", app.getGuiSkin());
    }

    add(new Label("You crashed into the wall", app.getGuiSkin()));
    row().padTop(150.f);
    add(label1);
    row().padTop(75.f);
    add(label2);

    pack();

    setColor(1, 1, 1, 0);
}
 
开发者ID:AlexAUT,项目名称:Kroniax,代码行数:25,代码来源:CrashedScene.java

示例6: StartScene

import com.badlogic.gdx.Application.ApplicationType; //导入方法依赖的package包/类
public StartScene(Application app) {
    setFillParent(true);

    Label label1;
    Label label2;

    if (Gdx.app.getType() != ApplicationType.Android) {
        label1 = new Label("Press Space or press Left to start the game", app.getGuiSkin());
        label2 = new Label("Press Escape to pause the game", app.getGuiSkin());
    } else {
        label1 = new Label("Touch the screen to start the game", app.getGuiSkin());
        label2 = new Label("Press the back button to pause the game", app.getGuiSkin());
    }

    add(label1);
    row().padTop(150.f);
    add(label2);

    pack();
}
 
开发者ID:AlexAUT,项目名称:Kroniax,代码行数:21,代码来源:StartScene.java

示例7: getInputRotation

import com.badlogic.gdx.Application.ApplicationType; //导入方法依赖的package包/类
public float getInputRotation() {
	float rawRotation = 0f;
	
    if (Gdx.app.getType() == ApplicationType.Android) {
    	float added = Prefs.prefs.getFloat("calibratedX", 0f);
    	rawRotation = (Gdx.input.getAccelerometerX() - added) * -0.1f;
    } else if (Gdx.app.getType() == ApplicationType.Desktop) {
        if (Gdx.input.isKeyPressed(Input.Keys.LEFT)) {
        	rawRotation = -0.3f;
        } else if (Gdx.input.isKeyPressed(Input.Keys.RIGHT)) {
        	rawRotation = 0.3f;
        }
    }
    
    float rotation = 0f;
    
    // Don't be too sensitive on the rotation: it only counts if it's above a threshold
    if (rawRotation > rotationThreshold) {
        rotation = rawRotation - rotationThreshold;
    } else if (rawRotation < -rotationThreshold) {
        rotation = rawRotation + rotationThreshold;
    }
    
    return rotation;
}
 
开发者ID:Floens,项目名称:JetFlight,代码行数:26,代码来源:EntityPlayer.java

示例8: setUpGameName

import com.badlogic.gdx.Application.ApplicationType; //导入方法依赖的package包/类
/**
 * Sets the up game name.
 *
 * @param menu_screen the new up game name
 */
public void setUpGameName(final MAMainMenuScreen menu_screen) {
	menu_screen.title = new EmptyActorLight(TITLE_W, TITLE_H, true);
	menu_screen.title.setTextureRegion(UIAssets.image_main_title, true);
	menu_screen.title.setOrigin( menu_screen.title.getWidth() / 2, menu_screen.title.getHeight() / 2);
	menu_screen.title.setPosition( AppSettings.SCREEN_W / 2 - menu_screen.title.getWidth() / 2,
			AppSettings.SCREEN_H + menu_screen.title.getHeight());
	
	if (Gdx.app.getType() == ApplicationType.Android) {
		menu_screen.title.setPosition( AppSettings.SCREEN_W / 2 - menu_screen.title.getWidth() / 2,
				AppSettings.SCREEN_H + menu_screen.title.getHeight() - 50);
	}
	
	//
	menu_screen.getStage().addActor(menu_screen.title);
}
 
开发者ID:sawankh,项目名称:MathAttack,代码行数:21,代码来源:MAMainMenuEnviroment.java

示例9: draw

import com.badlogic.gdx.Application.ApplicationType; //导入方法依赖的package包/类
@Override
public void draw(SpriteBatch batch) {
    if (levelClearedText != null) {
        drawStats(batch);
    } else {
        getFont().draw(batch, "ERROR: Final score not calculated!", 0.0f, 0.0f);
    }

    float btn_x = -(float)(Gdx.graphics.getWidth() / 2) + 20f;
    float btn_y = -(float)(Gdx.graphics.getHeight() / 2) + 40f;

    mainMenuButton.draw(batch, "Main menu", btn_x, btn_y + 50);
    levelButton.draw(batch, buttonText, btn_x, btn_y);

    /* At the moment Leaderboard is only available for Android devices. */
    if (Gdx.app.getType() == ApplicationType.Android) {
        leaderboardButton.draw(batch, "Leaderboard", btn_x + 500, btn_y);
    }
}
 
开发者ID:OlliV,项目名称:angr,代码行数:20,代码来源:SummaryScreen.java

示例10: show

import com.badlogic.gdx.Application.ApplicationType; //导入方法依赖的package包/类
@Override
public void show() {
	super.show();
	mTexture = new Texture(Gdx.files.internal("textures/player.png"));
	mPlayerTexture = new TextureRegion(mTexture, 0, 0, 64, 64);
	
	mFont = new BitmapFont();
	mFont.setColor(1.0f, 0.5f, 1.0f, 1.0f);
	
	// TODO: Change input based on settings
	if ((Gdx.app.getType() == ApplicationType.Android) && (Gdx.input.isPeripheralAvailable(Peripheral.Accelerometer))) {
		mUsePolling = true;
	} else {
		mUsePolling = false;						
	}
	mInputManager = new InputManager(mGame, mLevel, mPlayer);
	Gdx.input.setInputProcessor(mInputManager);
}
 
开发者ID:dbaelz,项目名称:Secludedness,代码行数:19,代码来源:LevelScreen.java

示例11: resize

import com.badlogic.gdx.Application.ApplicationType; //导入方法依赖的package包/类
@Override
public void resize(int width, int height) {
	stage.setViewport(width, height, true);
	vidaNave.setPosition(stage.getWidth() - 150, stage.getHeight() - 20);
	vidaEscudo.setPosition(stage.getWidth() - 150, stage.getHeight() - 28);
	if(Gdx.app.getType() == ApplicationType.Android && padShoot != null)
		padShoot.setPosition(stage.getWidth() - 50, 10);
}
 
开发者ID:makigas,项目名称:alienchase-gdx,代码行数:9,代码来源:GameplayScreen.java

示例12: create

import com.badlogic.gdx.Application.ApplicationType; //导入方法依赖的package包/类
@Override
public void create () {
	Gdx.app.setLogLevel(Application.LOG_DEBUG);
	
	if (Gdx.app.getType() == ApplicationType.Android) {
		GlobalConfiguration.REST_URL_BASE = "http://10.0.2.2:8080/RottenCaveServices/";
	}
	
	createSkin();
	menuMusic = Gdx.audio.newMusic(Gdx.files.internal("music/fight01.mp3"));
	menuMusic.setLooping(true);
	this.setScreen(new MainMenuScreen(this));
}
 
开发者ID:gcleenew,项目名称:RottenCave,代码行数:14,代码来源:RottenCave.java

示例13: platform

import com.badlogic.gdx.Application.ApplicationType; //导入方法依赖的package包/类
public static String platform() {
	ApplicationType type = Gdx.app.getType();
	if (type == ApplicationType.Desktop)
		return "desktop";
	if (type == ApplicationType.Android)
		return "android";
	if (type == ApplicationType.iOS)
		return "ios";
	if (type == ApplicationType.Applet)
		return "applet";
	if (type == ApplicationType.WebGL)
		return "web";
	return "desktop";
}
 
开发者ID:Murii,项目名称:Tilo-game-framework,代码行数:15,代码来源:window.java

示例14: encrypt

import com.badlogic.gdx.Application.ApplicationType; //导入方法依赖的package包/类
public static String encrypt(String message) {
    try {
        Cipher cipher = Cipher.getInstance("AES");
        cipher.init(Cipher.ENCRYPT_MODE, key);
        byte[] encryptedBytes = cipher.doFinal(message.getBytes());
        if (Gdx.app.getType() == ApplicationType.Android){
            throw new Exception("This demo works only with the desktop backend");
        }
        return Base64.encodeBase64String(encryptedBytes);
    } catch (Exception e) {
        Gdx.app.error(TAG, "Couldn't encrypt message: " + message, e);
    }
    return "Failed";
}
 
开发者ID:udacity,项目名称:ud406,代码行数:15,代码来源:FileLoading.java

示例15: decrypt

import com.badlogic.gdx.Application.ApplicationType; //导入方法依赖的package包/类
public static String decrypt(String encrypted) {
    try {
        Cipher cipher = Cipher.getInstance("AES");
        cipher.init(Cipher.DECRYPT_MODE, key);
        if (Gdx.app.getType() == ApplicationType.Android){
            throw new Exception("This demo works only with the desktop backend");
        }
        byte[] encryptedBytes = Base64.decodeBase64(encrypted);
        return new String(cipher.doFinal(encryptedBytes));
    } catch (Exception e) {
        Gdx.app.error(TAG, "Couldn't decrypt message: " + encrypted, e);
    }
    return "Failed";
}
 
开发者ID:udacity,项目名称:ud406,代码行数:15,代码来源:FileLoading.java


注:本文中的com.badlogic.gdx.Application.ApplicationType.Android方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。