Use this method in the screen class, pass it your field:
public void ensureRegionVisible(Field field, |
Attempts to make your provided region visible.
Pass this method a field, and a region (extent), and this method attempts to scroll the screen to make as much of your region visible as possible.
If your region is smaller than the screen's visible extent, this method does as little work as possible to ensure the entire region appears on the screen.
If your region is larger than the screen's visible extent, this method produces the net effect of aligning the top left corner of your region with the top left corner of the screen's visible extent.