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


Java Stage.setViewport方法代码示例

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


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

示例1: createLoadingStage

import com.badlogic.gdx.scenes.scene2d.Stage; //导入方法依赖的package包/类
public Stage createLoadingStage(){
    Stage stage = createStage();
    stage.setViewport(viewport);
    stage.addActor(new GameObjectBodyless(new Texture("default_background.png")));
    GameObjectBodyless gameObjectBodyless = new GameObjectBodyless(new Texture("loading_screen_part1.png")){
        @Override
        public void act(float delta) {
            super.act(delta);
            getSprite().setOriginCenter();
            getSprite().rotate(3);
        }
    };
    gameObjectBodyless.setPosition(viewport.getScreenWidth() - gameObjectBodyless.getSprite().getWidth(),
            viewport.getScreenHeight() - gameObjectBodyless.getSprite().getHeight());
    stage.addActor(gameObjectBodyless);
    return stage;
}
 
开发者ID:hypeofpipe,项目名称:Race99,代码行数:18,代码来源:StageFactory.java

示例2: show

import com.badlogic.gdx.scenes.scene2d.Stage; //导入方法依赖的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

示例3: show

import com.badlogic.gdx.scenes.scene2d.Stage; //导入方法依赖的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

示例4: show

import com.badlogic.gdx.scenes.scene2d.Stage; //导入方法依赖的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

示例5: show

import com.badlogic.gdx.scenes.scene2d.Stage; //导入方法依赖的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

示例6: show

import com.badlogic.gdx.scenes.scene2d.Stage; //导入方法依赖的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

示例7: createStartStage

import com.badlogic.gdx.scenes.scene2d.Stage; //导入方法依赖的package包/类
public Stage createStartStage(){
    Stage stage = createStage();
    stage.setViewport(viewport);
    stage.addActor(new GameObjectBodyless(new Texture("splash_screen1.png")){

        private int i = 100;
        private int counter = 0;

        @Override
        public void act(float delta) {
            super.act(delta);
            if (i < 0){
                i = 100;
                counter++;
                if (counter == 2){
                    remove();
                    setChanged();
                    notifyObservers("StartStageEnd");
                }
                setTexture(new Texture("splash_screen2.png"));
                setSprite(new Sprite(getTexture()));
            } else if (i >= 0) {
                i--;
            }
        }
    });
    return stage;
}
 
开发者ID:hypeofpipe,项目名称:Race99,代码行数:29,代码来源:StageFactory.java

示例8: show

import com.badlogic.gdx.scenes.scene2d.Stage; //导入方法依赖的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

示例9: createMenuStage

import com.badlogic.gdx.scenes.scene2d.Stage; //导入方法依赖的package包/类
public Stage createMenuStage(){
    Stage stage = createStage();
    stage.setViewport(viewport);
    return stage;
}
 
开发者ID:hypeofpipe,项目名称:Race99,代码行数:6,代码来源:StageFactory.java

示例10: gameStage

import com.badlogic.gdx.scenes.scene2d.Stage; //导入方法依赖的package包/类
public Stage gameStage(){
    Stage stage = createStage();
    stage.setViewport(viewport);
    return stage;
}
 
开发者ID:hypeofpipe,项目名称:Race99,代码行数:6,代码来源:StageFactory.java

示例11: createScoreStage

import com.badlogic.gdx.scenes.scene2d.Stage; //导入方法依赖的package包/类
public Stage createScoreStage(){
    Stage stage = createStage();
    stage.setViewport(viewport);
    return stage;
}
 
开发者ID:hypeofpipe,项目名称:Race99,代码行数:6,代码来源:StageFactory.java


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