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


Java FitViewport.setCamera方法代碼示例

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


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

示例1: show

import com.badlogic.gdx.utils.viewport.FitViewport; //導入方法依賴的package包/類
public void show() {
    if (!init) {
        loadingScreenAssets = new Assets.LoadingScreenAssets();
        AL.getAssetManager().loadAssetFields(loadingScreenAssets);
        AL.getAssetManager().finishLoading();
        font = new BitmapFont();
        batch = new SpriteBatch();

        cam = new OrthographicCamera();
        viewport = new FitViewport(1920, 1080);
        viewport.setCamera(cam);
        stage = new Stage(viewport);
        stage.setViewport(viewport);
        skin = loadingScreenAssets.styles_json;

        loadingScreenBar = new ProgressBar(0, 100, 1, false, skin);
        loadingScreenBar.setPosition(25, -10);
        loadingScreenBar.setSize(1890, 50);

        stage.addActor(loadingScreenBar);
    }
    init = true;
}
 
開發者ID:EtherWorks,項目名稱:arcadelegends-gg,代碼行數:24,代碼來源:DefaultLoadingScreen.java

示例2: show

import com.badlogic.gdx.utils.viewport.FitViewport; //導入方法依賴的package包/類
/**
 * Method responsible for initializing the main menu
 * Called when the screen becomes the current screen of the game
 */
@Override
public void show() {
    AL.getAudioManager().registerMusic("bitrush", menuAssets.bitrush);
    AL.getAudioManager().playMusic("bitrush");

    cam = new OrthographicCamera();
    viewport = new FitViewport(1920, 1080);
    viewport.setCamera(cam);
    stage = new Stage(viewport);
    stage.setViewport(viewport);
    skin = menuAssets.styles_json;
    skin.getFont("bocklin").getData().setScale(0.8f, 0.8f);
    int x = 1920;
    int y = 1080;
    spriteBatch = new SpriteBatch();
    mainbackground = menuAssets.testmainscreen;

    initButtons();
    AL.input.setInputProcessor(stage);
}
 
開發者ID:EtherWorks,項目名稱:arcadelegends-gg,代碼行數:25,代碼來源:MainMenuScreen.java

示例3: show

import com.badlogic.gdx.utils.viewport.FitViewport; //導入方法依賴的package包/類
/**
 * Method responsible for initializing the main menu
 * Called when the screen becomes the current screen of the game
 */
@Override
public void show() {
    cam = new OrthographicCamera();
    viewport = new FitViewport(1920, 1080);
    viewport.setCamera(cam);
    stage = new Stage(viewport);
    stage.setViewport(viewport);
    skin = settingsAssets.styles_json;
    int x = 1920;
    int y = 1080;
    spriteBatch = new SpriteBatch();
    mainbackground = settingsAssets.testmainscreen;
    BitmapFont font = settingsAssets.bocklin_fnt;
    TextureRegion backgroundTexture = new TextureRegion(settingsAssets.background_textbutton);

    inputTable = new Table();
    keys = IInputConfig.InputKeys.values();
    keyMap = new HashMap<>();

    initInputRows(font, backgroundTexture);
    createBackButton();
    AL.input.setInputProcessor(new InputMultiplexer(stage, this));
}
 
開發者ID:EtherWorks,項目名稱:arcadelegends-gg,代碼行數:28,代碼來源:InputSettingsScreen.java

示例4: show

import com.badlogic.gdx.utils.viewport.FitViewport; //導入方法依賴的package包/類
/**
 * Method responsible for initializing the GameOverScreen
 * Called when the screen becomes the current screen of the game
 */
@Override
public void show() {
    cam = new OrthographicCamera();
    viewport = new FitViewport(1920, 1080);
    viewport.setCamera(cam);
    stage = new Stage(viewport);
    stage.setViewport(viewport);
    skin = menuAssets.styles_json;
    skin.getFont("bocklin").getData().setScale(0.8f, 0.8f);
    int x = 1920;
    int y = 1080;
    spriteBatch = new SpriteBatch();
    mainbackground = menuAssets.testmainscreen;

    createComponents();



    AL.input.setInputProcessor(stage);
}
 
開發者ID:EtherWorks,項目名稱:arcadelegends-gg,代碼行數:25,代碼來源:GameOverScreen.java

示例5: show

import com.badlogic.gdx.utils.viewport.FitViewport; //導入方法依賴的package包/類
/**
 * Method responsible for initializing the pause menu
 * Called when the screen becomes the current screen of the game
 */
@Override
public void show() {
    // Inits:
    cam = new OrthographicCamera();
    viewport = new FitViewport(1920, 1080);
    viewport.setCamera(cam);
    stage = new Stage(viewport);
    stage.setViewport(viewport);
    skin = menuAssets.styles_json;
    skin.getFont("bocklin").getData().setScale(0.8f, 0.8f);
    int x = 1920;
    int y = 1080;
    spriteBatch = new SpriteBatch();
    mainbackground = menuAssets.testmainscreen;

    createComponents();

    AL.input.setInputProcessor(new InputMultiplexer(stage, this));
}
 
開發者ID:EtherWorks,項目名稱:arcadelegends-gg,代碼行數:24,代碼來源:PauseMenuScreen.java

示例6: show

import com.badlogic.gdx.utils.viewport.FitViewport; //導入方法依賴的package包/類
/**
 * Method responsible for initializing the settings menu
 * Called when the screen becomes the current screen of the game
 */
@Override
public void show() {
    cam = new OrthographicCamera();
    viewport = new FitViewport(1920, 1080);
    viewport.setCamera(cam);
    stage = new Stage(viewport);
    stage.setViewport(viewport);
    skin = settingsAssets.styles_json;
    int x = 1920;
    int y = 1080;
    spriteBatch = new SpriteBatch();
    mainbackground = settingsAssets.testmainscreen;
    componentMap = new HashMap<>();
    selectionTexture = settingsAssets.background_textbutton;
    Sprite sprite = new Sprite(selectionTexture);
    selection = new SpriteDrawable(sprite);

    tabbedPane = new SettingsTabbedPane(skin, x, y, componentMap);

    initTabs();

    createVideoTable();
    createAudioTable();

    componentMap.put(btTabVideo, tableVideo);
    componentMap.put(btTabAudio, tableAudio);
    tabbedPane.setCurrentTab(btTabVideo);
    stage.addActor(tabbedPane);

    createBackButton();

    AL.input.setInputProcessor(new InputMultiplexer(stage, this));

}
 
開發者ID:EtherWorks,項目名稱:arcadelegends-gg,代碼行數:39,代碼來源:SettingsScreen.java

示例7: View

import com.badlogic.gdx.utils.viewport.FitViewport; //導入方法依賴的package包/類
public View() {
	camera = new OrthographicCamera(Config.viewWidth, Config.viewHeight);
	uiCamera = new OrthographicCamera(Config.viewWidth, Config.viewHeight);
	uiCamera.translate(Config.viewWidth / 2, Config.viewHeight / 2);
	uiCamera.update();
	viewport = new FitViewport(Config.viewWidth, Config.viewHeight);
	worldViewport = new FitViewport(Config.viewWidth, Config.viewHeight);
	worldViewport.setCamera(camera);
}
 
開發者ID:adketuri,項目名稱:umbracraft,代碼行數:10,代碼來源:View.java


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