本文整理汇总了Java中com.badlogic.gdx.utils.viewport.FillViewport类的典型用法代码示例。如果您正苦于以下问题:Java FillViewport类的具体用法?Java FillViewport怎么用?Java FillViewport使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
FillViewport类属于com.badlogic.gdx.utils.viewport包,在下文中一共展示了FillViewport类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: show
import com.badlogic.gdx.utils.viewport.FillViewport; //导入依赖的package包/类
/**
* Chamado quando a tela é exibida
*/
@Override
public void show() {
camera = new OrthographicCamera(Gdx.graphics.getWidth(), Gdx.graphics.getHeight());
batch = new SpriteBatch();
stage = new Stage(new FillViewport(camera.viewportWidth, camera.viewportHeight, camera));
stageInfo = new Stage(new FillViewport(camera.viewportWidth, camera.viewportHeight, camera));
initSound();
initTextures();
initFont();
initPlayer();
initInformation();
recPlayer = new Rectangle();
recShot = new Rectangle();
recShot = new Rectangle();
recEnemy = new Rectangle();
}
示例2: getViewports
import com.badlogic.gdx.utils.viewport.FillViewport; //导入依赖的package包/类
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;
}
示例3: Final
import com.badlogic.gdx.utils.viewport.FillViewport; //导入依赖的package包/类
/**
* Contructor de la clase
*/
public Final(){
stage = new Stage(new FillViewport(Gdx.graphics.getWidth(), Gdx.graphics.getHeight()));
camara = new OrthographicCamera();
batch = new SpriteBatch();
Gdx.input.setInputProcessor(stage);
textura = new Texture(Gdx.files.internal(GestorImagen.URL_PANTALLA_FINAL));
musica = Gdx.audio.newMusic(Gdx.files.internal("Musica/Tension.mp3"));
musica.play();
// instanciamos la cámara
camara.position.set(TheHouseOfCrimes.WIDTH / 2f, TheHouseOfCrimes.HEIGHT / 2f, 0);
viewport = new FillViewport(TheHouseOfCrimes.WIDTH, TheHouseOfCrimes.HEIGHT, camara);
salir = new BotonSalir(game, true);
salir.setTouchable(Touchable.enabled);
stage.addActor(salir);
}
示例4: Introduccion
import com.badlogic.gdx.utils.viewport.FillViewport; //导入依赖的package包/类
/**
* Constructor de la clase
*/
public Introduccion() {
stage = new Stage(new FillViewport(Gdx.graphics.getWidth(), Gdx.graphics.getHeight()));
camara = new OrthographicCamera();
batch = new SpriteBatch();
Gdx.input.setInputProcessor(stage);
textura = new Texture(Gdx.files.internal(GestorImagen.URL_PANTALLA_INTRO));
musica = Gdx.audio.newMusic(Gdx.files.internal("Musica/Tension.mp3"));
musica.play();
// instanciamos la cámara
camara.position.set(TheHouseOfCrimes.WIDTH / 2f, TheHouseOfCrimes.HEIGHT / 2f, 0);
viewport = new FillViewport(TheHouseOfCrimes.WIDTH, TheHouseOfCrimes.HEIGHT, camara);
//Actores
botonContinuar = new BotonContinuar(game);
botonContinuar.setTouchable(Touchable.enabled);
stage.addActor(botonContinuar);
}
示例5: Creditos
import com.badlogic.gdx.utils.viewport.FillViewport; //导入依赖的package包/类
/**
* Contructor de la clase
*/
public Creditos(){
stage = new Stage(new FillViewport(Gdx.graphics.getWidth(), Gdx.graphics.getHeight()));
camara = new OrthographicCamera();
batch = new SpriteBatch();
Gdx.input.setInputProcessor(stage);
pantalla = new Texture(Gdx.files.internal(GestorImagen.URL_PANTALLA_CREDITOS));
// instanciamos la cámara
camara.position.set(TheHouseOfCrimes.WIDTH / 2f, TheHouseOfCrimes.HEIGHT / 2f, 0);
viewport = new FillViewport(TheHouseOfCrimes.WIDTH, TheHouseOfCrimes.HEIGHT, camara);
botonSalir = new BotonSalirCreditos(game);
botonSalir.setTouchable(Touchable.enabled);
stage.addActor(botonSalir);
}
示例6: Diccionario
import com.badlogic.gdx.utils.viewport.FillViewport; //导入依赖的package包/类
public Diccionario(){
stage = new Stage(new FillViewport(Gdx.graphics.getWidth(), Gdx.graphics.getHeight()));
camara = new OrthographicCamera();
batch = new SpriteBatch();
Gdx.input.setInputProcessor(stage);
pantalla = new Texture(Gdx.files.internal(GestorImagen.URL_PANTALLA_DICCIONARIO));
salirDiccionario = new BotonSalirDiccionario(game);
salirDiccionario.setTouchable(Touchable.enabled);
// instanciamos la cámara
camara.position.set(TheHouseOfCrimes.WIDTH / 2f, TheHouseOfCrimes.HEIGHT / 2f, 0);
viewport = new FillViewport(TheHouseOfCrimes.WIDTH, TheHouseOfCrimes.HEIGHT, camara);
// Música
musica = Gdx.audio.newMusic(Gdx.files.internal("Musica/Inventario.mp3"));
musica.setLooping(true);
musica.play();
stage.addActor(salirDiccionario);
}
示例7: create
import com.badlogic.gdx.utils.viewport.FillViewport; //导入依赖的package包/类
@Override
public void create () {
this.resize(Config.width,Config.height);
// VisUI.load("skins/tixel/x1/tixel.json");
VisUI.load();
mainViewPort = new FillViewport(Config.width,Config.height);
mainStage = new MainStage(mainViewPort);
Gdx.input.setInputProcessor(mainStage);
}
示例8: inetilate_camera
import com.badlogic.gdx.utils.viewport.FillViewport; //导入依赖的package包/类
private void inetilate_camera() {
// TODO Auto-generated method stub
pages_camera = new OrthographicCamera(/*M.game_camera_width, M.game_camera_height*/) ;
pages_viewport = new FillViewport(screen_width,screen_height, pages_camera);
pages_camera.position.x = screen_width/2 ;
pages_camera.position.y = screen_height/2;
managment_camera = new OrthographicCamera() ;
managment_viewport = new FillViewport(screen_width, screen_height , managment_camera);
managment_camera.position.x = screen_width /2 ;
managment_camera .position.y = screen_height/2 ;
}
示例9: Hud
import com.badlogic.gdx.utils.viewport.FillViewport; //导入依赖的package包/类
public Hud(SpriteBatch batch){
viewport = new FillViewport(Config.SCREEN_WIDTH,Config.SCREEN_HEIGHT,new OrthographicCamera());
stage = new Stage(viewport,batch);
labelHP = new Label("HP: 100/100", Assets.getInstance().getSkin());
labelVP = new Label("VP: 100/100",Assets.getInstance().getSkin());
table = new Table();
table.setFillParent(true);
table.top().right().padTop(20).padRight(20).setDebug(false);
table.add(labelHP);
table.row();
table.add(labelVP);
stage.addActor(table);
}
示例10: Chat
import com.badlogic.gdx.utils.viewport.FillViewport; //导入依赖的package包/类
public Chat(SpriteBatch batch){
field = new TextField("", Assets.getInstance().getSkin());
field.setVisible(false);
table = new Table();
table.bottom().padLeft(20).padRight(20).padBottom(10).setFillParent(true);
table.setDebug(false);
table.add(field).width(Config.SCREEN_WIDTH-40);
stage = new Stage(new FillViewport(Config.SCREEN_WIDTH,Config.SCREEN_HEIGHT,new OrthographicCamera()),batch);
stage.addActor(table);
stage.setKeyboardFocus(field);
}
示例11: resize
import com.badlogic.gdx.utils.viewport.FillViewport; //导入依赖的package包/类
@Override
public final void resize(int width, int height) {
if (stage == null) {
stage = new Stage(new FillViewport(1000, 600));
initStage(stage);
tooltip.init(tweenManager, stage, camera);
input.addProcessor(stage);
}
camera.setToOrtho(false, 1000, 600);
onResize(width, height);
}
示例12: show
import com.badlogic.gdx.utils.viewport.FillViewport; //导入依赖的package包/类
@Override
public void show() {
camera = new OrthographicCamera(Gdx.graphics.getWidth(), Gdx.graphics.getHeight());
stage = new Stage(new FillViewport(camera.viewportWidth, camera.viewportHeight, camera));
Gdx.input.setInputProcessor(stage);
initFonts();
initLabels();
initButtons();
}
示例13: Inicio
import com.badlogic.gdx.utils.viewport.FillViewport; //导入依赖的package包/类
/**
* Constructor de la clase Inicio.
* @param game
*/
public Inicio(TheHouseOfCrimes game){
Inicio.game = game;
stage = new Stage(new FillViewport(Gdx.graphics.getWidth(), Gdx.graphics.getHeight()));
camara = new OrthographicCamera();
batch = new SpriteBatch();
//musica
/*if(MyGdxGame.SUSPENSE_MUSICA)
musica = Gdx.audio.newMusic(Gdx.files.internal("Musica/titulo.mp3"));
else*/
musica = Gdx.audio.newMusic(Gdx.files.internal("Musica/TituloSinSuspense.mp3"));
musica.play();
//instanciamos la cámara
camara.position.set(TheHouseOfCrimes.WIDTH / 2f, TheHouseOfCrimes.HEIGHT / 2f ,0);
viewport = new FillViewport(TheHouseOfCrimes.WIDTH, TheHouseOfCrimes.HEIGHT, camara);
//añadimos botones y hacemos que sean tocables
inicio = new BotonInicio(game);
inicio.setTouchable(Touchable.enabled);
salir = new BotonSalir(game, false);
salir.setTouchable(Touchable.enabled);
creditos = new BotonCreditos(game);
creditos.setTouchable(Touchable.enabled);
Gdx.input.setInputProcessor(stage);
//se añaden los botones
stage.addActor(inicio);
stage.addActor(salir);
stage.addActor(creditos);
}
示例14: KyperBoxGame
import com.badlogic.gdx.utils.viewport.FillViewport; //导入依赖的package包/类
public KyperBoxGame() {
this(new FillViewport(Resolutions._720.WIDTH(), Resolutions._720.HEIGHT()));
}
示例15: TileCollisionTest
import com.badlogic.gdx.utils.viewport.FillViewport; //导入依赖的package包/类
public TileCollisionTest() {
super(new FillViewport(1280, 720));
}