JavaFX坐标系默认为YUp [英] JavaFX coordinate system defaults to YUp

查看:175
本文介绍了JavaFX坐标系默认为YUp的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在我的JavaFX应用程序中,我使用
这里是SceneBuilder预览:



从我从广泛的谷歌搜索中收集到的,JavaFX坐标系应该是Y-Down,不是Y-Up。我的JavaFX版本有问题吗?我在Mac OS X 10.12(El Capitan)上,使用JDK 1.8.0_66。

解决方案

JavaFX中的默认方向是肯定是y-down,SceneBuilder和任何其他JavaFX应用程序之间没有区别。当然,您可以应用更改此方向的变换,但默认值与预期一致。如果没有看到你的fxml,就不可能知道这里发生了什么。我的猜测是你的fxml加载到的容器有所不同。然后,视觉差异可能是由这些容器的不同布局行为引起的。


In my JavaFX Application, I use SceneBuilder by Gluon. The preview for the scene has a coordinate system of Y Down (Y increases downwards). However, when I import the fxml file into Java, the coordinates are all flipped. Here are the relevant screenshots.

Here is the Java export: And here is the SceneBuilder preview:

From what I have gathered from extensive Googling, the JavaFX coordinate system should be Y-Down, not Y-Up. Is there something wrong with my version of JavaFX? I'm on Mac OS X 10.12 (El Capitan), using JDK 1.8.0_66.

解决方案

The default orientation in JavaFX is definitely y-down and there is no difference between SceneBuilder and any other JavaFX application. Of course you can apply a transform which changes this orientation but the default is as expected. Without seeing your fxml it is impossible to tell what is going on here. My guess would be that there is a difference in the containers into which your fxml is loaded. The visual difference may then be caused by different layout behaviours of these containers.

这篇关于JavaFX坐标系默认为YUp的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