Utils/tileCoords.js

/**
 * Converts the tile position to the stage position
 *
 * @function tileCoords
 * @since 1.0.0
 * @memberof module:Utils
 *
 * @param  {number} x - the x tile position to convert.
 * @param  {number} y - the y tile position to convert.
 *
 * @returns {object} return and object with the new x and y positions
 * @example
 * import { tileCoords } from 'fenix-tools'
 *
 * const tileToCanvasPosition = tilePosition(7, 11) // => {x: 294, 460}
 *
 */
export default function tileCoords (x, y) {
  const result = {}
  result.x = x * window.$gameMap.tileWidth()
  result.y = y * window.$gameMap.tileHeight()
  return result
}