com.badlogic.gdx.scenes.scene2d.ui.Image.setHeight()方法的使用及代码示例

x33g5p2x  于2022-01-21 转载在 其他  
字(2.5k)|赞(0)|评价(0)|浏览(128)

本文整理了Java中com.badlogic.gdx.scenes.scene2d.ui.Image.setHeight()方法的一些代码示例,展示了Image.setHeight()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Image.setHeight()方法的具体详情如下:
包路径:com.badlogic.gdx.scenes.scene2d.ui.Image
类名称:Image
方法名:setHeight

Image.setHeight介绍

暂无

代码示例

代码示例来源:origin: langurmonkey/gaiasky

@Override
public void setHeight(float height) {
  ownheight = height;
  super.setHeight(height);
}

代码示例来源:origin: dingjibang/GDX-RPG

public void setHeight(float height) {
  super.setHeight((int)height);
}

代码示例来源:origin: peakgames/libgdx-stagebuilder

private void prepareBackgroundImage(AssetsInterface assets, float sizeMult) {
  TextureAtlas atlas = assets.getTextureAtlas(this.atlasName);
  this.backgroundImage = new Image(atlas.findRegion(this.backgroundImageFrame));
  this.backgroundImage.setWidth(this.backgroundImage.getWidth() * sizeMult);
  this.backgroundImage.setHeight(this.backgroundImage.getHeight() * sizeMult);
}

代码示例来源:origin: peakgames/libgdx-stagebuilder

private void updateBackgroundImagePosition(Image image) {
  Vector2 selectedResolution = assets.findBestResolution();
  Vector2 backGroundSize = resolutionHelper.calculateBackgroundSize(selectedResolution.x, selectedResolution.y);
  image.setWidth(backGroundSize.x);
  image.setHeight(backGroundSize.y);
  Vector2 backGroundPosition = resolutionHelper.calculateBackgroundPosition(image.getWidth(), image.getHeight());
  Vector2 gameAreaPosition = resolutionHelper.getGameAreaPosition();
   /*
    * stage root position is always set to gameAreaPosition.
    * Since the bg image is also inside the root group, bg image position should be updated.
   */
  image.setPosition(backGroundPosition.x - gameAreaPosition.x, backGroundPosition.y - gameAreaPosition.y);
}

代码示例来源:origin: peakgames/libgdx-stagebuilder

private Image createImage() {
    if (region == null) {
      region = game.getAssetsInterface()
          .getTextureAtlas("common.atlas").findRegion("accept_button");
    }
    
    Image image = new Image(region);
    image.setWidth(image.getMinWidth() * game.getResolutionHelper().getSizeMultiplier());
    image.setHeight(image.getMinHeight() * game.getResolutionHelper().getSizeMultiplier());
    return image;
  }
}

代码示例来源:origin: Var3D/var3dframe

img_bg.setHeight(height);
img_bg.setPosition(getWidth() / 2, getHeight() / 2, Align.center);
img_bg.setColor(model.bgColor);

代码示例来源:origin: kbz/SIFTrain

splashImage.setHeight(stage.getHeight());
splashImage.setWidth(stage.getWidth());
stage.addActor(splashImage);

代码示例来源:origin: kbz/SIFTrain

float scaleFactor = stage.getHeight() / GlobalConfiguration.BASE_HEIGHT;
warnings = false;
backgroundImage.setHeight(stage.getHeight());
backgroundImage.setWidth(stage.getWidth());
stage.addActor(backgroundImage);

相关文章