Java 类com.badlogic.gdx.utils.viewport.StretchViewport 实例源码

项目:enklave    文件:ScreenBricks.java   
@Override
public void show() {
    stage = new Stage(new StretchViewport(Width,Height));
    stage.addActor(tabContinue);
    PerspectiveCamera camera2 = new PerspectiveCamera(40, Gdx.graphics.getWidth(), Gdx.graphics.getHeight());
    camera2.position.set(0, -Width * 0.075f, Width * 0.135f);
    camera2.lookAt(0, 0, 0);
    camera2.far = Width*0.3f;
    camera2.near = 1;
    camera2.update();
    controller = new CameraInputController(camera2);
    CameraGroupStrategy cameraGroupStrategy = new CameraGroupStrategy(camera2);
    batch = new DecalBatch(cameraGroupStrategy);
    modelBatch = new ModelBatch();
    InputMultiplexer in = new InputMultiplexer();
    in.addProcessor(stage);
    in.addProcessor(controller);
    Gdx.input.setInputProcessor(in);
}
项目:enklave    文件:ScreenExtensions.java   
@Override
public void show() {
    if(drawone){
        addBackgroundExtension();
        addPuls();
        addimagebg();
        addButtonBottom();
        drawone = false;
    }
    cameraGroupStrategy = new CameraGroupStrategy(camera);
    batch = new DecalBatch(cameraGroupStrategy);
    stage = new Stage(new StretchViewport(Gdx.graphics.getWidth(),Gdx.graphics.getHeight()));
    addtostage();
    Gdx.input.setCatchBackKey(true);
    inputmulti = new InputMultiplexer();
    inputmulti.addProcessor(stage);
    Gdx.input.setInputProcessor(inputmulti);
}
项目:enklave    文件:ScreenRooms.java   
@Override
    public void show() {
        if(drawone){
            addroomselect();
            addButtonBottom();
            addPuls();
            addimagebg();
            addbuildRoom();
            addtimerbuildroom();
            drawone = false;
        }
        cameraGroupStrategy = new CameraGroupStrategy(camera);
//        CameraInputController controller = new CameraInputController(camera);
        stage = new Stage(new StretchViewport(Gdx.graphics.getWidth(),Gdx.graphics.getHeight()));
        batchsprite = new SpriteBatch();
        addtostage();
        batch = new DecalBatch(this.cameraGroupStrategy);
        Gdx.input.setCatchBackKey(true);
        InputMultiplexer inputmulti = new InputMultiplexer();
        inputmulti.addProcessor(stage);
        Gdx.input.setInputProcessor(inputmulti);
    }
