setPivotX(50);
setPivotY(50);
As I've noticed setting the pivot point before it is added to layout is absolute, but after it is added the coordinates are relative, so for example:
setPivotX(this.getX() + 50) //current position + half width
setPivotY(this.getY() + 50) //current position + half width
this is right before it is addde to the layout, but after it is added:
setPivotX(50) //half width
setPivotY(50) //half width
this is enough, but my task is to bind one view object to rotate around the other, how can I set the coordinates of another object if the pivot points are relative since they are added to the stage(layout)?
for example:
setPivotX(anotherObject.getX() + anotherObject.getWidth() / 2);
setPivotY(anotherObject.getY() + anotherObject.getHeight() / 2);
this may worked if the setPivotX and setPivotY were getting the absolute coordinates, but they get relative from the object itself(thus (0, 0) starts from the left top point of the current view object)...how to set this right?
Aucun commentaire:
Enregistrer un commentaire