本文整理汇总了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);
}
示例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());
}
示例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);
}
示例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();
}
示例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);
}
示例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());
}