public Image getTileImage ( int x , int y , int layerIndex ) { Layer layer = ( Layer ) layers . get ( layerIndex ) ; int tileSetIndex = layer . data [ x ] [ y ] [ 0 ] ; if ( ( tileSetIndex >= 0 ) && ( tileSetIndex < tileSets . size ( ) ) ) { TileSet tileSet = ( TileSet ) tileSets . get ( tileSetIndex ) ; int sheetX = tileSet . getTileX ( layer . data [ x ] [ y ] [ 1 ] ) ; int sheetY = tileSet . getTileY ( layer . data [ x ] [ y ] [ 1 ] ) ; return tileSet . tiles . getSprite ( sheetX , sheetY ) ; } return null ; }
Gets the Image used to draw the tile at the given x and y coordinates .