0

I try to get width and height of my node by this way:

bounds = node.getParent().getParent().localToScreen(node.getParent().getParent().getBoundsInLocal());

But width and height have the size more than real.

Width-Height example

Slaw
  • 37,820
  • 8
  • 53
  • 80
Adam
  • 1
  • [This](https://stackoverflow.com/questions/15013913/checking-collision-of-shapes-with-javafx) may help. – SedJ601 Sep 12 '19 at 13:32
  • I understood there is need just use getLayoutBounds() instead getBoundsInLocal() – Adam Sep 12 '19 at 14:55
  • 1
    If you haven't already, read the documentation of [`Node#boundsInLocal`](https://openjfx.io/javadoc/12/javafx.graphics/javafx/scene/Node.html#boundsInLocalProperty), [`Node#boundsInParent`](https://openjfx.io/javadoc/12/javafx.graphics/javafx/scene/Node.html#boundsInParentProperty) and [`Node#layoutBounds`](https://openjfx.io/javadoc/12/javafx.graphics/javafx/scene/Node.html#layoutBoundsProperty); doing so will help you understand the difference between those different properties. – Slaw Sep 12 '19 at 17:11

0 Answers0