当前位置: 首页>>代码示例>>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;未经允许,请勿转载。