项目:enklave    文件:ScreenDescribeEnklave.java   
@Override
public void show() {
    if(drawone){
        addActiveRooms();
        createBuildRoom();
        createAddExtensionGroup();
        addDescribeEnklave();
        drawone = false;
    }
    backButton.setChecked(false);
    Gdx.input.setCatchBackKey(true);
    stage = new Stage(new StretchViewport(Gdx.graphics.getWidth(),Gdx.graphics.getHeight()));
    addtoStage(stage);
    stage.addActor(backButton);
    Gdx.input.setInputProcessor(stage);
}
项目:enklave    文件:ScreenSetting.java   
@Override
public void show() {
    stage = new Stage(new StretchViewport(Gdx.graphics.getWidth(),Gdx.graphics.getHeight()));
    if(drawone) {
        initializeMenuTab();
        manager.loadAssetsSettings();
        manager.getAssetsSettings().finish();
        addSettingTutorial();
        addSettingPresentation();
        addChangeFaction();
        addKeepScreenOn();
        addTestCombat();
        drawone = false;
    }
    addtoStage();
    checkButtons();
    b5.setChecked(true);
    sp.setScrollPercentX(100);
    sp.updateVisualScroll();
    backButton.setChecked(false);
    Gdx.input.setCatchBackKey(true);
    Gdx.input.setInputProcessor(stage);
}
项目:Polymorph    文件:GameScreen.java   
private void initUtils() {
    //init camera & viewport
    camera = new OrthographicCamera();
    viewport = new StretchViewport(Polymorph.WORLD_WIDTH, Polymorph.WORLD_HEIGHT, camera);
    viewport.apply(true);
    camera.update();

    //init sprite batch
    batch = new SpriteBatch();
    batch.setProjectionMatrix(camera.combined);

    //init font
    FreeTypeFontGenerator fontGenerator = polymorph.getAssetManager().get(Polymorph.FONT_BOLD_PATH, FreeTypeFontGenerator.class);
    FreeTypeFontParameter fontSettings = new FreeTypeFontParameter();
    fontSettings.size = 80;
    fontSettings.minFilter = TextureFilter.Linear;
    fontSettings.magFilter = TextureFilter.Linear;
    font = fontGenerator.generateFont(fontSettings);
}
项目:FlappySpinner    文件:MenuScreen.java   
public MenuScreen(Game game) {
    Box2D.init();
    this.game = game;
    world = new World(new Vector2(0, 0), false);
    stage = new Stage(new StretchViewport(Constants.WIDTH, Constants.HEIGHT));

    preferences = new GamePreferences();
    audioManager = AudioManager.getInstance();
    Gdx.input.setInputProcessor(stage);

    FlappySpinner.gameManager.changeBackgroundColor("#4ec0ca");

    setUpBackground();
    setUpButtons();
    setUpLogo();
}
项目:FlappySpinner    文件:MarketScreen.java   
public MarketScreen(Game aGame) {
    this.aGame = aGame;
    audioManager = AudioManager.getInstance();
    preferences = new GamePreferences();
    stage = new Stage(new StretchViewport(Constants.WIDTH, Constants.HEIGHT));
    Gdx.input.setInputProcessor(stage);

    initSkins();

    setUpBackground();
    setUpHomeButton();
    setUpSkinImages();
    setUpNextButton();
    setUpPreviousButton();
    setUpUseButton();
    setUpBuyButton();
    setUpLabels();

    changeShownSkin();
}
项目:FlappySpinner    文件:SettingsScreen.java   
public SettingsScreen(Game game) {
    this.aGame = game;
    preferences = new GamePreferences();
    audioManager = AudioManager.getInstance();
    stage = new Stage(new StretchViewport(Constants.WIDTH, Constants.HEIGHT));
    Gdx.input.setInputProcessor(stage);

    setUpBackground();


    setUpLabels();

    setUpHomeButton();
    setUpMusicButton();
    setUpSoundButton();
    setUpGitHubButton();
}
项目:Space-Bombs    文件:GameScreen.java   
/**
 * Constructor
 * @param game 
 */
