public void centerOnTile ( int tx , int ty ) { Rectangle trect = MisoUtil . getTilePolygon ( _metrics , tx , ty ) . getBounds ( ) ; int nx = trect . x + trect . width / 2 - _vbounds . width / 2 ; int ny = trect . y + trect . height / 2 - _vbounds . height / 2 ; // Log.info("Centering on t:" + StringUtil.coordsToString(tx, ty) + // " b:" + StringUtil.toString(trect) + // " vb: " + StringUtil.toString(_vbounds) + // ", n:" + StringUtil.coordsToString(nx, ny) + "."); setViewLocation ( nx , ny ) ; }
Moves the scene such that the specified tile is in the center .