JavaFX 3D How to move node using relative positions

前端 未结 2 1120
礼貌的吻别
礼貌的吻别 2020-12-20 09:59

I am trying to automate some node\'s movements. I would like to move a node on top of another node but I am not able to achieve it using a generic method.

I.E. I wr

2条回答
  •  礼貌的吻别
    2020-12-20 10:38

    Your code looks to be correct, except that you need to account for the transformations of the nodes' parents as well, in the general case that these two nodes don't have the same parent. (I assume getBoundsInParent returns the coordinates in the parent's frame of reference, not the world.)

提交回复
热议问题