public static void updateActorPosition(final Actor actor,final Stage stage,final Vector2 newScreenSizeInStageCoords){
  if (actor != null && stage != null) {
    actor.setPosition((int)((actor.getX() + actor.getWidth() / 2f) / stage.getWidth() * newScreenSizeInStageCoords.x - actor.getWidth() / 2f),(int)((actor.getY() + actor.getHeight() / 2f) / stage.getHeight() * newScreenSizeInStageCoords.y - actor.getHeight() / 2f));
  }
}

public static void updateActorPosition ( final Actor actor , final Stage stage , final Vector2 newScreenSizeInStageCoords ) { if ( actor != null && stage != null ) { actor . setPosition ( ( int ) ( ( actor . getX ( ) + actor . getWidth ( ) / 2f ) / stage . getWidth ( ) * newScreenSizeInStageCoords . x - actor . getWidth ( ) / 2f ) , ( int ) ( ( actor . getY ( ) + actor . getHeight ( ) / 2f ) / stage . getHeight ( ) * newScreenSizeInStageCoords . y - actor . getHeight ( ) / 2f ) ) ; } }
when called before resizing the stage , moves the actor to match the same aspect ratio as before . useful for windows and dialogs in screen viewports .
