下面列出了javafx.scene.shape.Shape#setLayoutY ( ) 实例代码,或者点击链接到github查看源代码,也可以在右侧发表评论。
private Shape createPiece() {
Shape shape = createPieceRectangle();
if (hasRightTab) {
shape = Shape.union(shape,
createPieceTab(69.5f, 0f, 10f, 17.5f, 50f, -12.5f, 11.5f,
25f, 56.25f, -14f, 6.25f, 56.25f, 14f, 6.25f));
}
if (hasBottomTab) {
shape = Shape.union(shape,
createPieceTab(0f, 69.5f, 17.5f, 10f, -12.5f, 50f, 25f,
11f, -14f, 56.25f, 6.25f, 14f, 56.25f, 6.25f));
}
if (hasLeftTab) {
shape = Shape.subtract(shape,
createPieceTab(-31f, 0f, 10f, 17.5f, -50f, -12.5f, 11f,
25f, -43.75f, -14f, 6.25f, -43.75f, 14f, 6.25f));
}
if (hasTopTab) {
shape = Shape.subtract(shape,
createPieceTab(0f, -31f, 17.5f, 10f, -12.5f, -50f, 25f,
12.5f, -14f, -43.75f, 6.25f, 14f, -43.75f, 6.25f));
}
shape.setTranslateX(correctX);
shape.setTranslateY(correctY);
shape.setLayoutX(50f);
shape.setLayoutY(50f);
return shape;
}