public static int [ ] getTileScreenSize ( double [ ] worldSize , double scale ) { int screenWidth = ( int ) Math . round ( scale * worldSize [ 0 ] ) ; int screenHeight = ( int ) Math . round ( scale * worldSize [ 1 ] ) ; return new int [ ] { screenWidth , screenHeight } ; }
Calculate the screen size of a tile . Normally the screen size is expressed in pixels and should therefore be integers but for the sake of accuracy we try to keep a double value as long as possible .