public GameScreen(Game game, Client client, Server server)
{
    super(game, client, server);

    this.sendCommand = client.getSendCommand();
    this.camera = new OrthographicCamera();
    this.stage = new Stage(new StretchViewport(Constants.SCREENWIDTH, Constants.SCREENHEIGHT, camera));
    this.mapManager = new MapLoader(camera, sendCommand);
    this.entityManager = new EntityManager(camera, mapManager, sendCommand, inputHandler);
    this.processData = new ClientProcessData(entityManager, mapManager);
    this.mainPlayerHud = new MainPlayerHud(entityManager, game, server, client, mapManager, camera);
    this.camera.zoom = Constants.DEFAULTZOOM;

    // Controls
    if(Constants.ISRUNNINGONSMARTPHONE)
    {
        Gdx.input.setInputProcessor(mainPlayerHud.stage);
        camera.zoom = Constants.SMARTPHONEZOOM;
    }else
    {
        inputHandler.setInputSource(mainPlayerHud.stage);
        Gdx.input.setCursorCatched(true);
    }

}
项目:pixelhorrorjam2016    文件:PlayGame.java   
@Override
public void show() {
    _roomManager = new RoomManager();
    _flagManager = new FlagManager();

    SlideTransition.setTransitionSpeed(SlideTransition.DEFAULT_SPEED);

    PlayerInventory inventory = new PlayerInventory();

    _batch = new SpriteBatch();
    _shapeRenderer = new ShapeRenderer();
    _camera = new OrthographicCamera();
    _camera.translate(GAME_WIDTH / 2, GAME_HEIGHT / 2);
    _viewport = new StretchViewport(GAME_WIDTH, GAME_HEIGHT, _camera);

    _player = new Player(this, inventory);
    _player.startGame(RoomId.CAR);

    Gdx.input.setInputProcessor(_player);
}
项目:pixelhorrorjam2016    文件:SplashScreen.java   
@Override
public void show() {
    _camera = new OrthographicCamera(SPLASH_WIDTH, SPLASH_HEIGHT);
    _camera.translate(SPLASH_WIDTH / 2, SPLASH_HEIGHT / 2);
    _viewport = new StretchViewport(SPLASH_WIDTH, SPLASH_HEIGHT, _camera);

    _batch = new SpriteBatch();
    _shapeRenderer = new ShapeRenderer();

    _splash = new Sprite(new Texture("splash.png"));
    _splash.setSize(SPLASH_HEIGHT, SPLASH_HEIGHT);
    _splash.setPosition(140, 0);

    _fade = 1.0f;

    _delay = 1.25f;

    _fadeIn = true;
    _fadeOut = false;

    AudioManager.playMusic(MusicId.MAIN_MENU);

    Gdx.input.setInputProcessor(this);
}
项目:cocos-ui-libgdx    文件:AMScreen.java   
@Override
public void show() {
    super.show();
    layout = new GlyphLayout();
    font = new NativeFont(new NativeFontPaint(25));
    font.appendText("正在加载...0123456789%");
    font.setColor(Color.BLACK);
    layout.setText(font, "正在加载...100%");

    stage = new Stage(new StretchViewport(1280, 720));

    assetManager = new AssetManager();
    assetManager.setLogger(new Logger("log", Logger.DEBUG));
    assetManager.setLoader(CocosScene.class, new CocosLoader(new InternalFileHandleResolver()));
    assetManager.load("mainscene/MenuScene.json", CocosScene.class);
}
项目:TerraLegion    文件:GameHud.java   
public GameHud(GameScreen gameScreen, World world) {
    this.gameScreen = gameScreen;
    this.world = world;
    stageSb = new SpriteBatch();
    sb = new SpriteBatch();
    stage = new Stage(new StretchViewport(Settings.getWidth(), Settings.getHeight()), stageSb);
    moveControl = new JoystickControl(ResourceManager.getInstance().getTexture("joystickBg"), ResourceManager.getInstance().getTexture("joystickKnob"), 10, 20, 20, 200, 200);
    actionControl = new JoystickControl(ResourceManager.getInstance().getTexture("joystickBg"), ResourceManager.getInstance().getTexture("joystickKnob"), 10, 550, 20, 200, 200);
    stage.addActor(moveControl.getTouchpad());
    stage.addActor(actionControl.getTouchpad());
    stage.act(Gdx.graphics.getDeltaTime());

    camera = new OrthoCamera();
    InputController.getInstance().addInputProcessor(stage);

    bg = ResourceManager.getInstance().getTexture("bg");

    for (int i = 0; i < inventoryBoxes.length; i++) {
        inventoryBoxes[i] = new InventoryBox(world.getPlayer().getInventory().getItemStack(i, 0), 20 + (i * (InventoryBox.bg.getWidth() + 7)), Settings.getHeight() - InventoryBox.bg.getHeight() - 10);
    }
    inventoryBoxes[0].setSelected(true);
}
项目:sagetv-miniclient    文件:MiniClientRenderer.java   
@Override
public void create() {
    useNativeResolution = client.properties().getBoolean(PrefStore.Keys.use_native_resolution, true);

    fullScreenSize.updateFrom(getMaxScreenSize());
    lastResize.updateFrom(fullScreenSize);

    uiSize.updateFrom(getScreenSize());
    lastScreenSize.updateFrom(uiSize);

    scale.setScale(uiSize, fullScreenSize);

    log.debug("CREATE: UI SIZE: {}, SCREEN SIZE: {}", uiSize, fullScreenSize);
    camera = new OrthographicCamera();
    viewport = new StretchViewport(uiSize.getWidth(), uiSize.getHeight(), camera);
    stage = new Stage(viewport);
    batch = stage.getBatch();

    camera.update();
    batch.setProjectionMatrix(camera.combined);

    shapeRenderer = new SageShapeRenderer();
    Gdx.graphics.setContinuousRendering(false);
}
项目:Kroniax    文件:GameController.java   
public GameController(Application app) {
    mState = State.AT_START;

    mIgnoreInput = false;

    mIdentityMatrix = new Matrix4();

    mStage = new Stage(new StretchViewport(1280, 720));

    mStartScene = new StartScene(app);
    mPauseScene = new PauseScene(app);
    mCrashedScene = new CrashedScene(app);
    mFinishScene = new FinishScene(app);
    mModalScene = new ModalScene(app);

    mStage.addActor(mStartScene);
    mStage.addActor(mPauseScene);
    mStage.addActor(mCrashedScene);
    mStage.addActor(mFinishScene);
    mStage.addActor(mModalScene);
}
项目:OdysseeDesMaths    文件:MenuPrincipal.java   
public MenuPrincipal(OdysseeDesMaths jeu) {
    this.jeu = jeu;

    this.currentState = State.NORMAL;
    this.viewport = new StretchViewport(WIDTH, HEIGHT);
    this.stage = new Stage(viewport);
    this.tableau = new Table();
    this.skin = new Skin();
    this.skin.addRegions(Assets.getManager().get(Assets.UI_MAIN, TextureAtlas.class));
    this.skin.addRegions(Assets.getManager().get(Assets.UI_ORANGE, TextureAtlas.class));
    this.skin.add("background", Assets.getManager().get(Assets.MAIN_MENU_BACKGROUND, Texture.class));

    //propriétés relatives à la police
    this.ftfp = new FreeTypeFontParameter();
    this.menuFont = new BitmapFont();
    this.fontButton = new BitmapFont();

    this.playButtonStyle = new TextButtonStyle();
    this.gameTitleStyle = new LabelStyle();
    this.audioButtons = new AudioButtons();

    this.createUI();
}
项目:libgdxcn    文件:ViewportTest1.java   
static public Array<Viewport> getViewports (Camera camera) {
    int minWorldWidth = 640;
    int minWorldHeight = 480;
    int maxWorldWidth = 800;
    int maxWorldHeight = 480;

    Array<Viewport> viewports = new Array();
    viewports.add(new StretchViewport(minWorldWidth, minWorldHeight, camera));
    viewports.add(new FillViewport(minWorldWidth, minWorldHeight, camera));
    viewports.add(new FitViewport(minWorldWidth, minWorldHeight, camera));
    viewports.add(new ExtendViewport(minWorldWidth, minWorldHeight, camera));
    viewports.add(new ExtendViewport(minWorldWidth, minWorldHeight, maxWorldWidth, maxWorldHeight, camera));
    viewports.add(new ScreenViewport(camera));

    ScreenViewport screenViewport = new ScreenViewport(camera);
    screenViewport.setUnitsPerPixel(0.75f);
    viewports.add(screenViewport);

    viewports.add(new ScalingViewport(Scaling.none, minWorldWidth, minWorldHeight, camera));
    return viewports;
}
项目:HelixEngine    文件:UI.java   
public UI() {
  VisUI.load();

  stage = new Stage(new StretchViewport(1280, 800));

  Table root = new Table();
  root.setFillParent(true);
  stage.addActor(root.top());

  root.add((new HEMenuBar(stage)).getTable()).fillX().expandX().row();
  root.add(sidebar = new HESidebar()).minWidth(200)
                                     .left()
                                     .fillY()
                                     .expandY()
                                     .row();
  sidebar.setVisible(false);
}
项目:gaiasky    文件:SGRStereoscopic.java   
public SGRStereoscopic() {
    super();
    // INIT VIEWPORT
    stretchViewport = new StretchViewport(Gdx.graphics.getWidth(), Gdx.graphics.getHeight());

    // INIT FRAME BUFFER FOR 3D MODE
    fb3D = new HashMap<Integer, FrameBuffer>();
    fb3D.put(getKey(Gdx.graphics.getWidth() / 2, Gdx.graphics.getHeight()), new FrameBuffer(Format.RGB888, Gdx.graphics.getWidth() / 2, Gdx.graphics.getHeight(), true));

    // Init anaglyphic effect
    anaglyphic = new Anaglyphic();

    // Aux vectors
    aux1 = new Vector3();
    aux2 = new Vector3();
    aux3 = new Vector3();
    aux1d = new Vector3d();
    aux2d = new Vector3d();
    aux3d = new Vector3d();
    aux4d = new Vector3d();
    aux5d = new Vector3d();

    EventManager.instance.subscribe(this, Events.FRAME_SIZE_UDPATE, Events.SCREENSHOT_SIZE_UDPATE);
}
项目:nahwc-g    文件:MainMenuInterface.java   
public void init(Game game, Assets assets) {
    hiScoreBuilder = new StringBuilder();
    savedStuff = new SavedStuff();
    skin = new Skin();
    stage = new Stage();
    batch = new SpriteBatch();
    cam = new OrthographicCamera(MainMenuScreen.WIDTH, MainMenuScreen.HEIGHT);
    Gdx.input.setInputProcessor(stage);
    stage.setViewport(new StretchViewport(MainMenuScreen.WIDTH, MainMenuScreen.HEIGHT));
    batch.setProjectionMatrix(cam.combined);
    this.game = game;
    this.assets = assets;

    loadMainMenuAssets();
    setUpSkin();
    createTable();
    createStageActors();
    addStageActorsToStage();
    setActorsToDefaults();
    addListenersToActors();
}
项目:it.alcacoop.fourinaline    文件:SplashScreen.java   
public SplashScreen(String img) {
  //stage = new Stage(Gdx.graphics.getWidth(), Gdx.graphics.getHeight(), false);
  //stage.setViewport(FourInALine.Instance.resolution[0], FourInALine.Instance.resolution[1], false);

  stage = new Stage(new StretchViewport(FourInALine.Instance.resolution[0], FourInALine.Instance.resolution[1]));

  Texture r = new Texture(Gdx.files.internal(img));
  r.setFilter(TextureFilter.Linear, TextureFilter.Linear);

  alca = new Image(r);
  alca.setX((stage.getWidth() - alca.getWidth()) / 2);
  alca.setY((stage.getHeight() - alca.getHeight()) / 2);
  alca.setColor(1, 1, 1, 0);

  stage.addActor(alca);
}
项目:ggvm    文件:TouchInputProcessor.java   
@Override
public void create() {
    overlayCamera = new OrthographicCamera(424, 240);
    overlayCamera.translate(overlayCamera.viewportWidth / 2, overlayCamera.viewportHeight / 2, 0);
    overlayCamera.update();
    overlayViewPort = new StretchViewport(424, 240, overlayCamera);
    shapeRenderer = new ShapeRenderer();
    shapeRenderer.setAutoShapeType(true);
    initializeTextures();
}
项目:water2d-libgdx    文件:GameMain.java   
@Override
public void create() {
    camera = new OrthographicCamera();
    stage = new Stage(new StretchViewport(Gdx.graphics.getWidth() / 100, Gdx.graphics.getHeight() / 100, camera));

    // Create box2d world
    world = new World(new Vector2(0, -10), true);
    world.setContactListener(new MyContactListener());
    debugRenderer = new Box2DDebugRenderer();

    water = new Water();
    water.createBody(world, 3f, 0, 8, 2); //world, x, y, width, height
    //water.setDebugMode(true);
}
项目:summer17-android    文件:EndScreen.java   
public EndScreen(NoObjectionGame game) {
    this.game = game;
    bg = new Texture("pixil-layer-Background2.png");
    viewport = new StretchViewport(NoObjectionGame.V_WIDTH, NoObjectionGame.V_HEIGHT, new OrthographicCamera());
    stage = new Stage(viewport, ((NoObjectionGame) game).batch);

}
项目:summer17-android    文件:WinScreen.java   
public WinScreen(NoObjectionGame game) {
    this.game = game;
    bg = new Texture("pixil-layer-Background.png");
    viewport = new StretchViewport(NoObjectionGame.V_WIDTH, NoObjectionGame.V_HEIGHT, new OrthographicCamera());
    stage = new Stage(viewport, ((NoObjectionGame) game).batch);

}
项目:enklave    文件:ScreenRaider.java   
@Override
public void show() {
    if(!draw){
        draw = true;
        addBackground();
        addtoStage();
    }
    stage = new Stage(new StretchViewport(Width,Height));
    decalBatch = new DecalBatch(new CameraGroupStrategy(camera));
    stage.addActor(groupStage);
    modelBatch = new ModelBatch();
    Gdx.input.setInputProcessor(stage);
}
项目:enklave    文件:ScreenChoiceFaction.java   
@Override
public void show() {
    manager.loadAssetsChoiceFaction();
    manager.getAssetsChoiceFaction().finish();
    make();
    stage = new Stage(new StretchViewport(WIDTH,HEIGHT));
    modelBatch = new ModelBatch();
    stage.addActor(group);
}
项目:enklave    文件:ScreenProfile.java   
@Override
public void show() {
    if(drawone) {
        initializeMenuTab();
        drawProfile();
        addInformation();
        drawone = false;
    }
    addInfoUser();
    sp.setScrollPercentX(0);
    sp.updateVisualScroll();
    b1.setChecked(true);
    stage = new Stage(new StretchViewport(Gdx.graphics.getWidth(),Gdx.graphics.getHeight())){
        @Override
        public boolean keyDown(int keyCode) {
            if(keyCode == Input.Keys.BACK)
                gameManager.setScreen(gameManager.mapsScreen);
            return super.keyDown(keyCode);
        }
    };
    stage.addActor(backButton);
    stage.addActor(groupUser);
    stage.addActor(groupInformation);
    stage.addActor(ta);
    queueDisplay.AddtoStage(stage);
    batchDecal = new DecalBatch(new CameraGroupStrategy(camera));
    modelBatch = new ModelBatch();
    Gdx.input.setInputProcessor(stage);
    Gdx.input.setCatchBackKey(true);
}
项目:enklave    文件:ScreenCombat.java   
@Override
public void show() {
    CameraGroupStrategy cameraGroupStrategy = new CameraGroupStrategy(camera);
    decalBatch = new DecalBatch(cameraGroupStrategy);
    stagefordialog = new Stage(new StretchViewport(Gdx.graphics.getWidth(),Gdx.graphics.getHeight()));
    stage = new Stage(new StretchViewport(Gdx.graphics.getWidth(), Gdx.graphics.getHeight())) {
        @Override
        public boolean keyDown(int keyCode) {
            if (keyCode == Input.Keys.BACK) {
                if (InformationProfile.getInstance().getDateUserGame().getEnklaveCombatId() == -1)
                    gameManager.setScreen(gameManager.screenEnklave);
                else
                    dialogExit("You can't out from combat!");
            }
            return super.keyDown(keyCode);
        }
    };
    drawtopcombat();
    drawmap();
    drawdefenders();
    drawAttachers();
    addBtnStartCombat();
    combatFight = new CombatFitght(this, WIDTH * 0.6f);
    addcomponenttostage();
    progressBarEnergy.FadeIn();
    Gdx.input.setCatchBackKey(true);
    InputMultiplexer inputmulti = new InputMultiplexer();
    GestureDetector gd = new GestureDetector(this);
    inputmulti.addProcessor(stage);
    inputmulti.addProcessor(gd);
    inputmulti.addProcessor(this);
    Gdx.input.setInputProcessor(inputmulti);
}
项目:Polymorph    文件:SettingsScreen.java   
public SettingsScreen(Polymorph polymorph) {
    AssetManager assetManager = polymorph.getAssetManager();
    TextureAtlas textureAtlas = assetManager.get(Polymorph.MASTER_PATH, TextureAtlas.class);

    this.polymorph = polymorph;

    mainMenuMusic = assetManager.get(Polymorph.MAIN_MENU_MUSIC_PATH, Music.class);
    background = textureAtlas.findRegion("settingsscreen");

    stage = new Stage(new StretchViewport(Polymorph.WORLD_WIDTH, Polymorph.WORLD_HEIGHT));
    stage.clear();
    initButtons(textureAtlas);
    Gdx.input.setInputProcessor(stage);
}
项目:Polymorph    文件:MainMenu.java   
private void initStage() {
    stage = new Stage(new StretchViewport(Polymorph.WORLD_WIDTH, Polymorph.WORLD_HEIGHT));
    Gdx.input.setInputProcessor(stage);

    createTitle();
    createButtons();
}
项目:FlappySpinner    文件:GameScreen.java   
public GameScreen(Game game, int score, boolean isRelife) {
    Box2D.init();

    SCORE = score;
    this.isRelife = isRelife;

    preferences = new GamePreferences();
    audioManager = AudioManager.getInstance();

    aGame = game;
    stage = new Stage(new StretchViewport(Constants.WIDTH, Constants.HEIGHT));
    world = WorldUtils.createWorld();
    world.setContactListener(this);

    FlappySpinner.gameManager.changeBackgroundColor("#e9fcd9");

    Gdx.input.setInputProcessor(stage);

    state = GameState.RESUME;

    setUpBackground();
    setUpTube();
    setUpSpinner();
    setUpGround();

    setUpOnPause();
    setUpOnResume();
    setUpOnFinish();

    setUpButtons();
    setUpLabels();
}
项目:ClickerGame    文件:AbstractScreen.java   
public AbstractScreen(ClickerGame game) {
    this.game = game;
    createCamera();
    stage = new Stage(new StretchViewport(ClickerGame.WIDTH, ClickerGame.HEIGHT));
    spriteBatch = new SpriteBatch();
    Gdx.input.setInputProcessor(stage);
    init();
}
项目:Undertailor    文件:EnvironmentManager.java   
public EnvironmentManager(Undertailor tailor) {
    this.tailor = tailor;
    this.activeEnvironment = null;
    this.events = new EventHelper(this);
    this.environments = new ObjectMap<>();
    this.globalSched = new Scheduler(null);

    this.viewportType = tailor.getLaunchOptions().scaling == ViewportType.FIT
        ? FitViewport.class : StretchViewport.class;
}
项目:pixelhorrorjam2016    文件:MainMenu.java   
@Override
public void show() {
    _camera = new OrthographicCamera(MAIN_MENU_WIDTH, MAIN_MENU_HEIGHT);
    _camera.translate(MAIN_MENU_WIDTH / 2, MAIN_MENU_HEIGHT / 2);
    _viewport = new StretchViewport(MAIN_MENU_WIDTH, MAIN_MENU_HEIGHT, _camera);

    _batch = new SpriteBatch();
    _shapeRenderer = new ShapeRenderer();

    FreeTypeFontGenerator generator = new FreeTypeFontGenerator(Gdx.files.internal("font/raleway/Raleway-Medium.ttf"));
    FreeTypeFontParameter parameter = new FreeTypeFontParameter();
    parameter.size = 64;
    parameter.borderColor = Color.GRAY;
    parameter.borderWidth = 2;

    _titleFont = generator.generateFont(parameter);
    _titleFont.setColor(Color.WHITE);

    parameter.borderWidth = 1;
    parameter.size = 20;
    _font = generator.generateFont(parameter);
    _font.setColor(Color.WHITE);
    parameter.size = 8;
    _tinyfont = generator.generateFont(parameter);
    _tinyfont.setColor(Color.WHITE);

    _background = new Sprite(new Texture("MainMenuBackground.png"));
    _background.setSize(MAIN_MENU_WIDTH, MAIN_MENU_HEIGHT);
    _background.setPosition(0, 0);

    _snowAnimation = new SnowAnimation(50, 4, MAIN_MENU_WIDTH, MAIN_MENU_HEIGHT);

    _fade = 1.5f;
    _fadeIn = true;

    Gdx.input.setInputProcessor(this);
}
项目:Battle-City-Multiplayer    文件:GameScreen.java   
public GameScreen() {
    camera = new OrthographicCamera(Presets.WORLD_WIDTH +
            Presets.SIDEBAR_WIDTH,
            Presets.WORLD_HEIGHT);
    this.camera.position.set((camera.viewportWidth * 0.5f),
            (camera.viewportHeight * 0.5f),
            0);
    this.camera.update();
    viewport
            = new StretchViewport(camera.viewportWidth,
                    camera.viewportHeight,
                    camera);
    viewport.apply();
}
项目:cocos-ui-libgdx    文件:DemoScreen.java   
@Override
public void show() {
    super.show();
    stage = new Stage(new StretchViewport(DemoGame.GAME_WIDTH, DemoGame.GAME_HEIGHT));
    InputMultiplexer multiplexer = new InputMultiplexer();
    multiplexer.addProcessor(stage);
    initDemoChange(multiplexer);
    Gdx.input.setInputProcessor(multiplexer);
    findAllDemos();
    defaultFont = Gdx.files.internal("share/MLFZS.TTF");
    changeDemo();
}
项目:cocos-ui-libgdx    文件:DemoScreen.java   
private void initDemoChange(InputMultiplexer multiplexer) {
    Stage demoChangeStage = new Stage(new StretchViewport(DemoGame.GAME_WIDTH, DemoGame.GAME_HEIGHT));
    Actor actor = new Actor();
    actor.setWidth(stage.getWidth());
    actor.setHeight(stage.getHeight());
    actor.addListener(new ClickListener() {
        @Override
        public void clicked(InputEvent event, float x, float y) {
            updateCurrentIndex();
            changeDemo();
        }
    });
    demoChangeStage.addActor(actor);
    multiplexer.addProcessor(demoChangeStage);
}
项目:TerraLegion    文件:CraftingScreen.java   
@Override
public void create() {
    camera = new OrthoCamera();
    camera.resize();

    stageSb = new SpriteBatch();
    stage = new Stage(new StretchViewport(Settings.getWidth(), Settings.getHeight()), stageSb);

    //CATEGORY BUTTONS
    stage.addActor(toolCategoryBtn.getImageButton());
    stage.addActor(furnitureCategoryBtn.getImageButton());

    ScrollPane.ScrollPaneStyle paneStyle = new ScrollPane.ScrollPaneStyle();
    paneStyle.background = new TextureRegionDrawable(new TextureRegion(ResourceManager.getInstance().getTexture("invStageBg")));
    //paneStyle.vScrollKnob = new TextureRegionDrawable();
    //paneStyle.hScroll = paneStyle.hScrollKnob = paneStyle.vScroll = paneStyle.vScrollKnob;

    Table craftingContainer = CachePool.getTable();
    usedTablesCache.add(craftingContainer);
    float startX = (Settings.getWidth() / 2) - 255;
    craftingContainer.setBounds(startX, 0, 370, Settings.getHeight() - 61);

    craftingTable = CachePool.getTable();
    stage.addListener(new CraftingButtonClickListener(stage, craftingTable, craftingContainer.getX(), craftingContainer.getY()));
    usedTablesCache.add(craftingTable);

    pane = new ScrollPane(craftingTable, paneStyle);
    craftingContainer.add(pane).width(370).height(Settings.getHeight() - 61);
    craftingContainer.row();
    stage.addActor(craftingContainer);

    itemNameLabel = new Label("", ResourceManager.getInstance().getFont("font"), startX + 370 + 10, Settings.getHeight() - 61 - 35, false);
    itemInfoLabel = new MultilineLabel("", ResourceManager.getInstance().getFont("font"), startX + 370 + 10, Settings.getHeight() - 61 - 85, false);

    populateCraftableItems(toolCategoryBtn.getCategory());

    InputController.getInstance().addInputProcessor(stage);
}