我可以通过 css 将背景图像添加到 JavaFx 中的节点,如下所示:
.backgroundImage {
-fx-background-image: url("../Image.png");
-fx-background-size: 100 100;
-fx-background-position: 0 0;
-fx-background-repeat: no-repeat;
}
有没有一种方法可以将多个背景图像添加到一个节点?任何方式都可以,即使不是在 CSS 中。
最佳答案
这有效:
.backgroundImages {
-fx-background-image: url("../Image1.png"), url("../Image2.png");
-fx-background-size: 246 1, 6 11;
-fx-background-position: 0 0, 4 center;
-fx-background-repeat: no-repeat;
}
关于java - 如何在JavaFx中添加多个背景图像,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/27616883/