javafx.scene.image.ImageView.getLayoutX()方法的使用及代码示例

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

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

ImageView.getLayoutX介绍

暂无

代码示例

代码示例来源:origin: ch.sahits.game/OpenPatricianDisplay

/**
 * Initialize the polygons
 * @param polygons List of polygons that are to be reset.
 */
public void resetPolygons(List<Polygon> polygons) {
  ImageView imageView = getImageView();
  for (int i = 0; i < polygons.size(); i++) {
    Polygon polygon = polygons.get(i);
    if (imageView != null) {
      polygon.setLayoutX(imageView.getLayoutX());
      polygon.setLayoutY(imageView.getLayoutY());
    }
    if (withPolygonShading) {
      polygon.setFill(colors[i%colors.length]);
      polygon.setOpacity(0.5);
    } else {
      polygon.setFill(Color.TRANSPARENT);
    }
    getChildren().add(polygon);
  }
}

代码示例来源:origin: ch.sahits.game/OpenPatricianJavaFX

private ImageView createShield(INavigableVessel vessel) {
  Image shieldImg = imageLoader.getImage("icons/Shield_" + getShieldColorName(vessel));
  ImageView imgView = new ImageView(shieldImg);
  imgView.setLayoutX(shipIconView.getLayoutX());
  DoubleBinding relYOrigin = shieldYOffsetBinding();
  imgView.layoutYProperty().bind(relYOrigin);
  imgView.layoutXProperty().bind(shipIconView.layoutXProperty());
  return imgView;
}

代码示例来源:origin: ch.sahits.game/OpenPatricianDisplay

cashTxt.setLayoutX(cashPile.getLayoutX() + 38 + spacing);
cashTxt.setTextOrigin(VPos.BASELINE);
cashTxt.setLayoutY(30);

相关文章