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


Java Viewport.update方法代碼示例

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


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

示例1: RenderSystem

import com.badlogic.gdx.utils.viewport.Viewport; //導入方法依賴的package包/類
public RenderSystem(DecalBatch decalBatch, AssetManager assetManager, float worldDegree, Assets.LevelAssets assets) {
    super(Aspect.all(RenderComponent.class, PositionComponent.class));
    this.levelAssets = assets;
    decalMap = new ObjectMap<>();
    uiMap = new ObjectMap<>();
    this.decalBatch = decalBatch;
    this.assetManager = assetManager;
    buffers = new ObjectMap<>();

    this.spriteBatch = new SpriteBatch();
    this.font = assets.uifont;
    font.setColor(Color.BLACK);
    this.uiCamera = new OrthographicCamera();

    Viewport viewportUi = new FitViewport(levelAssets.health_bar_gradient.getWidth(), levelAssets.health_bar_gradient.getHeight(), uiCamera);
    viewportUi.update(viewportUi.getScreenWidth(), viewportUi.getScreenHeight(), true);

    stateTime = 0;
    this.worldDegree = worldDegree;

    gradientShader = new ShaderProgram(Shaders.GradientShader.vertexShader, Shaders.GradientShader.fragmentShader);
    if (gradientShader.isCompiled() == false)
        throw new IllegalArgumentException("couldn't compile shader: " + gradientShader.getLog());
    shaderBatch = new SpriteBatch(10, gradientShader);
}
 
開發者ID:EtherWorks,項目名稱:arcadelegends-gg,代碼行數:26,代碼來源:RenderSystem.java

示例2: resize

import com.badlogic.gdx.utils.viewport.Viewport; //導入方法依賴的package包/類
@Override
public void resize(Stage stage, int width, int height) {
    final Viewport viewport = stage.getViewport();
    viewport.update(width, height, true);

    toastManager.resize();

    LmlData lmlData = interfaceService.getParser().getData();
    lmlData.addArgument("stageWidth", stage.getWidth());
    lmlData.addArgument("stageHeight", stage.getHeight());
}
 
開發者ID:crashinvaders,項目名稱:gdx-texture-packer-gui,代碼行數:12,代碼來源:MainController.java

示例3: processEntity

import com.badlogic.gdx.utils.viewport.Viewport; //導入方法依賴的package包/類
@Override
protected void processEntity(Entity entity, float deltaTime)
{
	ViewportResizeComponent vrc = Mappers.viewportResizeMap.get(entity);
	StageComponent sc = Mappers.stageMap.get(entity);

	Viewport vp = sc.getStage().getViewport();
	vp.update(vrc.getScreenWidth(), vrc.getScreenHeight(), true);
	vp.setWorldSize(vrc.getViewportWidth(), vrc.getViewportHeight());

	entity.remove(ViewportResizeComponent.class);
}
 
開發者ID:kLeZ,項目名稱:LibGDX-MVC-Tutorial,代碼行數:13,代碼來源:ViewportResizeSystem.java

示例4: resize

import com.badlogic.gdx.utils.viewport.Viewport; //導入方法依賴的package包/類
@Override
public void resize(final int width, final int height) {
  Viewport _viewport = this.stage.getViewport();
  _viewport.update(width, height, false);
  Class<? extends BasicScreen> _class = this.getClass();
  String _simpleName = _class.getSimpleName();
  String _plus = ((((("Resized to:" + Integer.valueOf(width)) + ",") + Integer.valueOf(height)) + " in ") + _simpleName);
  ClientConstants.LOG.info(_plus);
  this.saveScreeenSize();
}
 
開發者ID:CymricNPG,項目名稱:abattle,代碼行數:11,代碼來源:BasicScreen.java

示例5: resize

import com.badlogic.gdx.utils.viewport.Viewport; //導入方法依賴的package包/類
@Override
public void resize(final Stage stage, final int width, final int height) {
    final Viewport viewport = stage.getViewport();
    final boolean centerCamera = viewport instanceof ScreenViewport
            || viewport instanceof LetterboxingViewport
            || viewport instanceof ExtendViewport;
    viewport.update(width, height, centerCamera);
}
 
開發者ID:czyzby,項目名稱:gdx-lml,代碼行數:9,代碼來源:StandardViewResizer.java

示例6: resize

import com.badlogic.gdx.utils.viewport.Viewport; //導入方法依賴的package包/類
@Override
public void resize(int width, int height) {
	Viewport viewport = stage.getViewport();
	viewport.update(width, height, true);
	viewportRectangle.set(viewport.getScreenX(), viewport.getScreenY(), viewport.getScreenWidth(), viewport.getScreenHeight());
}
 
開發者ID:spookygames,項目名稱:gdx-gfx,代碼行數:7,代碼來源:GdxGfxDemo.java


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