Some sprite applications (namely pulpcore) allows you to define an anchor point for an object.
For example if the anchor point of a rectangle is 0,0
and it's coordinates are x:0,y:0
the top left point of the rectangle would be displayed on the top left point of the screen.
If however the anchor point of the rectangle is 50,50
and it's size is 100x100
, the middle of the rectangle would be placed at 0,0
and only it's bottom-right part would be displayed.
Is there a similar property in JavaFX? Is there an easy way to implement this (can you bind the x
and the y
coordinates of a JavaFX node to its own height and width?)?
When I bind the x,y
coordinates to boundsInLocal/Parent.width
I get a runtime exception.