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


Java FillViewport类代码示例

本文整理汇总了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();
}
 
开发者ID:edvaldoszy,项目名称:Topicos2015-2,代码行数:22,代码来源:GameScreen.java

示例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;
}
 
开发者ID:basherone,项目名称:libgdxcn,代码行数:22,代码来源:ViewportTest1.java

示例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);
}
 
开发者ID:Gandio,项目名称:ProjectRiddle,代码行数:25,代码来源:Final.java

示例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);
}
 
开发者ID:Gandio,项目名称:ProjectRiddle,代码行数:26,代码来源:Introduccion.java

示例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);
}
 
开发者ID:Gandio,项目名称:ProjectRiddle,代码行数:23,代码来源:Creditos.java

示例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);
}
 
开发者ID:Gandio,项目名称:ProjectRiddle,代码行数:24,代码来源:Diccionario.java

示例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);
	}
 
开发者ID:whitecostume,项目名称:libgdx_ui_editor,代码行数:10,代码来源:MainEditor.java

示例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 ;
		
		
		
}
 
开发者ID:omar6597,项目名称:alquran-alkarem,代码行数:16,代码来源:book.java

示例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);
}
 
开发者ID:guojiank,项目名称:skycity,代码行数:15,代码来源:Hud.java

示例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);
}
 
开发者ID:guojiank,项目名称:skycity,代码行数:13,代码来源:Chat.java

示例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);
}
 
开发者ID:bitbrain,项目名称:clouboy,代码行数:12,代码来源:AbstractScreen.java

示例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();
}
 
开发者ID:edvaldoszy,项目名称:Topicos2015-2,代码行数:11,代码来源:MenuScreen.java

示例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);
}
 
开发者ID:Gandio,项目名称:ProjectRiddle,代码行数:42,代码来源:Inicio.java

示例14: KyperBoxGame

import com.badlogic.gdx.utils.viewport.FillViewport; //导入依赖的package包/类
public KyperBoxGame() {
	this(new FillViewport(Resolutions._720.WIDTH(), Resolutions._720.HEIGHT()));
}
 
开发者ID:kyperbelt,项目名称:KyperBox,代码行数:4,代码来源:KyperBoxGame.java

示例15: TileCollisionTest

import com.badlogic.gdx.utils.viewport.FillViewport; //导入依赖的package包/类
public TileCollisionTest() {
	super(new FillViewport(1280, 720));
}
 
开发者ID:kyperbelt,项目名称:KyperBox,代码行数:4,代码来源:TileCollisionTest.java


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