【问题标题】:Clones or duplicate shapes in javafx?javafx中的克隆或重复形状?
【发布时间】:2015-01-17 19:20:41
【问题描述】:

我正在 javafx 中使用 Scenebuilder 2.0 为 GUI 制作 Connect 4 游戏。 这基本上是芯片从顶部下来的动画:

@FXML
private void click0(javafx.event.ActionEvent event) {


    TranslateTransition translate = new TranslateTransition(
            Duration.millis(750));
    translate.setToX(1);
    translate.setToY(432);
    ParallelTransition transition = new ParallelTransition(c0,translate);
    transition.setCycleCount(1);
    transition.play();

}

当我单击所有行正下方的按钮时会发生这种情况。它还没有接近完成。但是我怎样才能让圆圈(c0)的副本保持在原始位置?

【问题讨论】:

    标签: java eclipse javafx scenebuilder


    【解决方案1】:

    Duplicator 在当前版本中不再可用。

    我发现的唯一方法是一个肮脏的黑客:

    Shape.union(c0, c0);
    

    ... 是的。它很脏,不再是一个圆圈了。

    answer given here 不符合我的需要。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2012-10-06
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2012-05-23
      • 2020-03-04
      • 1970-01-01
      • 2010-09-29
      相关资源
      最近更新 更多